Skip to content

feat: implement issue #405 — petry-projects — workflow failures detected 2026-05-28 - #528

Merged
don-petry merged 37 commits into
mainfrom
dev-lead/issue-405-20260609-2123
Jun 13, 2026
Merged

don-petry merged 37 commits into
mainfrom
dev-lead/issue-405-20260609-2123

Conversation

@don-petry

@don-petry don-petry commented Jun 9, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #405

Implemented by dev-lead agent. Please review.

Summary by CodeRabbit

  • Bug Fixes

    • Fixed crashes when processing closed or merged pull requests by adding early state detection.
    • Improved branch checkout logic to skip non-open PRs and prevent deleted reference errors.
  • Tests

    • Added regression tests for closed PR handling and merged PR state scenarios.
  • Chores

    • Updated workflow documentation.

Copilot AI review requested due to automatic review settings June 9, 2026 21:44
@don-petry
don-petry requested a review from a team as a code owner June 9, 2026 21:44
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Jun 9, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@don-petry, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 49 minutes and 32 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: d4dc58db-3fd9-4310-b197-91f2e5a14f59

📥 Commits

Reviewing files that changed from the base of the PR and between 059dd2e and 151016e.

📒 Files selected for processing (2)
  • scripts/dev-lead-intent.sh
  • scripts/lib/pr-worktree.sh
📝 Walkthrough

Walkthrough

This PR adds guards against processing already-closed or merged PRs in two key paths: intent classification emits skip immediately upon detecting a closed PR, and worktree checkout exits early before attempting to fetch or checkout a deleted branch. New test fixtures and regression tests validate both scenarios.

Changes

Closed PR Safe-Exit Guards

Layer / File(s) Summary
Closed PR intent detection and test
scripts/dev-lead-intent.sh, tests/dev-lead/fixtures/events/issue_comment_sonarqube_closed_pr.json, tests/dev-lead/unit/test_intent_reviews.bats
Issue comment event handler checks PR state and emits INTENT_TYPE=skip with INTENT_REASON=pr-already-closed before routing. New fixture and test validate the skip path for closed-PR comments.
Closed PR worktree checkout guard and regression tests
scripts/lib/pr-worktree.sh, tests/dev-lead/unit/test_pr_worktree.bats
checkout_pr_in_worktree fetches PR metadata early, exits 0 when PR is not OPEN, and reuses the pre-fetched branch name to avoid redundant API calls. Test harness is parameterized by PR_STATE_API; new regression tests verify safe exit for MERGED and CLOSED states without branch switching.
Workflow reusable-only header clarification
.github/workflows/pr-review.yml
Comment block updated to clarify event-driven triggering and stable agent ref pinning; no executable logic or inputs/jobs/steps modified.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • petry-projects/.github-private#453: Both PRs modify scripts/lib/pr-worktree.sh's checkout_pr_in_worktree logic to handle mid-run PR state transitions (merged/closed) and EXIT-trap behavior, so the changes overlap at the same function/code paths.

Suggested labels

needs-human-review

🚥 Pre-merge checks | ✅ 1 | ❌ 4

