feat: implement issue #1918 — Approval gate can never clear bot status comments — SonarCloud re-posts 'Quality Gate passed' on every push and #1911's resolve script is self-scoped, so the #1894 queue is still deadlocked

Merged
DO
2mo ago
+816-89

Problem

Approval gate can never clear bot status comments — SonarCloud re-posts 'Quality Gate passed' on every push and #1911's resolve script is self-scoped, so the #1894 queue is still deadlocked

From the issue: PR #1913 (implements #1908) was approved by pr-review twice, at 11:45Z on e42886f9 and 12:08Z on 103d0513, with no blocking findings. Both approvals were dismissed with Dismissing approval due to a PR issue comment lacking a verified disposition (#1813). The gate log (run 35858596981):

Risk

Low — changes automation shell logic under scripts/, covered by shellcheck (--severity=warning) and the bats suite.

Test plan

Tests added/updated: tests/dev-lead/unit/test_maintainer_comment_gate.bats,tests/dev-lead/unit/test_maintainer_resolve_comment.bats tests/test_reviewer_sources.bats. Verification: bash scripts/dev-lead-lint.sh (shellcheck --severity=warning) ran pre-commit; the bats suite runs in CI.

Rollback

Revert this PR. No non-revertible side effects (no tags, migrations, or external state).

Monitoring

This PR's Lint (shellcheck) and bats checks show pass/fail; watch subsequent dev-lead / pr-review runs for behavioral regressions.

Closes #1918

Rollout: a pr-review channel cut IS required after merge

maintainer-comment-gate.sh runs inside pr-review, which in this repo executes from the channel tag pr-review/v1-next (.github/workflows/pr-review-trigger.yml). That tag is at eee2898e (2026-09-23 03:55Z) and does not contain #1911 either. Until the channel moves, this merge changes nothing at runtime, because the autocut only watches the reusable-workflow blob (#1592).

After merge:

scripts/cut-release.sh pr-review <next-version> --ref main --channel v1-next --dry-run
scripts/cut-release.sh pr-review <next-version> --ref main --channel v1-next --push
git fetch --tags --force && git merge-base --is-ancestor <merge-sha> pr-review/v1-next && echo live

Review follow-up (cd074900)

  • The SonarCloud clean-pass pattern now pins **Quality Gate passed** and [0 New issues] and [0 Security Hotspots]. A passing gate that reports issues or hotspots still blocks, per #1918 AC1.
  • The registered-bot path in maintainer-resolve-comment.sh requires author.__typename == "Bot", so a person whose login matches a registered bot's is refused.

Summary by CodeRabbit

  • New Features
    • Clean SonarCloud status comments with zero new issues and zero security hotspots no longer block PR approval.
    • Maintainers can resolve comments from registered status bots by providing a reason. Replies are recorded on the original comment, and comments from other people remain protected.
  • Bug Fixes
    • PR comments without a verified resolution continue to block approval. Failed or unclear status comments, reported findings, and unverifiable authorship or registry information are handled safely.
  • Documentation
    • Updated guidance explains how PR comments are reviewed, resolved, and handled when status information cannot be verified.