From 9098edc0a519fdb4a9fca4c1a715c1f7b863a0bc Mon Sep 17 00:00:00 2001 From: donpetry-bot <{}+donpetry-bot@users.noreply.github.com> Date: Tue, 9 Jun 2026 20:40:37 -0500 Subject: [PATCH] fix(ci-status): filter the cascade's nested 'review / review' own-check (#497, #469) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The #497 self-host flip routes pr-review via a trigger stub → reusable, so the agent's own check appears in the rollup as the nested 'review / review' rather than the bare 'review'. The #469 own-check filter only matched the bare name, so a stale/failed own check now classified clean PRs as ci-failing → the agent skipped them and never re-reviewed (it skipped the entire approval backlog). Match 'review / review' exactly (not a '/ review' suffix, which would wrongly filter a genuine external 'Build / review'). Adds 3 regression tests; the existing external-check guard still passes. Promote via pr-review/stable. Part of #497 · epic #495. Co-Authored-By: Claude Opus 4.8 (1M context) --- scripts/lib/ci-status.sh | 6 ++++++ tests/test_ci_status.bats | 24 ++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/scripts/lib/ci-status.sh b/scripts/lib/ci-status.sh index e940edffe..fa82208db 100644 --- a/scripts/lib/ci-status.sh +++ b/scripts/lib/ci-status.sh @@ -30,6 +30,11 @@ # to race an in-progress branch-mutating run. # Matched: # • Bare job name: "review" +# • Nested job form "review / review" — produced once the cascade is invoked +# via the trigger stub (pr-review-trigger.yml → reusable pr-review.yml@ +# pr-review/stable), where the rollup name becomes "callerJob / reusableJob" +# rather than the bare job name (#497 self-host). Matched exactly (not by a +# "/ review" suffix) so a genuine external "Build / review" is NOT filtered. # • "PR Review Agent / *" # • "PR Review Reusable / *" # • "PR Review — Mention Trigger / *" @@ -46,6 +51,7 @@ compute_ci_status() { def is_own_check: (.name // .context // "") as $n | ($n == "review") or + ($n == "review / review") or ($n | test("^PR Review (Agent|Reusable) /")) or ($n | test("^PR Review — Mention Trigger /")); if (. == null or (type != "array")) then "passing" diff --git a/tests/test_ci_status.bats b/tests/test_ci_status.bats index db7cdf871..54e475838 100644 --- a/tests/test_ci_status.bats +++ b/tests/test_ci_status.bats @@ -164,6 +164,30 @@ rollup() { [ "$output" = "passing" ] } +# #497 self-host: invoked via the trigger stub, the cascade's own check appears +# as the nested "review / review" — must still be filtered so a stale/failed own +# check never blocks the agent from re-reviewing. +@test "nested 'review / review' (FAILURE) is filtered out → passing" { + local r + r=$(rollup "$(check_run "review / review" "COMPLETED" "FAILURE")") + run compute_ci_status "$r" + [ "$output" = "passing" ] +} + +@test "nested 'review / review' FAILURE alongside an external pass → passing" { + local r + r=$(rollup "$(check_run "review / review" "COMPLETED" "FAILURE")" "$(check_run "SonarCloud" "COMPLETED" "SUCCESS")") + run compute_ci_status "$r" + [ "$output" = "passing" ] +} + +@test "a genuinely external failing check still → failing (regression guard)" { + local r + r=$(rollup "$(check_run "review / review" "COMPLETED" "FAILURE")" "$(check_run "SonarCloud" "COMPLETED" "FAILURE")") + run compute_ci_status "$r" + [ "$output" = "failing" ] +} + # --------------------------------------------------------------------------- # Dev-lead and generic workflow/job-suffix checks are NOT filtered # Dev-lead can commit back to the PR branch, so it must remain a real CI gate.