From 897a03453e4db5e549f3d764fae96cdefa5668f5 Mon Sep 17 00:00:00 2001 From: tignear Date: Tue, 27 Oct 2026 16:08:27 +0900 Subject: [PATCH] ci: let required title checks finish independently Concurrent synchronize and edited events on #2231 left a canceled PR Title run alongside a successful run on the same head. Mergify still reported its Conventional Commit title success condition unmet and withdrew queue admission. Remove PR Title concurrency so every event reaches a validation result. Setting cancel-in-progress to false alone still permits pending-run replacement. Keep edited events, trusted validators, release-impact checks and required check names unchanged. The tradeoff is running each short read-only validation instead of coalescing duplicates. Validation: 34 title, release-impact, merge-queue title and Mergify configuration tests pass. The workflow regression disallows concurrency at both workflow and job scope and retains edit validation. This prevents future automatic cancellations after the default-branch workflow is updated; it does not rewrite historical canceled checks. Change-Id: I0c9230f46154c3fc34994586bca4a0ceb56ce8ce --- .github/workflows/pr-title.yml | 9 ++++----- scripts/check-pr-title.test.mjs | 7 ++++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pr-title.yml b/.github/workflows/pr-title.yml index 8df2453d6c1..4a9aaf12151 100644 --- a/.github/workflows/pr-title.yml +++ b/.github/workflows/pr-title.yml @@ -5,11 +5,10 @@ on: types: [opened, edited, synchronize, reopened] merge_group: -# Keep only the newest request for each PR, including queue-description edits. -# Still validate every surviving event: skipping edits could mask a failed check. -concurrency: - group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.event.merge_group.head_sha || github.run_id }} - cancel-in-progress: ${{ github.event_name == 'pull_request_target' }} +# Every event must finish this required check. A canceled duplicate can be +# selected by Mergify over a successful run on the same head SHA. Do not use +# concurrency here: even cancel-in-progress: false replaces pending runs. +# These short, read-only validations are safe to run independently. permissions: contents: read diff --git a/scripts/check-pr-title.test.mjs b/scripts/check-pr-title.test.mjs index 45a29d864d0..76d13cfa9b4 100644 --- a/scripts/check-pr-title.test.mjs +++ b/scripts/check-pr-title.test.mjs @@ -58,11 +58,12 @@ test("guards the repository setting that exposes the title to release automation ); }); -test("title requests coalesce per PR without skipping edit validation", () => { +test("title events finish independently without skipping edit validation", () => { const workflow = readFileSync(new URL("../.github/workflows/pr-title.yml", import.meta.url), "utf8"); assert.match(workflow, /types: \[opened, edited, synchronize, reopened\]/); - assert.match(workflow, /group: \$\{\{ github.workflow \}\}-\$\{\{ github.event_name \}\}-\$\{\{ github.event.pull_request.number \|\| github.event.merge_group.head_sha \|\| github.run_id \}\}/); - assert.match(workflow, /cancel-in-progress: \$\{\{ github.event_name == 'pull_request_target' \}\}/); + // Same-head synchronize/edited events must both reach a validation result. + // A non-canceling group also replaces pending runs; disallow job-level groups too. + assert.doesNotMatch(workflow, /^\s*concurrency:/m); assert.doesNotMatch(workflow, /github.event.action != 'edited'|queue: max/); assert.match(workflow, /github.event.pull_request.state == 'open'/); });