fix(ci): give the manual-merge prod gitops PR its own branch name - #2093
Conversation
create-staging-pr and create-manual-merge-prod-pr both depend only on
build-helmreleases, so they run concurrently, and both derived
branch_name="${repo_name}/${GITHUB_SHA::8}" -- the is_staging branch and
the else branch of prepare-pr-metadata were identical. Both jobs then
raced to push the same ref into gitops-deployments and the loser failed
with "cannot lock ref ...: reference already exists", taking the gate
with it.
This only fires when a helm chart changes: with charts == '[]',
helm-charts-build skips, build-helmreleases skips, and both PR jobs skip
on build-helmreleases.result == 'success'. The last change under
k8s/charts/ landed in 2021, four years before this pipeline existed, so
the pair had never both run until PR #2092 bumped lcm-bricks to 2.0.9 and
the gate failed twice in the merge queue.
Suffix the manual-merge prod branch with _prod, following the convention
the auto-merge variant already uses (_${cluster}_automerge), and say
"for all production clusters" in the commit message and PR title so the
staging and prod PRs are distinguishable. No consumer matches on the
title: revert-staging-pr keys off commit_hash and create-pr-comment off
pr_url.
JIRA: GRIF-518
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Included review availability: 3 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour. 📝 WalkthroughWalkthroughThe GitOps deployment workflow now uses a ChangesProduction deployment naming
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to This localized change gives the manual-merge production GitOps PR a distinct branch name, preventing the documented branch collision. No actionable merge-blocking risk remains beyond normal checks and review. Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
Problem
create-staging-prandcreate-manual-merge-prod-prboth declareneeds: [prepare-build, build-helmreleases], so they start at the same time. Inprepare-pr-metadata, theis_stagingbranch and theelse(manual-merge prod) branch both derived the same branch name:Both jobs then race to push that ref into
gitops-deployments, and the loser dies with:which fails
ready-to-mergeand gets the PR ejected from the merge queue. The SHA changes on every queue attempt but the in-run collision does not, so retries fail identically — PR #2092 failed the gate twice this way (run 1, run 2).Why this surfaced only now
The colliding pair only runs when a helm chart changes. With
prepare-build.outputs.charts == '[]',helm-charts-buildskips →build-helmreleasesskips → both PR jobs skip onbuild-helmreleases.result == 'success'. The last commit underk8s/charts/wasca95a94e(2021-12-22), four years before this pipeline was written (d9c5393c/3c2d6bab, Sept–Oct 2025). Every PR merged since has been image/code-only, so the two jobs had never both run until #2092 bumpedlcm-bricksto 2.0.9.Fix
Suffix the manual-merge prod branch with
_prod, following the convention the auto-merge variant already uses (_${cluster}_automerge), and distinguish the commit message / PR title. The three names are now distinct and none is a path-prefix of another, so there's no git directory/file conflict either:gooddata-ruby/<sha>gooddata-ruby/<sha>_<cluster>_automergegooddata-ruby/<sha>_prodRetitling is safe — no consumer matches on the title:
revert-staging-prkeys offcommit_hash,create-pr-commentoffpr_url.Follow-up (not in this PR)
create-manual-merge-prod-prruns in parallel with staging validation, so the prod PR always references astablechart version thatpromote-to-stablehas not produced yet. On #2092promote-to-stablewas skipped, leaving two orphaned prod PRs (gitops-deployments#26514, #26524) pointing 8 prod clusters at astable/lcm-bricks:2.0.9that does not exist. Worth a separate ticket for the ordering.Testing
YAML parses (
yq/ruby -ryaml); theprepare-pr-metadatashell logic was executed for all three input combinations to confirm distinct branch names. Full end-to-end verification requires a chart change going through the merge queue — #2092 is that change.🤖 Generated with Claude Code
Summary by CodeRabbit