Repository navigation
Submodule guard: ask GitHub when a shallow clone hides ancestry - #16018
lawrencecchen wants to merge 2 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
CI checks out submodules shallowly, so both pinned commits can be present without the history that joins them. local_relation then reported a forward Bonsplit bump as diverged (#15821) and never reached the GitHub compare. It now returns unknown in a shallow clone unless an ancestry check succeeded, and the guard asks GitHub. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
All contributors have signed the CLA ✍️ ✅ |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: manaflow-ai/cmux/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthrough
ChangesShallow submodule relation handling
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The change avoids false divergence in shallow clones, while unknown ancestry still fails the check. No merge-blocking issue remains. Security Architecture ReviewSecurity architecture risk: ⚪ Minimal · up to The change corrects false divergence reports without weakening forward-only enforcement. Unresolved ancestry still fails the check, and the existing credential permissions remain unchanged. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 24 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (24 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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 |
Summary
submodule-forward-onlyreported a forward Bonsplit bump asdivergedon #15821. GitHub compare shows the old pin 4 commits behind the new one with nothing dropped. CI checks out submodules shallowly, so both commits were present but the history joining them was not: bothmerge-base --is-ancestorchecks failed, andlocal_relationreturneddivergedwithout trying the GitHub compare.In a shallow clone,
local_relationnow returns unknown unless an ancestry check succeeded, so the guard falls back to the GitHub compare. A full clone keeps the localdivergedresult.Changelog
none
Testing
python3 -m unittest tests.test_submodule_forward_only: the new shallow-clone test failed before the fix (commit 1) and passes after it. All 14 tests pass.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Fixes
submodule-forward-onlywrongly reporting a forward Bonsplit bump asdivergedin a shallow clone, where both pinned commits exist but the history joining them does not.local_relationnow returns unknown for a shallow clone unless an ancestry check succeeded, so the guard falls back to the GitHub compare. Full clones keep the localdivergedresult.Written for commit d0c51b8. Summary will update on new commits.
Summary by CodeRabbit