Repository navigation
feat: implement issue #469 — pr-review: mention-triggered runs silently lost to ci-pending skip (self-referential check runs) #471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
0dce084
feat: implement issue #469 — pr-review: mention-triggered runs silent…
donpetry-bot 9761135
Merge branch 'main' into dev-lead/issue-469-20260607-2359
don-petry 76b22b0
Merge branch 'main' into dev-lead/issue-469-20260607-2359
don-petry b87f198
chore: apply manual instructions [skip ci-relay]
donpetry-bot 3f7e954
chore: apply manual instructions [skip ci-relay]
donpetry-bot 6932d10
fix(reviews): address review comments [skip ci-relay]
donpetry-bot c17345a
fix(reviews): address review comments [skip ci-relay]
donpetry-bot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| #!/usr/bin/env bash | ||
| # ci-status.sh — compute CI gate status from a statusCheckRollup JSON array, | ||
| # filtering out the PR Review Agent's own check runs so the cascade never | ||
| # blocks on itself (issue #469). | ||
| # | ||
| # Usage: source this file, then call compute_ci_status with the rollup array. | ||
|
|
||
| # compute_ci_status <rollup_json> | ||
| # | ||
| # Inputs: | ||
| # $1 — JSON array (the .statusCheckRollup field from `gh pr view`) | ||
| # | ||
| # Outputs (stdout): one of "passing", "pending", "failing" | ||
| # | ||
| # Classification rules (after filtering own checks): | ||
| # passing — empty rollup, or every item is SUCCESS/SKIPPED/NEUTRAL/SUCCESS state | ||
| # pending — any item is IN_PROGRESS/QUEUED/WAITING/PENDING/EXPECTED or | ||
| # COMPLETED with null/empty conclusion | ||
| # failing — anything else (FAILURE, ACTION_REQUIRED, TIMED_OUT, etc.) | ||
| # | ||
| # Own-check filter — excludes entries whose name matches any of: | ||
| # • exact job-name forms: review, dispatch, ci-relay, pr-review-mention, mention-ack | ||
| # • workflow/job forms: "* / review", "* / dispatch", "* / ci-relay", etc. | ||
| # • known workflow prefixes: "PR Review Agent / *", "PR Review Reusable / *", | ||
| # "PR Review — Mention Trigger / *" | ||
| # The filter uses both .name (CheckRun) and .context (StatusContext) so it | ||
| # covers both GitHub Actions checks and legacy commit statuses. | ||
| compute_ci_status() { | ||
| local rollup_json="${1:-[]}" | ||
| echo "$rollup_json" | jq -r ' | ||
| def is_pending: | ||
| .status == "IN_PROGRESS" or .status == "QUEUED" or .status == "WAITING" or | ||
| .state == "PENDING" or .state == "EXPECTED" or | ||
| (.status == "COMPLETED" and (.conclusion == null or .conclusion == "")); | ||
| def is_success: | ||
| .conclusion == "SUCCESS" or .conclusion == "SKIPPED" or .conclusion == "NEUTRAL" or | ||
| .state == "SUCCESS"; | ||
| def is_own_check: | ||
| (.name // .context // "") as $n | | ||
| ($n | test("^(review|dispatch|ci-relay|pr-review-mention|mention-ack)$")) or | ||
| ($n | test("/ (review|dispatch|ci-relay|pr-review-mention|mention-ack)$")) or | ||
| ($n | test("^PR Review (Agent|Reusable) /")) or | ||
| ($n | test("^PR Review — Mention Trigger /")) or | ||
| ($n | test("^dev-lead / (dispatch|ci-relay)$")); | ||
|
don-petry marked this conversation as resolved.
Outdated
|
||
| if (. == null or (type != "array")) then "passing" | ||
|
don-petry marked this conversation as resolved.
|
||
| else | ||
| (map(select(is_own_check | not))) as $ext | | ||
| if ($ext | length) == 0 then "passing" | ||
| elif ([$ext[] | select(is_pending)] | length) > 0 then "pending" | ||
| elif ([$ext[] | select(is_success)] | length) == ($ext | length) then "passing" | ||
| else "failing" | ||
| end | ||
| end | ||
| ' 2>/dev/null || echo "passing" | ||
|
don-petry marked this conversation as resolved.
Outdated
|
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.