❌ Failed checks (4 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title claims to implement issue #405 (workflow failures report), but the actual changes modify intent routing and PR worktree logic—unrelated to workflow health reporting. Retitle to accurately reflect the changes: e.g., 'feat: skip closed PR handling in intent routing and worktree checkout' or clarify the link to issue #405 in the description.
Linked Issues check ⚠️ Warning Issue #405 requires a workflow health report with org-wide metrics, per-repo summaries, fleet-detail tables, and failed-run lists. Changes implement closed-PR guards in intent routing and worktree logic—code not present in any modified file. Verify the correct issue is linked or ensure the code changes correspond to the stated requirements (e.g., a reporting script should exist in the changeset).
Out of Scope Changes check ⚠️ Warning Modifications to dev-lead-intent.sh and pr-worktree.sh (closed-PR safety guards) are out of scope relative to issue #405's workflow health reporting requirement. Either link the correct issue for these safety-guard changes or split this PR to address both the health report and defensive improvements separately.
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev-lead/issue-405-20260609-2123

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (no-changes)

No changes were needed for this PR.

@don-petry
don-petry enabled auto-merge (squash) June 9, 2026 21:45
@don-petry
don-petry disabled auto-merge June 9, 2026 21:45

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces early-exit guards to gracefully handle closed or merged pull requests, preventing checkout failures when a branch has been deleted. It adds checks in both the intent classifier and the worktree checkout scripts, along with corresponding unit tests and fixtures. The review feedback suggests a valuable optimization to combine multiple gh pr view calls in pr-worktree.sh into a single API request to save network round-trips and avoid rate-limiting, which also requires updating the test stubs accordingly.

Comment thread scripts/lib/pr-worktree.sh
Comment thread scripts/lib/pr-worktree.sh Outdated
Comment thread tests/dev-lead/unit/test_pr_worktree.bats

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements a guard for issue #405 to prevent dev-lead runs from crashing when a trusted-bot comment arrives on an already closed/merged PR (where gh pr checkout would fail due to a deleted branch), and adds regression tests/fixtures for that behavior.

Changes:

  • Add an early-exit in checkout_pr_in_worktree when PR state is not OPEN.
  • Add intent-classifier fast-path to skip issue_comment events on closed PRs (pr-already-closed).
  • Add unit tests and an event fixture covering the closed/merged PR skip paths.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
scripts/lib/pr-worktree.sh Adds early PR-state detection and clean exit before attempting checkout on merged/closed PRs.
scripts/dev-lead-intent.sh Skips processing issue_comment events targeting already-closed PRs to avoid wasted runs/crashes.
tests/dev-lead/unit/test_pr_worktree.bats Extends gh stub to support PR state queries; adds regression tests for merged/closed PR early exit.
tests/dev-lead/unit/test_intent_reviews.bats Adds regression test ensuring classifier emits skip/pr-already-closed for closed PR bot comments.
tests/dev-lead/fixtures/events/issue_comment_sonarqube_closed_pr.json New fixture representing a SonarQube bot comment on a merged/closed PR.

Comment thread tests/dev-lead/unit/test_pr_worktree.bats Outdated
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-bot-comment (applied)

Changes committed and pushed.

@don-petry
don-petry enabled auto-merge (squash) June 9, 2026 21:49
@don-petry
don-petry disabled auto-merge June 9, 2026 21:49
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@don-petry
don-petry enabled auto-merge (squash) June 9, 2026 21:55
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 9, 2026
@don-petry
don-petry disabled auto-merge June 9, 2026 21:55
@don-petry

Copy link
Copy Markdown
Collaborator Author

Note

@don-petry I reviewed this PR and no code changes were needed, but it still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews), so I cannot mark it done yet. I'll re-check automatically.
Next attempt after: 2026-06-09T22:29:25Z

@don-petry
don-petry enabled auto-merge (squash) June 9, 2026 21:59
@don-petry
don-petry disabled auto-merge June 9, 2026 23:44
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — waiting on PR blockers (intent: review-changes)

PR: #528
No changes were committed, but the PR still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews). The retry cron will re-attempt automatically. Next attempt after: 2026-06-10T00:19:04Z

@don-petry
don-petry enabled auto-merge (squash) June 9, 2026 23:49
@don-petry
don-petry disabled auto-merge June 9, 2026 23:55
@don-petry
don-petry enabled auto-merge (squash) June 9, 2026 23:58
@don-petry
don-petry disabled auto-merge June 10, 2026 00:01
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-bot-comment (no-changes)

Agent reasoning
Issues addressed: 0
Skipped (informational): 1 — Quality Gate passed; 0 new issues, 0 security hotspots, 0 duplication. No actionable findings from SonarQube.
Open SonarQube review threads: none (GraphQL query returned `[]`). Nothing to reply to or resolve.
---
**Tier 1 blocker: `review / review` (conclusion: `failure`)**
This failure is **not a code issue** — it's an infrastructure/secrets problem:
- The workflow runs from `refs/tags/pr-review/stable` (SHA `bfe4ee5`), which is the latest commit including the classic-PAT fix.
- The code correctly detects the token type at runtime and emits a clear error: *"Fine-grained PAT detected — fine-grained PATs are not supported by this workflow."*
- The root cause is that the org secret `DON_PETRY_BOT_GH_PAT` is still configured as a **fine-grained PAT**. The code fix is already in place; what's missing is rotating the secret to a **classic PAT with `repo`, `workflow`, and `read:org` scopes**.
This requires org-admin action (update the secret in org settings → Actions secrets → `DON_PETRY_BOT_GH_PAT`). No code change on this branch can unblock it — the detection and error messaging are already correct in `bfe4ee5`. Once the secret is rotated, re-running the workflow should pass.
**Files changed:** none  
**Skipped (informational):** 1 (SonarQube quality gate pass)

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — waiting on PR blockers (intent: review-changes)

