You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8b1c620
Browse filesBrowse the repository at this point in the historyBrowse files
* fix(pr-quality): break CodeRabbit review feedback loop in gate comment
The readiness gate wrote a literal '@coderabbitai review' command into its status comment, and it rewrote an unchanged comment body on every wake.
- Remove the inline CodeRabbit command from the ready notice.
- Skip updateComment when the rebuilt body is unchanged.
- Add regression tests for both behaviors.
* test(pr-quality): cover unchanged CodeRabbit status wake
* test(pr-quality): keep status-wake regression focused
* test(pr-quality): cover legacy migration on no-op wake
* test(pr-quality): reproduce stale gate comment body
* fix(pr-quality): track gate comment body after writes
* test(pr-quality): restore trust-boundary context
* test(pr-quality): pin repeated failure comment target
* test: fix gate body helper
Copy file name to clipboardExpand all lines: .github/workflows/enforce-pr-target.yml
+13-2Lines changed: 13 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -300,7 +300,7 @@ jobs:
300
300
// One consolidated comment. The gate finds its own comment by the
301
301
// single GATE_MARKER; the legacy enforcer/readiness markers are
302
302
// matched only to migrate pre-consolidation PRs.
303
-
const gateComment = comments.find(
303
+
let gateComment = comments.find(
304
304
comment =>
305
305
comment.user?.login === "github-actions[bot]" &&
306
306
comment.body?.includes(GATE_MARKER)
@@ -406,12 +406,22 @@ jobs:
406
406
);
407
407
}
408
408
if (gateCommentId) {
409
+
// Skip the write when the rebuilt body matches what is already
410
+
// posted. A no-op comment edit is still a mutation event to
411
+
// review bots, so updating an identical body would re-wake the
412
+
// CodeRabbit status signal that triggered this run and create
413
+
// a self-sustaining loop.
414
+
if (gateComment?.body === body) {
415
+
await migrateLegacyCommentsIfNeeded();
416
+
return;
417
+
}
409
418
await github.rest.issues.updateComment({
410
419
owner,
411
420
repo,
412
421
comment_id: gateCommentId,
413
422
body
414
423
});
424
+
gateComment.body = body;
415
425
await migrateLegacyCommentsIfNeeded();
416
426
return;
417
427
}
@@ -422,6 +432,7 @@ jobs:
422
432
body
423
433
});
424
434
gateCommentId = created.data.id;
435
+
gateComment = { id: gateCommentId, body };
425
436
await migrateLegacyCommentsIfNeeded();
426
437
}
427
438
@@ -1351,7 +1362,7 @@ jobs:
1351
1362
? "This pull request has been marked Ready for Review."
1352
1363
: "This pull request is already Ready for Review.",
1353
1364
readyMoment
1354
-
? `The ${inlineCode(REVIEW_READY_LABEL)} label marks this PR as ready; review automation runs independently. If no CodeRabbit review appears, comment ${inlineCode("@coderabbitai review")} to request one.`
1365
+
? `The ${inlineCode(REVIEW_READY_LABEL)} label marks this PR as ready; review automation runs independently.`
0 commit comments