Skip to content

fix(governance): honor resolved review threads - #1180

Merged
seonghobae merged 7 commits into
developfrom
fix/pr-governance-resolved-review-comments
Aug 3, 2026
Merged

fix(governance): honor resolved review threads#1180
seonghobae merged 7 commits into
developfrom
fix/pr-governance-resolved-review-comments

Conversation

@seonghobae

@seonghobae seonghobae commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • join REST review comments to GraphQL review-thread resolution by database ID
  • treat only comments in current, unresolved, non-outdated threads as blocking review-comment evidence
  • fail closed when review-thread or per-thread comment pagination is truncated

Why

PR #1112 has five resolved threads and no unresolved current thread, but the metadata gate still treated resolved CodeRabbit text containing potential issue as blocking because it inspected only the REST comment body and current commit ID.

Validation

  • bash scripts/ci/test_pr_governance_gate.sh — PASS
  • shellcheck scripts/ci/pr_governance_gate.sh scripts/ci/test_pr_governance_gate.sh — PASS
  • bash -n scripts/ci/pr_governance_gate.sh scripts/ci/test_pr_governance_gate.sh — PASS
  • git diff --check — PASS
  • live read-only GraphQL check on PR feat(data): validate DiskSage archive inclusion evidence #1112: 5 threads, 0 unresolved current, 0 unresolved comment IDs, no truncation

Current-head revalidation

  • Head: 792e1922ce0be81283468d55ca8183100753ef7b
  • Added per-thread comments.pageInfo.hasNextPage fail-closed regression scenario; full governance gate PASS
  • Bash syntax, ShellCheck warning+ profile, and git diff --check: PASS
  • Hosted Docker retry on the exact head: frontend, backend, and Naruon images all PASS
  • Current-head hosted checks: 31 success, 2 neutral, 11 skipped, 0 pending/failed
  • Open PR code-scanning alerts: 0; open Medium/High/Critical Dependabot alerts: 0
  • Review threads: 0, with no pagination truncation

The workflow remains metadata-only. This PR does not dismiss reviews, merge PRs, execute PR-head code, or change central OpenCode dispatch.

Summary by CodeRabbit

  • Bug Fixes

    • Improved pull request governance checks to accurately distinguish resolved and unresolved review comments.
    • Prevented resolved CodeRabbit review comments from incorrectly blocking approval.
    • Added safeguards when review-thread data is incomplete or truncated; resolution cannot be assumed in those cases.
  • Tests

    • Added coverage for resolved comments and incomplete review-thread metadata scenarios.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9db60ef7-e6e4-45f3-aab5-b3059aebbbe1

📥 Commits

Reviewing files that changed from the base of the PR and between e268f53 and 3f72a83.

📒 Files selected for processing (1)
  • scripts/ci/test_pr_governance_gate.sh
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/ci/test_pr_governance_gate.sh

📝 Walkthrough

Walkthrough

The governance gate detects incomplete review-thread metadata, tracks unresolved review comment IDs, and filters CodeRabbit blockers against those IDs. Tests cover resolved comments and truncated thread metadata.

Changes

Governance evidence validation

Layer / File(s) Summary
Review-thread evidence and blocker filtering
scripts/ci/pr_governance_gate.sh
The GraphQL query now returns pagination metadata and comment IDs. Truncated metadata blocks resolution proof. CodeRabbit blockers require matching unresolved comment IDs.
Governance evidence scenario tests
scripts/ci/test_pr_governance_gate.sh
The fake API and test runner cover resolved CodeRabbit comments and truncated thread or comment metadata. These cases verify failure markers and merge prevention.

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

Possibly related PRs

Suggested reviewers: opencode-agent

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: honoring resolved review threads in PR governance.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/pr-governance-resolved-review-comments

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

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

PR governance metadata gate update for 3f72a83686940d93b56bd64175212b3884ec1480: no current blocking failures remain.

PR governance metadata gate is ready; all current-head requirements passed.

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (1)
scripts/ci/test_pr_governance_gate.sh (1)

87-89: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Cover truncated per-thread comment pagination.

This only exercises reviewThreads.pageInfo.hasNextPage; add a scenario where reviewThreads.pageInfo.hasNextPage is false but an unresolved thread has comments.pageInfo.hasNextPage: true, then assert the same fail-closed blocker and no merge.

Also applies to: 784-793

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/ci/test_pr_governance_gate.sh` around lines 87 - 89, Add a governance
test scenario alongside the existing review_threads_truncated handling in the PR
gate script where reviewThreads.pageInfo.hasNextPage is false but an unresolved
thread’s comments.pageInfo.hasNextPage is true. Assert that this truncated
per-thread pagination produces the same fail-closed blocker and prevents
merging, matching the existing truncated review-thread scenario.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@scripts/ci/test_pr_governance_gate.sh`:
- Around line 87-89: Add a governance test scenario alongside the existing
review_threads_truncated handling in the PR gate script where
reviewThreads.pageInfo.hasNextPage is false but an unresolved thread’s
comments.pageInfo.hasNextPage is true. Assert that this truncated per-thread
pagination produces the same fail-closed blocker and prevents merging, matching
the existing truncated review-thread scenario.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 409f12e0-5c41-4333-a7f9-bde9d09dc467

📥 Commits

Reviewing files that changed from the base of the PR and between eae74e2 and e268f53.

📒 Files selected for processing (2)
  • scripts/ci/pr_governance_gate.sh
  • scripts/ci/test_pr_governance_gate.sh

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 29, 2026
@seonghobae

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor
✅ 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.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Closing after Loop drain: permanently blocked — branch was updated onto develop for mergeability, which cleared prior APPROVED robot evidence; re-review (CodeRabbit/OpenCode) and/or central gate jobs (metadata-only gate evaluation, coverage-evidence) remained pending/stuck without a re-runnable workflow handle. Not force-merging (merge-gate policy). Re-open a focused PR when robot capacity is available. Related product security fixes that reimplemented cleanly remain on branch goal/carddav-path-traversal-decode (#1206) for relaunch.

@seonghobae seonghobae closed this Jul 31, 2026
@seonghobae seonghobae reopened this Jul 31, 2026
@seonghobae
seonghobae enabled auto-merge July 31, 2026 13:54
@seonghobae
seonghobae merged commit d6359b2 into develop Aug 3, 2026
45 checks passed
@seonghobae
seonghobae deleted the fix/pr-governance-resolved-review-comments branch August 3, 2026 00:01
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.

1 participant