Skip to content

build-container: add concurrency group to prevent stale deploys - #3734

Merged
oalders merged 1 commit into
masterfrom
fix-3733
Sep 18, 2026
Merged

oalders merged 1 commit into
masterfrom
fix-3733

Conversation

@oalders

@oalders oalders commented Sep 18, 2026

Copy link
Copy Markdown
Member

Closes #3733

Problem

build-container.yml had no concurrency group, so two overlapping master builds could finish seconds apart with the slower one deploying an older commit — rolling back a newer deploy.

Change

Added a workflow-level concurrency block:

  • group: ${{ github.workflow }}-${{ github.ref }} — one group per ref, so overlapping master pushes share a group and cancel each other while PR/staging/prod builds stay independent.
  • cancel-in-progress: true — supersedes older in-progress builds; the newest commit to enter the group wins the deploy.

Used ${{ github.workflow }}-${{ github.ref }} (GitHub idiom) instead of a hardcoded build-container- prefix so it survives a workflow rename; behavior is identical.

Tradeoff

Intermediate master commits in a burst no longer get images (superseded builds are cancelled). Rollbacks target previously deployed tags, which are unaffected. This only makes the race rare; the ordering guarantee belongs in set-image.yml (metacpan/metacpan-k8s#206).

Verification

  • YAML parses; on: triggers (push/pull_request/workflow_dispatch) intact.
  • Reviewed for concurrency semantics: cancel-in-progress can only cancel older in-progress runs, never the newest, and the single-job workflow leaves no half-deployed state.

Not auto-marked ready: touches .github/workflows/**, so it is left in draft for a human review.

🤖 Generated with Claude Code · Opus 4.8

Cancel superseded in-progress builds so the newest master commit
wins the deploy race. Scoped per ref, so PR/staging/prod builds
stay independent. Fixes #3733.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@codecov

codecov Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.80%. Comparing base (b4caf5d) to head (8ee79df).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3734   +/-   ##
=======================================
  Coverage   76.80%   76.80%           
=======================================
  Files          71       71           
  Lines        2522     2522           
  Branches      360      360           
=======================================
  Hits         1937     1937           
  Misses        455      455           
  Partials      130      130           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@oalders
oalders marked this pull request as ready for review September 18, 2026 20:14
@oalders
oalders merged commit afa5bf7 into master Sep 18, 2026
16 of 17 checks passed
@oalders
oalders deleted the fix-3733 branch September 18, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build container: add concurrency group so overlapping master builds can't deploy an older commit

2 participants