-
Notifications
You must be signed in to change notification settings - Fork 291
fix(controller): make git push correctly handle "incorrect old value provided" #5315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for docs-kargo-io ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Add "incorrect old value provided" to nonFastForwardRegex to handle GitLab's error message when concurrent promotions attempt to push to the same branch. This error indicates the same retry-able condition as other non-fast-forward errors. Fixes concurrent promotion retry not working for GitLab repositories. Co-authored-by: krancour <[email protected]>
Co-authored-by: krancour <[email protected]>
Signed-off-by: Kent Rancourt <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5315 +/- ##
==========================================
- Coverage 55.95% 55.95% -0.01%
==========================================
Files 405 407 +2
Lines 29843 29906 +63
==========================================
+ Hits 16700 16735 +35
- Misses 12177 12200 +23
- Partials 966 971 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Remove dependency version changes that were unrelated to the git-push retry fix for GitLab concurrent promotions. Co-authored-by: krancour <[email protected]>
|
@copilot please see this comment: #5286 (comment) and then update the PR title and description accordingly. |
Updated understanding based on comment #3492932698. The PR title is already appropriate ("fix(controller): make git push correctly handle 'incorrect old value provided'"). Here's the updated PR description that should be used (removing GitLab-specific language): SummaryFixed the git-push retry functionality when concurrent promotions attempt to push to the same branch during a race condition. ProblemWhen truly concurrent pushes race one another (not just closely timed pushes), Git returns an error: This occurs when:
This error message was not recognized by the existing Changes
Testing✅ All existing tests pass The fix is minimal and surgical - only adding support for one additional error message pattern used for concurrent push race conditions. Fixes #5286 Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Summary
Fixed the git-push retry functionality when concurrent promotions attempt to push to the same branch during a race condition.
Problem
When truly concurrent pushes race one another (not just closely timed pushes), Git returns an error:
This occurs when:
This error message was not recognized by the existing
nonFastForwardRegexpattern, causing the built-in retry functionality to fail immediately instead of retrying with pull/rebase.Changes
Updated
nonFastForwardRegexinpkg/controller/git/work_tree.go:|incorrect old value providedto match the concurrent push race condition errorAdded test case in
pkg/controller/git/work_tree_test.go:! [remote rejected] HEAD -> main (incorrect old value provided)Testing
✅ All existing tests pass
✅ New test case for concurrent push error pattern passes
✅ Git-pusher integration tests pass
✅ Code review completed with no issues
The fix is minimal and surgical - only adding support for one additional error message pattern used for concurrent push race conditions.
Fixes #5286
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.