PR: #528
No changes were committed, but the PR still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews). The retry cron will re-attempt automatically. Next attempt after: 2026-06-12T00:42:17Z

@don-petry

Copy link
Copy Markdown
Collaborator Author

Note

@don-petry I reviewed this PR and no code changes were needed, but it still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews), so I cannot mark it done yet. I'll re-check automatically.
Next attempt after: 2026-06-12T00:42:17Z

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — waiting on PR blockers (intent: review-changes)

PR: #528
No changes were committed, but the PR still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews). The retry cron will re-attempt automatically. Next attempt after: 2026-06-12T01:16:36Z

@don-petry

Copy link
Copy Markdown
Collaborator Author

Note

@don-petry I reviewed this PR and no code changes were needed, but it still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews), so I cannot mark it done yet. I'll re-check automatically.
Next attempt after: 2026-06-12T01:16:36Z

donpetry-bot
donpetry-bot previously approved these changes Jun 12, 2026

@donpetry-bot donpetry-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review — APPROVED ✓

Risk: MEDIUM
Reviewed commit: 1c4b0a7a351f52b8629f550346162088fdc6d69d
Cascade: triage → deep (triage: haiku 4.5 → deep: sonnet 4.6 + duck: o4-mini → audit: opus 4.7)

Summary

Defensive bug fix for issue #405 that prevents crashes on merged/closed PR checkout. All CI gates pass (shellcheck, bats, unit-tests, SonarCloud, CodeQL, gitleaks all green). The coderabbitai CHANGES_REQUESTED is stale — both items it flagged ([ ] vs [[ ]] in dev-lead-intent.sh and pr-worktree.sh) are already addressed in the current HEAD, and donpetry-bot has approved the final state.

Findings

  • INFO: Early-exit guard in dev-lead-intent.sh checks issue.state == 'closed' (lowercase) which matches the GitHub webhook payload format; the downstream check in pr-worktree.sh uses OPEN/MERGED/CLOSED (uppercase) matching the gh CLI JSON output — both are correct for their respective data sources. (scripts/dev-lead-intent.sh:309)
  • INFO: exit 0 inside checkout_pr_in_worktree (a sourced library function) exits the calling shell rather than returning. This is intentional and documented: the comment explains it must fire before the EXIT trap is registered to avoid triggering the caller's trap prematurely. Consistent with existing patterns in this library. (scripts/lib/pr-worktree.sh:64)
  • MINOR: coderabbitai[bot] has an unresolved CHANGES_REQUESTED review (submitted 2026-06-10T18:55:18Z against commit 059dd2e) causing mergeStateStatus=BLOCKED. Both actionable items it requested (replace [ ] with [[ ]] in dev-lead-intent.sh and pr-worktree.sh) are fully implemented in the current HEAD. The review was never re-evaluated or dismissed after the fixes were pushed. Human action required to dismiss the stale bot review to unblock merge.
  • INFO: Two new bats tests cover MERGED and CLOSED state early-exit paths in checkout_pr_in_worktree; one new intent-classifier test covers the issue_comment-on-closed-PR scenario. Regression fixture includes _test_expected_intent sentinel for automated fixture validation. (tests/dev-lead/unit/test_pr_worktree.bats:229)
  • INFO: Gemini advisory feedback implemented: gh pr view now fetches state and headRefName in a single API call (--json state,headRefName), eliminating a redundant round-trip. Test stub updated to return the combined JSON object matching the new call signature. (scripts/lib/pr-worktree.sh:62)

Reviewed by the PR-review cascade (triage: haiku 4.5 → deep: sonnet 4.6 + duck: o4-mini → audit: opus 4.7). Reply if you need a human review.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — waiting on PR blockers (intent: review-changes)

PR: #528
No changes were committed, but the PR still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews). The retry cron will re-attempt automatically. Next attempt after: 2026-06-12T02:24:24Z

@don-petry

Copy link
Copy Markdown
Collaborator Author

Note

@don-petry I reviewed this PR and no code changes were needed, but it still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews), so I cannot mark it done yet. I'll re-check automatically.
Next attempt after: 2026-06-12T02:24:24Z

donpetry-bot
donpetry-bot previously approved these changes Jun 12, 2026

