Skip to content

feat: implement issue #806 — dev-lead fix-review addresses advisory findings in code but never resolves the review thread → PRs stall on the advisory gate - #840

Merged
don-petry merged 9 commits into
mainfrom
dev-lead/issue-806-20260721-1159
Jul 21, 2026
Merged

feat: implement issue #806 — dev-lead fix-review addresses advisory findings in code but never resolves the review thread → PRs stall on the advisory gate#840
don-petry merged 9 commits into
mainfrom
dev-lead/issue-806-20260721-1159

Conversation

@don-petry

@don-petry don-petry commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Closes #806

Implemented by dev-lead agent. Please review.

Summary by CodeRabbit

  • New Features

    • Review readiness now distinguishes blocking review threads from outdated unresolved threads.
    • Unresolved threads block processing unless they are explicitly marked outdated.
    • Missing or unknown outdated status is handled conservatively as blocking.
  • Documentation

    • Updated guidance to explain blocking-thread behavior and edge cases.
  • Tests

    • Added coverage for resolved, outdated, missing, and malformed review-thread data.

…indings in code but never resolves the review thread → PRs stall on the advisory gate
@don-petry
don-petry requested a review from a team as a code owner July 21, 2026 12:09
Copilot AI review requested due to automatic review settings July 21, 2026 12:09
@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 Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 33 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

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.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9470af5e-749c-446d-af91-eab154075bc3

📥 Commits

Reviewing files that changed from the base of the PR and between 1d6bcc1 and cf0a4a0.

