Repository navigation
feat(spm): support commit revisions - #11815
Conversation
📝 WalkthroughWalkthroughSPM now supports ChangesSPM Git revision support
Estimated code review effort: 4 (Complex) | ~45 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@e2e/core/test_swift_slow`:
- Around line 38-50: Replace the persistent git config --global URL rewrite with
a test-local config file, and set GIT_CONFIG_GLOBAL only on the mise x, mise
install, and mise where commands that require it. Ensure the local configuration
is isolated to this test and does not affect later e2e tests.
In `@src/git.rs`:
- Around line 218-219: Update Git::checkout() to apply sanitize_git_env() before
invoking the git_cmd! checkout command, ensuring inherited GIT_DIR,
GIT_WORK_TREE, and GIT_INDEX_FILE cannot redirect it outside self.dir. Add a
regression test covering revision cloning with inherited Git work-tree
variables, including the checkout paths at both call sites.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Central YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: 102fc68f-7f7e-415b-8166-70353a10bc41
📒 Files selected for processing (4)
docs/dev-tools/backends/spm.mde2e/core/test_swift_slowsrc/backend/spm.rssrc/git.rs
Greptile SummaryThis PR adds source-built Swift Package Manager installations pinned to
Confidence Score: 5/5The PR appears safe to merge with no actionable changed-code defects identified. Commit selectors retain their installation identity while passing the raw revision to a complete Git clone and checkout, and incompatible artifact-only configurations are rejected before installation. Important Files Changed
Reviews (1): Last reviewed commit: "feat(spm): support commit revisions" | Re-trigger Greptile |
Summary
spm:installs pinned torev:<commit>and compatibleref:<commit>selectorsRoot cause
The SPM backend passed the resolved tool version directly to
Git::update_tag. Forrev:<SHA>, this produced an invalidrefs/tags/rev:<SHA>refspec instead of checking out the commit. It also attempted release artifact discovery even though a commit selector does not identify a release.Behavior
Commit selectors now preserve
rev-<SHA>orref-<SHA>as the install identity while passing only the raw revision to Git. They always use the source-build path. Configurations that require artifact bundles fail early with a clear release-version error. Existing latest, release-tag, artifact-bundle, submodule, filter, and custom install-command behavior is unchanged.Verification
mise exec -- cargo test --all-features backend::spm::testsmise exec -- cargo test --all-features clone_by_sha_does_not_panicmise run test:e2e e2e/core/test_swift_slowmise exec -- cargo check --all-featuresmise exec -- cargo clippy --workspace --all-features --all-targets -- -D warningsmise run lintreaches the knownhklimitation where this Sapling working copy is not recognized as a Git repository; all checks relevant to the changed files were run individually.Addresses #4740
AI-assisted — Tool: Codex; model: OpenAI/GPT-5; version: unavailable.