fix(gitops-update): add retry with rebase and exponential backoff on push#199
fix(gitops-update): add retry with rebase and exponential backoff on push#199
Conversation
…push When multiple services update the same GitOps repo concurrently, the push can be rejected because the remote already has new commits. This adds a retry loop (up to 5 attempts) with git pull --rebase and exponential backoff (2s, 4s, 6s, 8s, 10s) to handle race conditions. Closes #197
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughUpdated the GitOps workflow to implement retry logic with exponential backoff on git push failures. The single push command was replaced with a loop attempting up to 5 times, incorporating Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
🔍 Lint Analysis
|
🛡️ CodeQL Analysis ResultsLanguages analyzed: Found 1 issue(s): 1 Medium
🔍 View full scan logs | 🛡️ Security tab |
GitHub Actions Shared Workflows
Description
The
gitops-update.ymlworkflow currently does a singlegit push origin mainwhen updating the GitOps repo. When multiple services (e.g.,product-consoleandmidaz-ledger) trigger tag updates concurrently, one push gets rejected because the remote already advanced:This PR replaces the single push with a retry loop (up to 5 attempts) using
git pull --rebaseand exponential backoff (2s, 4s, 6s, 8s, 10s). Tag updates touch different lines per service, so rebases will almost never conflict.Recent failure: https://github.com/LerianStudio/product-console/actions/runs/23855041026/job/69560895833
Type of Change
fix: Bug fix in a workflow (incorrect behavior, broken step, wrong condition)Breaking Changes
None.
Testing
@developor the beta tagCaller repo / workflow run: To be validated after merge to
develop.Related Issues
Closes #197
Summary by CodeRabbit