Skip to content

fix(merge-gate): check_bot_anchoring counts inline comments, not includesCreatedEdit - #279

Closed
jaylfc wants to merge 1 commit into
masterfrom
exec/tsk-e4cpto
Closed

jaylfc wants to merge 1 commit into
masterfrom
exec/tsk-e4cpto

Conversation

@jaylfc

@jaylfc jaylfc commented Aug 14, 2026

Copy link
Copy Markdown
Owner

CARD TITLE (intent, not commit subject): fix(merge-gate): check_bot_anchoring counts inline comments, not includesCreatedEdit

Autonomous build of board card tsk-e4cpto.

includesCreatedEdit means 'this review was edited', not 'has inline
comments', so inline-only bot reviews (CodeRabbit's normal shape) were
rejected by the anchoring gate. Use comments.totalCount > 0 instead.

Files:
scripts/merge-gate/check_bot_anchoring.sh | 2 +-
tests/fixtures/merge_gate/pr_inline_only.json | 15 +++++++++++
tests/test_merge_gate.py | 37 +++++++++++++++++++++++++++
3 files changed, 53 insertions(+), 1 deletion(-)

…ncludesCreatedEdit

includesCreatedEdit means 'this review was edited', not 'has inline
comments', so inline-only bot reviews (CodeRabbit's normal shape) were
rejected by the anchoring gate. Use comments.totalCount > 0 instead.
@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing

@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 57 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: adc85f51-95c8-4507-82a1-a832b555e675

📥 Commits

Reviewing files that changed from the base of the PR and between 031b401 and 3cdb901.

📒 Files selected for processing (3)
  • scripts/merge-gate/check_bot_anchoring.sh
  • tests/fixtures/merge_gate/pr_inline_only.json
  • tests/test_merge_gate.py

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.

@gitar-bot

gitar-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown

Important

You are using the Gitar free plan. Upgrade to unlock code review, CI analysis, auto-apply, custom automations, and more.

Gitar

Comment thread tests/test_merge_gate.py

# Reconstruct the pre-fix logic that relied on includesCreatedEdit
with open(os.path.join("scripts", "merge-gate", "check_bot_anchoring.sh")) as f:
buggy_script = f.read().replace(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUGGESTION: Regression test uses string replacement to reconstruct the buggy logic

If the implementation is later refactored to a different approach (e.g., extracting the inline-comment check to a helper function or using a different field), the .replace() silently fails to match. The buggy script would then contain the current fixed logic, and because the fixture's comments.totalCount is 3, the test would unexpectedly return SUCCESS instead of FAILED — masking a regression in the test itself.

Consider asserting against the old field directly (includesCreatedEdit) instead of patching the source string, or adding a dedicated fixture that has comments: null to also cover the missing-field edge case.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

kilo-code-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
tests/test_merge_gate.py 108 Regression test uses string replacement to reconstruct buggy logic; if implementation is refactored, the .replace() silently fails and the test may pass for the wrong reasons
Files Reviewed (3 files)
  • scripts/merge-gate/check_bot_anchoring.sh - no issues
  • tests/fixtures/merge_gate/pr_inline_only.json - no issues
  • tests/test_merge_gate.py - 1 suggestion

Fix these issues in Kilo Cloud


Reviewed by step-3.7-flash · Input: 69.5K · Output: 15K · Cached: 287.4K

@jaylfc

jaylfc commented Aug 14, 2026

Copy link
Copy Markdown
Owner Author

Closing, and the reason is a mechanism failure on my side, not a lane failure.

This rebuild carries the identical blocker to #277: has_inline now reads comments.totalCount, but line 11 of the script still fetches with gh pr view "$PR_NUMBER" --json number,headRefOid,reviews, and that payload has no comments key at all — measured on live data in the #277 review. The diff does not touch the fetch line, so the gate's behaviour on real PRs is unchanged: the same six live PRs still fail.

Why it came back unchanged. The lane never saw that review. It was posted on #277, which I closed to free the card, and the executor builds a lane's prompt from the card BODY only — comments never reach it. So closing a blocked PR to unblock its card also throws away the review that explains what was wrong. That is my error to fix, and I am fixing it by refiling the card with the data source spelled out in the body rather than by asking anyone to re-derive it.

Two things here are genuinely better than #277 and should survive into the rebuild: deriving the buggy comparison script from the real one by string replacement, instead of hand-copying it (test_inline_only_review_rejected_by_buggy_logic), which cannot drift out of sync; and splitting the old/new differential into two named tests instead of one.

Branch exec/tsk-e4cpto is untouched. Superseded by the refiled card.

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