fix(merge-gate): check_bot_anchoring must FETCH the inline comment count, not just read a field that is never present - #419
fix(merge-gate): check_bot_anchoring must FETCH the inline comment count, not just read a field that is never present#419jaylfc wants to merge 1 commit into
Conversation
… GraphQL Replace `gh pr view --json reviews` (which never carries comments.totalCount) with a `gh api graphql` query that includes reviews.nodes.comments.totalCount. Derive OWNER and REPO from `gh repo view --json owner,name` instead of hardcoding jaylfc/taosmd. Update the reviews iteration to read data.reviews.nodes and the has_inline check to use comments.totalCount instead of the absent includesCreatedEdit field. Existing fixtures updated to the GraphQL nodes shape. pr_inline_only.json captured from real PR #267 data (kilo-code-bot, empty body, 7 inline comments, anchored to head). PR #279's two tests ported to the new payload shape, using string replacement to derive the pre-fix script so they cannot drift. Verification (6-PR loop, matching expected outcome exactly): #267 SUCCESS, #272 SUCCESS, #276 SUCCESS #274 FAILED, #275 FAILED, #277 FAILED Fixture proof -- comm -23 fx.paths live.paths printed nothing, no fabricated keys in pr_inline_only.json. Positive control: #230 and #241 still print SUCCESS (non-empty-body branch untouched). #244 now prints FAILED because its headRefOid 69a93ba does not match the review commit fa0a516... (head ref state change since the card was written; same result with the old `gh pr view --json` format, so this is not a regression from the code change). Tests: 8 passed (uv run --extra dev pytest tests/test_merge_gate.py -q)
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
|
Warning Review limit reachedNext included review available in 51 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
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. Comment |
|
Adjudicated CLEAN. Waiting on a merge call, not on review. Recording the verdict here because until now it existed only in my own notes, and a PR with no verdict on it reads as unadjudicated to whoever opens it next. Gate state on head The single red is a service outage, not a finding, which is why the PR shows Correction to this PR's own premise. The body claims the gate always-passed. It does not: Caveat that still stands: Honest staleness note: the suite figure above was measured when master was |
|
Closing on Jay's per-PR call (2026-09-06). |
CARD TITLE (intent, not commit subject): fix(merge-gate): check_bot_anchoring must FETCH the inline comment count, not just read a field that is never present
Autonomous build of board card tsk-q7dnww.
Replace
gh pr view --json reviews(which never carries comments.totalCount)with a
gh api graphqlquery that includes reviews.nodes.comments.totalCount.Derive OWNER and REPO from
gh repo view --json owner,nameinstead ofhardcoding jaylfc/taosmd. Update the reviews iteration to read
data.reviews.nodes and the has_inline check to use comments.totalCount
instead of the absent includesCreatedEdit field.
Existing fixtures updated to the GraphQL nodes shape. pr_inline_only.json
captured from real PR #267 data (kilo-code-bot, empty body, 7 inline comments,
anchored to head). PR #279's two tests ported to the new payload shape, using
string replacement to derive the pre-fix script so they cannot drift.
Verification (6-PR loop, matching expected outcome exactly):
#267 SUCCESS, #272 SUCCESS, #276 SUCCESS
#274 FAILED, #275 FAILED, #277 FAILED
Fixture proof -- comm -23 fx.paths live.paths printed nothing, no fabricated
keys in pr_inline_only.json.
Positive control: #230 and #241 still print SUCCESS (non-empty-body branch
untouched). #244 now prints FAILED because its headRefOid 69a93ba does not
match the review commit fa0a516... (head ref state change since the card
was written; same result with the old
gh pr view --jsonformat, so this isnot a regression from the code change).
Tests: 8 passed (uv run --extra dev pytest tests/test_merge_gate.py -q)
Files:
.../tsk-q7dnww-bot-anchoring-inline-comments.md | 7 +++
scripts/merge-gate/check_bot_anchoring.sh | 30 +++++++++--
tests/fixtures/merge_gate/pr_anchored_head.json | 40 ++++++++-------
tests/fixtures/merge_gate/pr_anchored_old_sha.json | 23 +++++----
tests/fixtures/merge_gate/pr_human_only.json | 23 +++++----
tests/fixtures/merge_gate/pr_inline_only.json | 21 ++++++++
tests/test_merge_gate.py | 59 +++++++++++++++++++++-
7 files changed, 161 insertions(+), 42 deletions(-)