Repository navigation
auto-rebase: unguarded conflict-comment aborts the whole run when a PR hits the 2500-comment cap — blocks the ring1→stable soak gate #594
Description
Summary
A single comment-capped PR aborts every auto-rebase run on a repo. auto-rebase-reusable.yml's merge-conflict branch posts a conflict-resolution comment via gh pr comment (line ~235) without an error guard. When the target PR has hit GitHub's 2500-comment cap, that command exits non-zero and — because the step runs under bash -e (shell: /usr/bin/bash -e {0}) — the entire step fails, even though other PRs were rebased successfully earlier in the same run.
Evidence
petry-projects/bmad-bgreat-suite PR #205 (CI Failure Analyst…, OPEN) is at exactly 2500 comments. Every auto-rebase run that reaches it dies:
PR #205 (add/ci-failure-analyst-v2) is 8 commit(s) behind main — updating branch
Update failed: {"message":"merge conflict between base and head", ... "status":"422"}
Posting conflict resolution request
GraphQL: Commenting is disabled on issues with more than 2500 comments (addComment)
##[error]Process completed with exit code 1.
4 runs failed with this identical signature in the auto-rebase v2.1.0 soak window (all on bmad-bgreat-suite): 28484669277, 28481353704, 28314060392, 28311198868. PRs #341/#335/#334 were updated fine in the same runs — only the #205 comment killed them.
Impact
This is the canary-rollout blocker for auto-rebase (initiative #495, gate standard #548). The gate correctly classifies it BLOCKED / PRE_EXISTING (cum_fail=4, reusable byte-identical to prior), so it will not roll back — but auto-rebase can never reach stable while a capped PR keeps poisoning the ring1 (bmad) runs. Same failure class as the pr-review-mention comment-cap loop (#553).
Root cause
auto-rebase-reusable.yml line ~235:
gh pr comment "$PR_NUMBER" --repo "$REPO" --body "$CONFLICT_BODY"The sibling delete on line ~217 is already guarded (... || true); the post is not. A best-effort conflict notification must not be fatal to the core function (rebasing the other PRs).
Fix (primary — the reusable)
Guard the post so a comment-side failure is logged, not fatal (mirrors #553):
gh pr comment "$PR_NUMBER" --repo "$REPO" --body "$CONFLICT_BODY" \
|| echo "::warning::could not post conflict comment on #$PR_NUMBER (comment cap / API error) — continuing"Introduced by the #482 reusables initiative (auto-rebase-reusable.yml). Add a regression test to auto-rebase-tests.yml stubbing a non-zero gh pr comment and asserting the run still succeeds and continues to the next PR.
Secondary (the capped PR)
bmad-bgreat-suite #205 has 2500 comments and cannot be commented on again. Surface to the owner to resolve/close #205 (and audit what generated 2500 comments there). Not something the release automation should mutate.
Enhancement — auto-triage this class in the release workflow
The canary-rollout gate already classifies REGRESSION vs PRE_EXISTING and supports a per-agent benign_failure_classes allowlist (#1025 P2), but that matches on failed-step name only — too coarse here (the step name Update behind non-Dependabot PRs also covers real failures). Proposal: extend the gate's failure triage to inspect the log signature (error text) of an in-window failure and auto-classify known-environmental patterns — more than 2500 comments, secondary-rate-limit, HTTP 5xx — as benign/environmental, distinct from a genuine step failure. That would let a comment-cap failure be excluded from cum_fail automatically (defense-in-depth) even before the source fix lands, without masking real regressions. Tracked against canary-rollout #495 / soak standard #548.
Refs
#482 (introducing initiative) · #553 (precedent comment-cap fix) · #495 / #548 (canary-rollout + soak standard) · petry-projects/.github-private #1045 (promote path that surfaced this).
Activity
don-petry commentedon Jul 3, 2026
Dev-Lead Implementation Plan
Issue: #594 — auto-rebase: unguarded conflict-comment aborts the whole run when a PR hits the 2500-comment cap
Scope
Make the merge-conflict resolution comment in
auto-rebase-reusable.ymlbest-effort so a comment-side failure (GitHub's 2500-comment cap, secondary rate limit, transient 5xx) is logged and swallowed instead of killing the wholebash -estep, letting the loop continue rebasing the other PRs.Implementation Checklist
.github/scripts/auto-rebase/lib/comments.shwith a testableauto_rebase_post_comment_best_efforthelper (posts viagh pr comment; on failure emits::warning::… — continuingand returns 0) — mirrors the extract-logic-to-scripts convention so it can be bats-tested instead of trapped inline in YAMLcomments.shin.github/workflows/auto-rebase-reusable.ymland route the conflict post (line ~235) through the helper (fix mirrors fix(pr-review-mention): break the ack self-comment recursion #553)comments.shto the shellcheck step in.github/workflows/auto-rebase-tests.yml.github/scripts/auto-rebase/README.mdTests to Write
test/workflows/auto-rebase/comments.bats: stub a non-zerogh pr comment→ helper returns 0 (non-fatal) and logs the::warning::… continuinglinebash -eloop over two PRs where the first PR's comment fails still reaches and processes the second PRTest Command
bats --print-output-on-failure test/workflows/auto-rebase/(plusshellcheck -xon the auto-rebase libs andbash .dev-lead/scripts/dev-lead-lint.sh)Note on scope
Primary (reusable) fix only. The capped PR (bmad-bgreat-suite #205) and the release-workflow log-signature auto-triage enhancement are separate follow-ups called out in the issue and are out of scope here.
don-petry commentedon Jul 3, 2026
Dev-Lead: Implementation Complete
Plan Execution
.github/scripts/auto-rebase/lib/comments.shwith best-effortauto_rebase_post_comment_best_efforthelpercomments.shto the shellcheck step inauto-rebase-tests.ymlTest Results
Also green:
shellcheck -xon both auto-rebase libs (CI parity) andbash .dev-lead/scripts/dev-lead-lint.sh(all checks passed); both workflow YAMLs parse.Files Changed
.github/scripts/auto-rebase/lib/comments.sh(new):auto_rebase_post_comment_best_effort PR_NUMBER REPO BODY— posts viagh pr comment; on any failure (2500-comment cap / secondary rate limit / transient 5xx) emits::warning::… — continuingand returns 0..github/workflows/auto-rebase-reusable.yml: sourcecomments.sh; the conflict post now calls the helper instead of a baregh pr comment, so it can no longer abort thebash -estep and starve the other PRs of a rebase.test/workflows/auto-rebase/comments.bats(new): stub a non-zerogh pr comment→ non-fatal + warning; success case; and abash -eloop over two PRs where the first (capped) PR's comment fails yet the loop still reaches the second PR..github/workflows/auto-rebase-tests.yml: shellcheck now also coverscomments.sh..github/scripts/auto-rebase/README.md: documents the new helper and the auto-rebase: unguarded conflict-comment aborts the whole run when a PR hits the 2500-comment cap — blocks the ring1→stable soak gate #594 rationale.Notes
workflows-permission branch) is the same unguarded class but was not in this issue's scope; it could reuse the same helper in a future change.don-petry commentedon Jul 3, 2026
Second instance — same root cause blocks
pr-review-mentiontooThe canary gate also holds pr-review-mention at ring1→stable (
cum_fail=1), and it's the identical comment-cap class:28318567437onpetry-projects/bmad-bgreat-suite, stepPost acknowledgement comment:#553added the marker-based trigger guard to stop the self-comment loop, but the ack-post itself is still unguarded, so a comment-capped target PR makes it exit non-zero → the run fails.So both remaining #482 ring1→stable blockers are one bug class (unguarded best-effort comment under
bash -e), both surfacing onbmad-bgreat-suitewhere PR #205 (and possibly others) sit at the 2500-comment cap:auto-rebase-reusable.yml— conflict comment (~L235)pr-review-mentionreusable —Post acknowledgement commentstepFix both: guard the
gh pr comment/gh api ... addCommentwith|| echo "::warning::…"so a comment-side failure is logged, not fatal. The proposed gate log-signature triage enhancement (auto-classifymore than 2500 comments/ rate-limit / 5xx as environmental) would unblock both reusables' soak automatically even before the source fixes land.Once both reusables are guarded (and/or the enhancement lands), the canary timer (now armed,
CANARY_AUTO_PROMOTE=true) will auto-promote auto-rebase + pr-review-mention to stable — completing the 6/6 #482 rollout with no manual step.feat: implement issue #594 — auto-rebase: unguarded conflict-comment …
fix(pr-review-mention): guard ack-comment post against the 2500-comme…