Skip to content

feat: implement issue #573 — pr-review: PRs skipped as ci-pending are never re-reviewed after CI goes green - #624

Merged
don-petry merged 3 commits into
mainfrom
dev-lead/issue-573-20260612-0205
Jun 13, 2026
Merged

feat: implement issue #573 — pr-review: PRs skipped as ci-pending are never re-reviewed after CI goes green#624
don-petry merged 3 commits into
mainfrom
dev-lead/issue-573-20260612-0205

Conversation

@don-petry

Copy link
Copy Markdown
Collaborator

Closes #573

Implemented by dev-lead agent. Please review.

@don-petry
don-petry requested a review from a team as a code owner June 12, 2026 02:15
@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.

@don-petry
don-petry enabled auto-merge (squash) June 12, 2026 02:15
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

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 54 minutes and 42 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ 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: 700ea728-bf69-472d-8802-88394ae45b60

📥 Commits

Reviewing files that changed from the base of the PR and between 426c440 and 674fcce.

📒 Files selected for processing (5)
  • .github/workflows/lint.yml
  • .github/workflows/pr-review-sweep.yml
  • AGENTS.md
  • scripts/sweep-stuck-reviews.sh
  • tests/test_sweep_stuck_reviews.bats
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev-lead/issue-573-20260612-0205

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.

@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 a new script scripts/sweep-stuck-reviews.sh and corresponding BATS tests to automatically re-trigger reviews for "stuck-green" pull requests that were previously skipped due to pending or failing CI. The feedback focuses on optimizing API usage by checking the dispatch limit earlier in the loop, adding a defensive check for empty head SHAs to prevent incorrect skips, and improving test helper flexibility to support empty head SHA test cases.

Comment thread scripts/sweep-stuck-reviews.sh
Comment thread scripts/sweep-stuck-reviews.sh
Comment thread scripts/sweep-stuck-reviews.sh Outdated
Comment thread tests/test_sweep_stuck_reviews.bats Outdated
@don-petry
don-petry disabled auto-merge June 12, 2026 02:19
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 12, 2026
@don-petry

Copy link
Copy Markdown
Collaborator Author

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

Changes committed and pushed.

@donpetry-bot

Copy link
Copy Markdown
Contributor

Review — fix requested (cycle 1/3)

The automated review identified the following issues. Please address each one:

Findings to fix

Automated review — NEEDS HUMAN REVIEW

Risk: MEDIUM
Reviewed commit: 1db3e87e21c0d96d61f38eda568569b37b1959af
Cascade: triage → deep (triage: haiku 4.5 → deep: opus 4.8 + duck: o4-mini → audit: fable 5)

Summary

PR #624 implements the #573 stuck-review sweep (new scripts/sweep-stuck-reviews.sh + scheduled workflow + 210-line bats suite). Code quality is high and BOTH gemini-flagged bugs are already fixed at head 1db3e87 — the empty-head_sha guard exists and the MAX_DISPATCH check now runs at loop top before any gh pr view (triage evaluated the older commit e57d74a). The blocking issue is a live merge conflict (mergeable=CONFLICTING, mergeStateStatus=DIRTY): the PR cannot be merged until rebased. Escalating on the gate failure, not for security audit.

Findings

  • MAJOR: PR is in CONFLICTING / DIRTY merge state and cannot be merged. Author must rebase onto main and resolve conflicts, after which CI and this review should re-run.
  • INFO: gemini bug test issue from agent #1 (empty head_sha could make the reviewed_at_head jq filter match any marker) is FIXED: an explicit if [ -z "$head_sha" ]; then ... continue guard is present before the marker check. (scripts/sweep-stuck-reviews.sh line 121)
  • INFO: gemini bug Go-live improvements for PR review agent #2 (MAX_DISPATCH checked after the expensive gh pr view) is FIXED: the dispatch-limit break now runs at the very top of the loop iteration before inspected is incremented or any PR is fetched. (scripts/sweep-stuck-reviews.sh line 99)
  • MINOR: The reviewed_at_head idempotency check matches the marker <!-- pr-review-agent v1 sha=<head> (sha followed by a literal space) to avoid prefix collisions. This is correct only if the cascade's real marker always emits a space/content after the head sha. If a future marker ever renders as sha=<head>--> with no trailing space, this sweep would false-negative and re-dispatch an already-reviewed PR. Worth a brief assertion or a shared constant with the cascade's marker writer. Non-blocking. (scripts/sweep-stuck-reviews.sh line 117)
  • INFO: New scheduled workflow pr-review-sweep.yml runs with a broad-scope PAT (DON_PETRY_BOT_GH_PAT) to dispatch reviews. Reviewed and found clean: minimal permissions: contents: read, action pinned to a SHA, workflow_dispatch inputs passed via env (no shell interpolation/injection), MAX_DISPATCH validated as a positive integer, concurrency with cancel-in-progress. Mirrors the existing documented redispatch.sh PAT pattern and is recorded as a repo-specific exception in AGENTS.md. No Tier-3 security audit warranted. (.github/workflows/pr-review-sweep.yml line 1)

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