@donpetry-bot donpetry-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review — APPROVED ✓

Risk: MEDIUM
Reviewed commit: 7be6ddbdd44f6304da6bef61d8fa7e14c60e18e4
Review mode: triage-approved (single reviewer)

Summary

Confirms triage assessment: a focused, well-tested bug fix for issue #405. Adds an early skip in dev-lead-intent.sh for trusted-bot comments on closed/merged PRs and a merged/closed-PR guard in checkout_pr_in_worktree (combined into a single gh pr view call), preventing the 'couldn't find remote ref' crash when a PR branch was deleted after merge. Includes regression fixtures and bats tests for both layers. The pr-review.yml change is comment re-indentation only.

Linked issue analysis

Issue #405 (fleet monitor: dev-lead workflow failures from 2026-05-28) is substantively addressed. The root cause — dev-lead reacting to bot comments on already-merged PRs and crashing at checkout because the branch was deleted — is fixed at two layers: a fast-path skip in the intent classifier (emit_skip pr-already-closed) and a defensive early-exit in checkout_pr_in_worktree before the EXIT trap is registered. Regression tests cover MERGED and CLOSED states plus the classifier skip path.

Findings

No blocking findings. Verified directly against the head diff: (1) both gemini-code-assist suggestions (single combined gh pr view call; combined-JSON test stub) are implemented even though the threads were not marked resolved in the UI; (2) both CodeRabbit nitpicks ([ ] to [[ ]]) are implemented and their threads resolved — the standing CHANGES_REQUESTED review predates these fixes and is stale; (3) shell changes are quote-safe, fail-open on gh API errors, and shellcheck passes; (4) the test stub exports PR_STATE_API unconditionally in setup(), preventing runner-env leakage. Note: CodeRabbit's stale CHANGES_REQUESTED keeps reviewDecision blocked until dismissed or re-reviewed — that is a GitHub mechanic, not an unaddressed concern.

CI status

