CI: bump-deployments - refresh index before checking for changes - #691
Merged
Conversation
git diff-index reports stale stat cache entries as dirty after Concourse's shallow clone resets file mtimes. Running git update-index -q --refresh first syncs the stat cache so diff-index gets an accurate read.
Contributor
WalkthroughThe deployment bump task now refreshes the Git index quietly before 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
ramonskie
approved these changes
Jul 31, 2026
Contributor
|
related to #691 |
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.
Problem
The
bump-deploymentstask fails with exit 1 even when the submodules are already pinned to the desired commits:Root cause
The task rewrites
deployment-versions.txtwithecho >on every run. After Concourse's shallow clone (which resets file mtimes), the file content is byte-identical but its stat metadata differs from git's cached stat.git diff-index --quiet HEADtrusts the stale stat cache and reports the file as modified (blob SHA0000000…), so the|| git commitbranch runs — butgit commitrefreshes the index internally, finds no real change, and exits 1, failing the task.Isolate in: https://bosh.ci.cloudfoundry.org/builds/373771172
Fix
Run
git update-index -q --refreshbefore the check. This re-hashes stat-dirty files and, when the content is unchanged, clears the dirty flag — sogit diff-index --quietgets an accurate answer and the commit is correctly skipped. A genuine submodule bump still commits normally.Verified in: https://bosh.ci.cloudfoundry.org/builds/373773086