Additional tasks

  1. Resolve all unresolved review thread comments from other reviewers
  2. Ensure all CI checks pass after your changes
  3. Rebase on the target branch if behind
  4. Do NOT modify files unrelated to the findings above

The review cascade will automatically re-review after new commits are pushed.

@don-petry

Copy link
Copy Markdown
Collaborator Author

@dev-lead - please fix findings

@don-petry
don-petry disabled auto-merge June 13, 2026 12:35
@don-petry

Copy link
Copy Markdown
Collaborator Author

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

Engine ran but made no changes.

@don-petry
don-petry enabled auto-merge (squash) June 13, 2026 12:38
@don-petry

Copy link
Copy Markdown
Collaborator Author

Auto-rebase failed — merge conflict — this branch has conflicts with main that must be resolved.

Claude will attempt to resolve this automatically. If it cannot, a follow-up comment will explain what needs manual attention.

To resolve manually instead:

git fetch origin
git merge origin/main
# resolve conflicts, then:
git add .
git commit
git push

@don-petry
don-petry disabled auto-merge June 13, 2026 12:46
@don-petry
don-petry force-pushed the dev-lead/issue-573-20260612-0205 branch from 1db3e87 to 4b641ec Compare June 13, 2026 12:48
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — rebase (no-changes)

Agent reasoning
PR: #624
Rebased onto: main
Conflicts resolved: 1 file
- .github/workflows/lint.yml: merged bats test list — kept test_oversized_pr.bats (from main) and test_initiative_planner_redispatch.bats + test_sweep_stuck_reviews.bats (from PR), deduplicating test_idea_triage.bats which appeared on both sides
Push: success
```

@don-petry
don-petry enabled auto-merge (squash) June 13, 2026 12:48
@don-petry
don-petry disabled auto-merge June 13, 2026 12:55
@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 13, 2026 12:56
@don-petry

Copy link
Copy Markdown
Collaborator Author

Auto-rebase failed — merge conflict — this branch has conflicts with main that must be resolved.

Claude will attempt to resolve this automatically. If it cannot, a follow-up comment will explain what needs manual attention.

To resolve manually instead:

git fetch origin
git merge origin/main
# resolve conflicts, then:
git add .
git commit
git push

@don-petry
don-petry disabled auto-merge June 13, 2026 13:00
@github-actions

Copy link
Copy Markdown
Contributor

Auto-rebase failed — merge conflict — this branch has conflicts with main that must be resolved manually.

Please resolve the conflicts and push:

git fetch origin
git merge origin/main
# resolve conflicts, then:
git add .
git commit
git push

@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 13, 2026 13:02
@don-petry

Copy link
Copy Markdown
Collaborator Author

@dev-lead - resolve the rebase main conflict

@don-petry
don-petry disabled auto-merge June 13, 2026 15:51
@don-petry
don-petry force-pushed the dev-lead/issue-573-20260612-0205 branch from a03859f to 674fcce Compare June 13, 2026 19:42
@don-petry
don-petry disabled auto-merge June 13, 2026 19:42
@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 13, 2026 19:42
@sonarqubecloud

Copy link
Copy Markdown

@don-petry
don-petry disabled auto-merge June 13, 2026 19:43
@don-petry

Copy link
Copy Markdown
Collaborator Author

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

Agent reasoning
Issues addressed: 0
Files changed: None
Summary: Quality Gate passed with 0 new issues, 0 security hotspots, and no code findings. The two cancelled CI checks (dev-lead/ci-relay, dev-lead/dispatch) are intentionally skipped via [skip ci-relay] commit tags — not actual blockers.
```
The PR is clean from the code analysis perspective. All successful checks (Agent Security Scan, CodeQL, Lint, ShellCheck, BATS, etc.) passed, and the SonarCloud dashboard confirms zero new issues on the PR. No code changes are required.

