Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
fix(ci): never cancel or supersede main push runs (MUL-8798) (#10708)
Jiayuan Zhang69495469def5
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex d02dea67cb..23d4d19582 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -9,9 +9,14 @@ on:- cron: "23 3 * * *"workflow_dispatch:+# Only a PR's runs supersede each other. A push filters paths against the+# commit just before it, so a cancelled main run's scope is never re-checked+# and a breaking commit lands green (MUL-8798). A shared group is not enough+# either: with cancel-in-progress off, a new run still cancels a pending one,+# so every non-PR run gets its own group.concurrency:- group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}- cancel-in-progress: true+ group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.run_id }}+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}jobs:# PRs and main pushes use the same paths. Scheduled/manual runs validate alldiff --git a/.github/workflows/mobile-verify.yml b/.github/workflows/mobile-verify.ymlindex e18bdd7619..6fcb631633 100644--- a/.github/workflows/mobile-verify.yml+++ b/.github/workflows/mobile-verify.yml@@ -41,9 +41,11 @@ on:- "turbo.json"- ".github/workflows/mobile-verify.yml"+# Same rule as ci.yml: the push path filter only sees the commits in that+# push, so a cancelled main run would never be re-checked.concurrency:- group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}- cancel-in-progress: true+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}jobs:mobile:diff --git a/scripts/ci-scope.test.mjs b/scripts/ci-scope.test.mjsindex a1ac5de4c1..0ed1494a5b 100644--- a/scripts/ci-scope.test.mjs+++ b/scripts/ci-scope.test.mjs@@ -189,6 +189,17 @@ test("no gated job or shared quality step continues past a failure", () => {assert.doesNotMatch(action, /continue-on-error:/);});+// A push only checks the paths it changed, so a main run that is cancelled or+// left pending behind a newer push skips its commit for good.+test("path-filtered workflows never cancel or supersede a main run", () => {+ for (const name of ["ci.yml", "mobile-verify.yml"]) {+ const source = readFileSync(new URL(`../.github/workflows/${name}`, import.meta.url), "utf8");+ const block = field(source, /^concurrency:\n((?: .+\n)+)/m);+ assert.match(block, /^ group: .*\$\{\{ github\.event\.pull_request\.number \|\| github\.run_id \}\}$/m, name);+ assert.match(block, /^ cancel-in-progress: \$\{\{ github\.event_name == 'pull_request' \}\}$/m, name);+ }+});+test("quality checks have exactly one runner", () => {const invocation = "uses: ./.github/actions/frontend-quality";const owners = Object.entries(jobs).filter(([, source]) => source.includes(invocation)).map(([job]) => job);