⛔ Files ignored due to path filters (2)
  • node_modules/.package-lock.json is excluded by !**/node_modules/**
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (1)
  • .github/scripts/pr-auto-review/lib/ready-check.sh
📝 Walkthrough

Walkthrough

The PR changes PR auto-review readiness gating from unresolved-thread counts to blocking-thread counts. Threads block dispatch when unresolved and not explicitly outdated; missing or null isOutdated remains blocking. The workflow, helper documentation, and Bats coverage are updated.

Changes

Blocking review-thread gate

Layer / File(s) Summary
Blocking-thread counting contract and helper
.github/scripts/pr-auto-review/lib/ready-check.sh, .github/scripts/pr-auto-review/README.md
Adds pr_auto_review_blocking_thread_count, updates readiness inputs, and documents unresolved, non-outdated thread semantics with fail-safe handling.
Workflow readiness wiring
.github/workflows/pr-auto-review-reusable.yml
Queries isResolved and isOutdated, computes the blocking count, and passes it to pr_auto_review_ready.
Blocking-thread behavior coverage
test/workflows/pr-auto-review/blocking-threads.bats
Tests blocking, resolved, outdated, mixed, missing-field, malformed, and null GraphQL responses.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant PRWorkflow
  participant GitHubGraphQL
  participant BlockingThreadHelper
  participant ReadinessCheck
  PRWorkflow->>GitHubGraphQL: Query review threads with isResolved and isOutdated
  GitHubGraphQL-->>PRWorkflow: Return review thread nodes
  PRWorkflow->>BlockingThreadHelper: Count unresolved, non-outdated threads
  BlockingThreadHelper-->>PRWorkflow: Return BLOCKING_THREAD_COUNT
  PRWorkflow->>ReadinessCheck: Evaluate readiness with blocking count
Loading

Possibly related PRs

Suggested labels: readme-refresh

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is specific and matches the PR’s main change: fixing review gating around unresolved-but-outdated threads.
Linked Issues check ✅ Passed The PR implements the issue’s defense-in-depth path by making outdated unresolved threads non-blocking and adding coverage.
Out of Scope Changes check ✅ Passed The changes stay focused on PR review-thread gating logic, documentation, workflow wiring, and tests.
Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev-lead/issue-806-20260721-1159

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.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces the pr_auto_review_blocking_thread_count function to count blocking review threads (unresolved and not outdated) to address issue #806, along with documentation and comprehensive tests. Feedback suggests using the optional/try operator ? in the jq filter to prevent potential 'Cannot index null' errors when parsing nested JSON structures.

Comment thread .github/scripts/pr-auto-review/lib/ready-check.sh
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@don-petry
don-petry enabled auto-merge (squash) July 21, 2026 12:11
@don-petry
don-petry disabled auto-merge July 21, 2026 12:12

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

Updates the org-level PR auto-review readiness gate to treat unresolved-but-outdated review threads as non-blocking, preventing PRs from stalling when advisory findings are fixed in follow-up commits but the original review threads are never explicitly resolved (issue #806).

Changes:

  • Add a pure helper (pr_auto_review_blocking_thread_count) that counts only blocking review threads (unresolved AND not outdated), with bats coverage.
  • Update the reusable workflow to fetch isOutdated via GraphQL and use the pure helper for the unresolved-thread gate.
  • Document the new “blocking thread” semantics in the pr-auto-review script README and workflow header.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
test/workflows/pr-auto-review/blocking-threads.bats Adds unit tests covering blocking vs non-blocking (outdated) review thread counting behavior.
.github/workflows/pr-auto-review-reusable.yml Switches from “unresolved threads” to “blocking threads” by querying isOutdated and delegating counting to the pure helper.
.github/scripts/pr-auto-review/README.md Documents the new unresolved-thread semantics and the new helper function contract.
.github/scripts/pr-auto-review/lib/ready-check.sh Introduces pr_auto_review_blocking_thread_count (jq-based) for consistent, unit-testable blocking-thread counting.

Comment thread .github/scripts/pr-auto-review/lib/ready-check.sh
Comment thread .github/scripts/pr-auto-review/README.md
Comment thread .github/workflows/pr-auto-review-reusable.yml
Comment thread test/workflows/pr-auto-review/blocking-threads.bats Outdated
Comment thread test/workflows/pr-auto-review/blocking-threads.bats Outdated
Comment thread .github/workflows/pr-auto-review-reusable.yml Outdated
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@don-petry
don-petry enabled auto-merge (squash) July 21, 2026 12:18
@don-petry
don-petry disabled auto-merge July 21, 2026 12:18
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@don-petry
don-petry enabled auto-merge (squash) July 21, 2026 12:26
@don-petry
don-petry disabled auto-merge July 21, 2026 12:27
@don-petry
don-petry enabled auto-merge (squash) July 21, 2026 12:31
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 21, 2026
@don-petry
don-petry disabled auto-merge July 21, 2026 12:32
@don-petry

Copy link
Copy Markdown
Contributor Author

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

Agent reasoning
No code issues were found by the bot analysis. All CI checks are passing or in expected states (pending workflow re-runs, skipping). No Tier 1 blockers exist:
- No failed checks
- No `CHANGES_REQUESTED` reviews
Review comments are informational only (Copilot overview, Gemini suggestion, CodeRabbit approval).
**Files changed:** No changes needed
- `.github/scripts/pr-auto-review/README.md`
- `.github/scripts/pr-auto-review/lib/ready-check.sh`
- `.github/workflows/pr-auto-review-reusable.yml`
- `test/workflows/pr-auto-review/blocking-threads.bats`
The PR is ready and requires no fixes.

@don-petry
don-petry enabled auto-merge (squash) July 21, 2026 12:33
@don-petry
don-petry disabled auto-merge July 21, 2026 12:34
@don-petry

Copy link
Copy Markdown
Contributor Author

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

PR: #840
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-07-21T13:06:58Z

@don-petry

Copy link
Copy Markdown
Contributor 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-07-21T13:06:58Z

@don-petry
don-petry enabled auto-merge (squash) July 21, 2026 12:37
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — fix-reviews (applied)

Changes committed and pushed.

@donpetry-bot

Copy link
Copy Markdown
Contributor

CI checks on this PR are still running. Once they complete, re-mention @donpetry-bot to trigger a fresh review.

Posted by the donpetry-bot PR-review cascade.

@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@don-petry
don-petry enabled auto-merge (squash) July 21, 2026 17:27
@don-petry
don-petry disabled auto-merge July 21, 2026 17:27
@sonarqubecloud

Copy link
Copy Markdown

@don-petry

Copy link
Copy Markdown
Contributor 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-07-21T18:00:33Z

@don-petry
don-petry enabled auto-merge (squash) July 21, 2026 17:30
@donpetry-bot

Copy link
Copy Markdown
Contributor

CI checks on this PR are still running. Once they complete, re-mention @donpetry-bot to trigger a fresh review.

Posted by the donpetry-bot PR-review cascade.

@don-petry

Copy link
Copy Markdown
Contributor Author

@donpetry-bot review — all required checks are green (SonarCloud, CodeQL, agent-shield/AgentShield, Detect ecosystems, Lint, ShellCheck, Agent Security Scan). The only non-passing context is CodeRabbit, a non-required check stuck on a per-developer rate limit; its last completed review at this head was clean. Please review and merge (fix-loop repair for #806).

@donpetry-bot

Copy link
Copy Markdown
Contributor

@don-petry I'm on it — starting a fresh review now. Results will appear in a few minutes.

@don-petry
don-petry disabled auto-merge July 21, 2026 17:45
@don-petry

Copy link
Copy Markdown
Contributor Author

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

PR: #840
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-07-21T18:19:41Z

@don-petry
don-petry enabled auto-merge (squash) July 21, 2026 17:49
@don-petry

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@don-petry
don-petry disabled auto-merge July 21, 2026 19:11
@don-petry

Copy link
Copy Markdown
Contributor Author

@donpetry-bot review — CodeRabbit is now green and all required checks pass; please review and merge.

@donpetry-bot

Copy link
Copy Markdown
Contributor

@don-petry I'm on it — starting a fresh review now. Results will appear in a few minutes.

@don-petry

Copy link
Copy Markdown
Contributor Author

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

Agent reasoning
- `.github/scripts/pr-auto-review/README.md` — Documented new blocking-thread semantics for issue #806
- `.github/workflows/pr-auto-review-reusable.yml` — Integrated blocking thread count logic via GraphQL query
- `test/workflows/pr-auto-review/blocking-threads.bats` — Comprehensive unit test coverage (152 lines)
### Verification:
✅ All 6 unit tests pass for null-safety, thread counting, and edge cases  
✅ All CI checks passing (13 success, 9 skipped, 0 failures)  
✅ All review threads resolved  
✅ No Tier 1 blockers present
**Skipped (advisory only):**
- Gemini suggestion for additional optional operators — current implementation is working correctly and safely handles all test cases

@don-petry
don-petry enabled auto-merge (squash) July 21, 2026 19:14

@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: cf0a4a013d0fec2a8867e847fc4071ec05dcc6b4
Review mode: triage-approved (single reviewer)

Summary

Implements the consumer-side fix from issue #806: the pr-auto-review readiness gate now blocks only on review threads that are unresolved AND not outdated, so dev-lead PRs whose advisory findings were fixed in code (making the threads outdated) no longer stall on manual thread resolution. Adds a pure, unit-tested helper (pr_auto_review_blocking_thread_count), 15 bats tests covering blocking/outdated/fail-safe/malformed-payload cases, and updated docs. Verified the jq logic locally: fail-safe holds (null/absent isOutdated on an unresolved thread still blocks) and GraphQL error bodies yield 0 while the transport remains fail-closed under set -e.

Linked issue analysis

Issue #806 (open) proposed two fixes; this PR delivers option 2 (consumer-side, defense-in-depth) exactly as specified, including the fail-safe that only an explicit isOutdated == true is non-blocking. The producer-side fix (dev-lead resolving threads it fixes) remains open work under #806, which the PR docs acknowledge. Substantively addressed for the consumer side.

Findings

  1. (Info, accepted) The change deliberately loosens the review gate: isOutdated is a diff-anchor heuristic, so an unresolved substantive concern whose flagged line changed without being fixed would no longer block. This is the explicit intent of #806, is documented as a heuristic (not a guarantee) in README/workflow/lib comments after Copilot review pushback, and the fail-safe prevents silent drops on unknown staleness. 2. (Nit) package-lock.json and node_modules/.package-lock.json name churn (pr-837 → pr-840) is unrelated mechanical noise from the dev-lead process; pre-existing pattern, no dependency changes. 3. Workflow change reviewed for Actions security smells: static single-quoted GraphQL query with variables passed via -f/-F (no shell/GraphQL injection), no permission changes, transport kept fail-closed (no || true). None found. 4. Secret scan: run_secret_scanning MCP tool unavailable in this environment; gitleaks CI check is green and the diff contains no credential-like content. 5. All 8 review threads (Gemini, Copilot x6, CodeRabbit) are resolved; CodeRabbit's earlier CHANGES_REQUESTED was dismissed and superseded.

CI status

All required and advisory checks green at cf0a4a0: Lint, ShellCheck, bats, Lint and bats, CodeQL (actions), SonarCloud, Agent Security Scan, agent-shield, Secret scan (gitleaks), npm audit, CodeRabbit. Ecosystem-conditional checks (pip-audit, cargo audit, govulncheck, pnpm audit, dependabot-automerge) skipped as expected. Mergeable; BLOCKED only on the pending review this verdict satisfies.


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

@don-petry
don-petry merged commit 48e1d57 into main Jul 21, 2026
23 checks passed
@don-petry
don-petry deleted the dev-lead/issue-806-20260721-1159 branch July 21, 2026 19:16
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.

dev-lead fix-review addresses advisory findings in code but never resolves the review thread → PRs stall on the advisory gate

3 participants