@don-petry
don-petry enabled auto-merge (squash) June 13, 2026 19:44
@don-petry
don-petry merged commit 6042fcd into main Jun 13, 2026
25 of 27 checks passed
@don-petry
don-petry deleted the dev-lead/issue-573-20260612-0205 branch June 13, 2026 19:48
don-petry added a commit that referenced this pull request Jun 13, 2026
…istory (#649)

push_with_merge_guard did a plain `git push`, so when an engine resolved a
rebase under a non-rebase intent (on-mention, review-changes) the rewritten
branch could never be published — the push was rejected non-fast-forward and
the run failed red, even though the rebase + conflict resolution succeeded
(e.g. PR #624 stuck dirty for a day).

Detect that case — a non-fast-forward rejection while HEAD has diverged from
its upstream (history rewritten) — and retry once with --force-with-lease. The
lease (our remote-tracking ref) makes the retry abort if the remote advanced
under us, so a concurrent push is never clobbered. Normal non-fast-forwards
(remote legitimately advanced, branch not diverged) still fail as before. This
mirrors the dedicated rebase intent's own force-push (prompts/dev-lead/rebase.md).

Closes #647

https://claude.ai/code/session_01BTcE5pAvrmNqkatFUTAetF

Co-authored-by: Claude <noreply@anthropic.com>
don-petry added a commit that referenced this pull request Jun 14, 2026
… never re-reviewed after CI goes green (#624)

* feat: implement issue #573 — pr-review: PRs skipped as ci-pending are never re-reviewed after CI goes green

* fix(bot): address bot feedback [skip ci-relay]

* fix(bot): address bot feedback [skip ci-relay]

---------

Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Jun 14, 2026
…istory (#649)

push_with_merge_guard did a plain `git push`, so when an engine resolved a
rebase under a non-rebase intent (on-mention, review-changes) the rewritten
branch could never be published — the push was rejected non-fast-forward and
the run failed red, even though the rebase + conflict resolution succeeded
(e.g. PR #624 stuck dirty for a day).

Detect that case — a non-fast-forward rejection while HEAD has diverged from
its upstream (history rewritten) — and retry once with --force-with-lease. The
lease (our remote-tracking ref) makes the retry abort if the remote advanced
under us, so a concurrent push is never clobbered. Normal non-fast-forwards
(remote legitimately advanced, branch not diverged) still fail as before. This
mirrors the dedicated rebase intent's own force-push (prompts/dev-lead/rebase.md).

Closes #647

https://claude.ai/code/session_01BTcE5pAvrmNqkatFUTAetF

Co-authored-by: Claude <noreply@anthropic.com>
don-petry added a commit that referenced this pull request Jun 18, 2026
…istory (#649)

push_with_merge_guard did a plain `git push`, so when an engine resolved a
rebase under a non-rebase intent (on-mention, review-changes) the rewritten
branch could never be published — the push was rejected non-fast-forward and
the run failed red, even though the rebase + conflict resolution succeeded
(e.g. PR #624 stuck dirty for a day).

Detect that case — a non-fast-forward rejection while HEAD has diverged from
its upstream (history rewritten) — and retry once with --force-with-lease. The
lease (our remote-tracking ref) makes the retry abort if the remote advanced
under us, so a concurrent push is never clobbered. Normal non-fast-forwards
(remote legitimately advanced, branch not diverged) still fail as before. This
mirrors the dedicated rebase intent's own force-push (prompts/dev-lead/rebase.md).

Closes #647

https://claude.ai/code/session_01BTcE5pAvrmNqkatFUTAetF

Co-authored-by: Claude <noreply@anthropic.com>
don-petry added a commit that referenced this pull request Jun 25, 2026
…istory (#649)

push_with_merge_guard did a plain `git push`, so when an engine resolved a
rebase under a non-rebase intent (on-mention, review-changes) the rewritten
branch could never be published — the push was rejected non-fast-forward and
the run failed red, even though the rebase + conflict resolution succeeded
(e.g. PR #624 stuck dirty for a day).

Detect that case — a non-fast-forward rejection while HEAD has diverged from
its upstream (history rewritten) — and retry once with --force-with-lease. The
lease (our remote-tracking ref) makes the retry abort if the remote advanced
under us, so a concurrent push is never clobbered. Normal non-fast-forwards
(remote legitimately advanced, branch not diverged) still fail as before. This
mirrors the dedicated rebase intent's own force-push (prompts/dev-lead/rebase.md).

Closes #647

https://claude.ai/code/session_01BTcE5pAvrmNqkatFUTAetF

Co-authored-by: Claude <noreply@anthropic.com>
don-petry added a commit that referenced this pull request Jun 25, 2026
…istory (#649)

push_with_merge_guard did a plain `git push`, so when an engine resolved a
rebase under a non-rebase intent (on-mention, review-changes) the rewritten
branch could never be published — the push was rejected non-fast-forward and
the run failed red, even though the rebase + conflict resolution succeeded
(e.g. PR #624 stuck dirty for a day).

Detect that case — a non-fast-forward rejection while HEAD has diverged from
its upstream (history rewritten) — and retry once with --force-with-lease. The
lease (our remote-tracking ref) makes the retry abort if the remote advanced
under us, so a concurrent push is never clobbered. Normal non-fast-forwards
(remote legitimately advanced, branch not diverged) still fail as before. This
mirrors the dedicated rebase intent's own force-push (prompts/dev-lead/rebase.md).

Closes #647

https://claude.ai/code/session_01BTcE5pAvrmNqkatFUTAetF

Co-authored-by: Claude <noreply@anthropic.com>
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.

pr-review: PRs skipped as ci-pending are never re-reviewed after CI goes green

2 participants