Repository navigation
ci: format bot no longer commits submodule pointers - #5723
Merged
Merged
Conversation
format-code.yml checked out the pull_request merge ref with submodules, so the submodule working trees sat at main's pointers. After switching to the PR branch, `git commit -am` staged those as gitlink changes and dragged main's pointers onto the PR (e.g. 8d97243 on #5664). Check out the PR head instead, and stage only non-submodule changes so a branch that moves during the run can't have its pointers reverted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5723 +/- ##
==========================================
- Coverage 75.23% 75.23% -0.01%
==========================================
Files 516 516
Lines 19022 19023 +1
Branches 3698 3698
==========================================
Hits 14312 14312
- Misses 3855 3857 +2
+ Partials 855 854 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The format-code bot's auto-commit has been dragging submodule pointers into PR branches. For example, 8d97243 ("Format code") on #5664 also moved
modules/sentry-cocoaandmodules/sentry-nativeto main's pointers.format-code.ymlchecked out thepull_requestmerge ref withsubmodules: recursive, so the submodule working trees sat at main's pointers.commit-formatted-code.shthen rangit checkout $GITHUB_HEAD_REF, which doesn't move submodule working trees, andgit commit -amstaged the mismatch as gitlink changes. This is the same failure CLAUDE.md warns about forgit add -A.It has happened on #5664, #5384, #5138, #5159 and #5238. A dragged pointer adds noise to the diff. If main bumps that submodule again before the PR merges, the squash merge conflicts on the gitlink, and resolving the conflict in the PR's favour silently reverts the bump.
There are two changes:
format-code.ymlchecks outpull_request.head.sha, the same asverify-api.yml. The formatter then runs on the tree the commit lands on, not on PR+main.commit-formatted-code.shstages only changes outsidemodules/. If the branch is pushed while the job runs (say, main merged in with a submodule bump),git checkoutmoves to a tip whose pointers differ from the working trees. With the old-a, that would revert the bump. The first change alone doesn't prevent this.Notes
verify-api.ymlshares thepr-auto-commitconcurrency group but isn't affected. Its committing job checks outhead.shawithout submodules and pushes from a detached HEAD, so itsgit add -Asees no gitlink changes.deps/*bump PRs aren't directly at risk. Across the last ~470 PRs, none got a bot format commit, because format-code only triggers onsrc/,test/andsamples/changes. Their effect is indirect: each bump that lands on main is what turns a dragged pointer on some other PR into a conflict.#skip-changelog
🤖 Generated with Claude Code