All substantive checks green: shellcheck, bats/unit-tests, validate-fixtures, gh-aw-compile, CodeQL, SonarCloud, gitleaks, Agent Security Scan, workflow-structure checks. The two CANCELLED dev-lead jobs (dispatch, ci-relay) are concurrency-cancellation artifacts (per issue #608) and non-blocking. The in-progress 'review / review' check is this review run itself.


Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-bot-comment (no-changes)

Agent reasoning
Issues addressed: 2 (already implemented before this session)
- Replace POSIX [ ] with [[ ]] in dev-lead-intent.sh: ✅ implemented (line 310)
- Replace POSIX [ ] with [[ ]] in pr-worktree.sh: ✅ implemented (lines 64, 68)
Files changed: None (fixes pre-existing)
Skipped: 0
```

donpetry-bot
donpetry-bot previously approved these changes Jun 12, 2026

@donpetry-bot donpetry-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review — APPROVED ✓

Risk: MEDIUM
Reviewed commit: 7be6ddbdd44f6304da6bef61d8fa7e14c60e18e4
Review mode: triage-approved (single reviewer)

Summary

Adds two-layer protection against dev-lead crashing on trusted-bot comments to closed/merged PRs (issue #405): a fast-path skip in the intent classifier when the event's issue state is closed, and an early-exit guard in checkout_pr_in_worktree that detects non-OPEN PR state before attempting checkout of a possibly-deleted branch. Includes regression bats tests and a new event fixture. The pr-review.yml change is comment re-indentation only. Since the prior approval at 1c4b0a7, the only new commits are merges of main (#609, #618) — no PR-content changes.

Linked issue analysis

Issue #405 is a fleet-monitor failure report covering dev-lead workflow failures; the root cause addressed here is the crash ("fatal: couldn't find remote ref") when a SonarQube/trusted-bot comment lands on an already-merged PR whose branch was deleted. The PR substantively fixes that failure mode at both the classifier level (skip with reason pr-already-closed, avoiding a wasted agent run) and the worktree library level (graceful exit 0 with a ::notice), each covered by dedicated regression tests.

Findings

  • No new issues found. Shell changes are well-quoted, use jq for JSON extraction, and combine the previous two gh pr view round-trips into one (--json state,headRefName), as suggested by gemini-code-assist.
  • The two formally-unresolved gemini-code-assist threads (combine gh pr view calls; update the test gh stub to return combined JSON) are both implemented in the current diff and answered in-thread — they are stale-unresolved markers, not outstanding feedback.
  • CodeRabbit's CHANGES_REQUESTED review (2026-06-10) had two trivial nitpick threads ([ ] vs [[ ]]); both threads are resolved and the style point was addressed. The review state itself was never dismissed, which keeps reviewDecision at CHANGES_REQUESTED — a mechanical leftover, not substantive outstanding feedback.
  • The intentional exit 0 (rather than return) inside checkout_pr_in_worktree terminates the calling script by design (nothing to do on a closed PR); trap-ordering implications are documented in a comment and exercised by tests.

CI status

All required checks green: shellcheck, bats, unit tests, CodeQL, SonarCloud, gitleaks, agent-shield, fixture/profile validation all SUCCESS; dependency-audit matrix legs SKIPPED (no matching ecosystems). The two CANCELLED checks (dev-lead/dispatch, dev-lead/ci-relay) are the coding agent's own concurrency-cancelled dispatch jobs — the known false-blocker addressed by #608 — and 'review / review' IN_PROGRESS is this review run itself.


Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.

@sonarqubecloud

Copy link
Copy Markdown

@don-petry

Copy link
Copy Markdown
Collaborator Author

Note

@don-petry I reviewed this PR and no code changes were needed, but it still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews), so I cannot mark it done yet. I'll re-check automatically.
Next attempt after: 2026-06-12T02:51:56Z

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — waiting on PR blockers (intent: review-changes)

PR: #528
No changes were committed, but the PR still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews). The retry cron will re-attempt automatically. Next attempt after: 2026-06-13T12:38:59Z

@don-petry

Copy link
Copy Markdown
Collaborator Author

@dev-lead - Please fix the findings and blockers here

@donpetry-bot donpetry-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review — APPROVED ✓

Risk: LOW
Reviewed commit: 5bcfcb49379aaabe0ec943b170b0f8c70ba778aa
Review mode: triage-approved (single reviewer)

Summary

Two-layer guard so trusted-bot comments (e.g. SonarQube) on already-merged/closed PRs no longer crash the dev-lead agent at checkout (issue #405). Adds an early skip in the intent classifier and a defensive early-exit in checkout_pr_in_worktree, with regression tests at both layers. Triage cleared this as low-risk; confirmation review agrees.

Linked issue analysis

Closes #405 (dev-lead crash: trusted-bot comment on a merged PR whose branch was deleted → gh pr checkout fails with 'fatal: couldn't find remote ref'). Substantively addressed in two independent layers: (1) scripts/dev-lead-intent.sh emits skip pr-already-closed when .issue.state == "closed" (lowercase, correct for webhook payloads) before spending tokens; (2) scripts/lib/pr-worktree.sh exits 0 when gh pr view --json state returns anything other than OPEN (uppercase, correct for the gh API). Casing is handled correctly on both sides. Each layer has a dedicated regression test plus a new fixture.

Findings

No blocking findings.

  • scripts/lib/pr-worktree.sh: the new gh pr view --json state,headRefName call folds the previously-separate headRefName lookup into one round-trip; _pr_branch is reused downstream so behavior of the stale-worktree release (#470) is preserved.
  • The early exit 0 is correctly placed before the EXIT trap registration; the inline comment documents why (avoids the trap replaying the caller's handler — observed previously as bats 'Executed 2 instead of 1 tests').
  • .github/workflows/pr-review.yml change is cosmetic only (de-indenting a comment block to column 0); no permissions, secrets, or behavior change.
  • Tests export PR_STATE_API unconditionally in setup() to prevent runner-env leakage into unrelated tests — good defensive hygiene.
  • All 6 review threads (gemini, copilot, coderabbit) are resolved; no unresolved or unanswered human-reviewer questions.

CI status

All substantive checks green: shellcheck/ShellCheck, bats, unit/unit-tests, validate-fixtures, CodeQL, SonarCloud, gitleaks, agent-shield, validate-agent-profiles, caller/toplevel-permissions, gh-aw-compile, etc. The CANCELLED entries (dev-lead / dispatch, dev-lead / ci-relay) are concurrency-cancelled duplicates — each shares a name with a SUCCESS/SKIPPED companion run — a known false-positive pattern (cf. #608). The only non-terminal check is review / review IN_PROGRESS, which is this review itself. mergeStateStatus=BLOCKED pending this review.


Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — on-mention (no-changes)

Engine ran but made no changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

petry-projects — workflow failures detected 2026-05-28

3 participants