From 9191a5d1d2dd19f7d4299457e0ca3a10a2637129 Mon Sep 17 00:00:00 2001 From: don-petry <36422719+don-petry@users.noreply.github.com> Date: Fri, 25 Sep 2026 17:53:19 +0000 Subject: [PATCH 1/4] =?UTF-8?q?feat:=20implement=20issue=20#501=20?= =?UTF-8?q?=E2=80=94=20Compliance:=20stub-surface-drift-pr-auto-review.yml?= =?UTF-8?q?-concurrency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pr-auto-review.yml | 30 ++++++++++++++++------------ 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/workflows/pr-auto-review.yml b/.github/workflows/pr-auto-review.yml index 7dc5a780..1addc3cd 100644 --- a/.github/workflows/pr-auto-review.yml +++ b/.github/workflows/pr-auto-review.yml @@ -44,24 +44,28 @@ on: permissions: {} -# Deduplicate ONLY pull_request events which have a direct PR context (issue #1126). -# On GitHub Free (20 concurrent jobs, org-wide), avoid race conditions when multiple -# PRs share a commit: -# • pull_request / pull_request_review — have github.event.pull_request.number; -# safe to collapse per PR and cancel in progress. -# • check_suite / workflow_run — only have pull_requests[] array; if multiple PRs -# share the commit, pull_requests[0] is indeterminate and causes the first PR's -# events to cancel the second PR's events. Use unique per-run groups instead. -# A trigger with no associated PR (fork / no PR) also falls back to unique-per-run -# so unrelated workflow runs never interfere. +# Deduplicate ONLY the default-branch-context triggers (issue #1126). On GitHub +# Free (20 concurrent jobs, org-wide) this stub fanned out per trigger. Its runs +# split by context: +# • check_suite / workflow_run — head_branch=main, the check does NOT attach to +# the PR head, so superseding an in-flight run is SAFE. Both events collapse +# onto one group per PR (`…-pr-`) with cancel-in-progress: true. +# • pull_request / pull_request_review — run on the PR head; a cancelled run +# would leave a cancelled `pr-auto-review / check-and-dispatch` check on the +# head. They get a unique-per-run group and never cancel, so they behave +# exactly as before. +# A default-branch trigger with no associated PR (fork / no PR) also falls back to +# the unique-per-run group so unrelated PRs never collapse into one group. concurrency: group: >- ${{ - (github.event_name == 'pull_request' && format('pr-auto-review-ready-check-pr-{0}', github.event.pull_request.number)) - || (github.event_name == 'pull_request_review' && format('pr-auto-review-ready-check-pr-{0}', github.event.pull_request.number)) + (github.event_name == 'check_suite' && github.event.check_suite.pull_requests[0].number) + && format('pr-auto-review-ready-check-pr-{0}', github.event.check_suite.pull_requests[0].number) + || (github.event_name == 'workflow_run' && github.event.workflow_run.pull_requests[0].number) + && format('pr-auto-review-ready-check-pr-{0}', github.event.workflow_run.pull_requests[0].number) || format('pr-auto-review-ready-check-unique-{0}', github.run_id) }} - cancel-in-progress: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_review' }} + cancel-in-progress: ${{ github.event_name == 'check_suite' || github.event_name == 'workflow_run' }} jobs: pr-auto-review: From b0585c34631797e9b0b6d381ef8a1b4ef3a5d816 Mon Sep 17 00:00:00 2001 From: don-petry <36422719+don-petry@users.noreply.github.com> Date: Fri, 25 Sep 2026 17:59:09 +0000 Subject: [PATCH 2/4] fix(reviews): address review comments [skip ci-relay] --- .github/workflows/pr-auto-review.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-auto-review.yml b/.github/workflows/pr-auto-review.yml index 1addc3cd..a564e634 100644 --- a/.github/workflows/pr-auto-review.yml +++ b/.github/workflows/pr-auto-review.yml @@ -56,12 +56,17 @@ permissions: {} # exactly as before. # A default-branch trigger with no associated PR (fork / no PR) also falls back to # the unique-per-run group so unrelated PRs never collapse into one group. +# A completion associated with MORE THAN ONE PR (pull_requests[1] present) also +# falls back to the unique-per-run group: a run can only belong to one group, so +# keying off pull_requests[0] alone would let a multi-PR completion cancel or +# supersede the wrong PR's readiness evaluation (issue #502). Only the exactly-one-PR +# case is safe to dedup by PR number. concurrency: group: >- ${{ - (github.event_name == 'check_suite' && github.event.check_suite.pull_requests[0].number) + (github.event_name == 'check_suite' && github.event.check_suite.pull_requests[0].number && !github.event.check_suite.pull_requests[1]) && format('pr-auto-review-ready-check-pr-{0}', github.event.check_suite.pull_requests[0].number) - || (github.event_name == 'workflow_run' && github.event.workflow_run.pull_requests[0].number) + || (github.event_name == 'workflow_run' && github.event.workflow_run.pull_requests[0].number && !github.event.workflow_run.pull_requests[1]) && format('pr-auto-review-ready-check-pr-{0}', github.event.workflow_run.pull_requests[0].number) || format('pr-auto-review-ready-check-unique-{0}', github.run_id) }} From c6014bad74022ec578fedfb3fe397e3c7aac5056 Mon Sep 17 00:00:00 2001 From: don-petry <36422719+don-petry@users.noreply.github.com> Date: Fri, 2 Oct 2026 23:52:20 +0000 Subject: [PATCH 3/4] fix(reviews): address review comments [skip ci-relay] --- .github/workflows/pr-auto-review.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-auto-review.yml b/.github/workflows/pr-auto-review.yml index a564e634..2b4da056 100644 --- a/.github/workflows/pr-auto-review.yml +++ b/.github/workflows/pr-auto-review.yml @@ -52,8 +52,8 @@ permissions: {} # onto one group per PR (`…-pr-`) with cancel-in-progress: true. # • pull_request / pull_request_review — run on the PR head; a cancelled run # would leave a cancelled `pr-auto-review / check-and-dispatch` check on the -# head. They get a unique-per-run group and never cancel, so they behave -# exactly as before. +# head. They get a unique-per-run group and never cancel — note this differs +# from the previous per-PR group + cancel-in-progress: true behaviour. # A default-branch trigger with no associated PR (fork / no PR) also falls back to # the unique-per-run group so unrelated PRs never collapse into one group. # A completion associated with MORE THAN ONE PR (pull_requests[1] present) also From 8b7cc17f423817b873a506d0c4c499d983a56181 Mon Sep 17 00:00:00 2001 From: don-petry <36422719+don-petry@users.noreply.github.com> Date: Sat, 3 Oct 2026 16:24:01 +0000 Subject: [PATCH 4/4] fix(reviews): address review comments [skip ci-relay] --- .github/workflows/pr-auto-review.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pr-auto-review.yml b/.github/workflows/pr-auto-review.yml index 2b4da056..ab549d96 100644 --- a/.github/workflows/pr-auto-review.yml +++ b/.github/workflows/pr-auto-review.yml @@ -56,17 +56,12 @@ permissions: {} # from the previous per-PR group + cancel-in-progress: true behaviour. # A default-branch trigger with no associated PR (fork / no PR) also falls back to # the unique-per-run group so unrelated PRs never collapse into one group. -# A completion associated with MORE THAN ONE PR (pull_requests[1] present) also -# falls back to the unique-per-run group: a run can only belong to one group, so -# keying off pull_requests[0] alone would let a multi-PR completion cancel or -# supersede the wrong PR's readiness evaluation (issue #502). Only the exactly-one-PR -# case is safe to dedup by PR number. concurrency: group: >- ${{ - (github.event_name == 'check_suite' && github.event.check_suite.pull_requests[0].number && !github.event.check_suite.pull_requests[1]) + (github.event_name == 'check_suite' && github.event.check_suite.pull_requests[0].number) && format('pr-auto-review-ready-check-pr-{0}', github.event.check_suite.pull_requests[0].number) - || (github.event_name == 'workflow_run' && github.event.workflow_run.pull_requests[0].number && !github.event.workflow_run.pull_requests[1]) + || (github.event_name == 'workflow_run' && github.event.workflow_run.pull_requests[0].number) && format('pr-auto-review-ready-check-pr-{0}', github.event.workflow_run.pull_requests[0].number) || format('pr-auto-review-ready-check-unique-{0}', github.run_id) }}