Skip to content

auto-rebase deadlock: 'review-ready' gate skips unapproved PRs but the auto-rebase:ready label is never applied (#465 gap) #711

Open

Description

@don-petry

Summary

The auto-rebase eligibility gate (#465) skips any PR that isn't review-ready = non-draft AND (has a current APPROVED review OR carries the ready_label, default auto-rebase:ready). The auto-rebase:ready label half was never implemented: no workflow or dev-lead step applies it, it isn't defined in any labels.yml, and 0 of 55 currently-open org PRs carry it. So in practice the only path to eligibility is an approval.

That deadlocks the exact PRs auto-rebase exists to help — dev-lead compliance/feature PRs that fall behind before they're approved:

PR falls behind main
  → auto-rebase skips it ("not eligible under 'review-ready' (draft=false approved=false label=false)")
  → PR drifts into a merge conflict as main advances
  → pr-review-agent won't approve a conflicting / red PR
  → no approval  → never eligible  → never rebased  ⟳  (rots indefinitely)

Evidence

Live auto-rebase run 29297648847 (bmad-bgreat-suite, 2026-07-14):

PR #205 (add/ci-failure-analyst-v2)      not eligible under 'review-ready' (draft=false approved=false label=false) — skipping
PR #352 (dev-lead/issue-351-...)         not eligible under 'review-ready' (draft=false approved=false label=false) — skipping
PR #345 (dev-lead/issue-322-...)         not eligible under 'review-ready' (draft=false approved=false label=false) — skipping
PR #362 (dev-lead/issue-361-...)         12 behind — updating branch → merge conflict → Posting conflict resolution request  ✅ (approved, eligible)

Stuck cohort (conflicting + REVIEW_REQUIRED, no activity for weeks; divergence from main):

PR ahead/behind note
bmad-bgreat-suite#205 2 / 22 last touched 2026-06-23; salvageable
.github#217 45 / 66 heavily diverged
.github#292 92 / 106 hopelessly diverged — recreate
markets#207 — head branch deleted (compare 404) — zombie, close

The eligible-PR path works correctly (conflict → sentinel → dev-lead). The gap is purely that non-approved in-flight PRs never become eligible.

Fix options

A — wire up the label (recommended, matches the gate's own design):

  1. Define auto-rebase:ready in the standard labels.yml and sync it fleet-wide.
  2. Have dev-lead apply auto-rebase:ready to every non-draft PR it opens/manages (a PR dev-lead intends to merge is by definition review-bound). Optionally pr-review-agent adds it when it starts a review.
  3. Result: dev-lead PRs are eligible from creation, get kept current, and reach the conflict→dev-lead handoff before divergence becomes intractable.

B — broaden the predicate: treat a non-draft PR as eligible if it is in the merge pipeline (has an open review request or an auto-rebase-conflict sentinel), not only when APPROVED. Avoids a new producer but widens fan-out.

C — escalate skipped-but-conflicting PRs: even when a PR is gate-skipped, if it is CONFLICTING still surface it once (label needs-manual-rebase / ping) so it can't rot invisibly. Complementary to A/B, not a replacement.

Recommendation: A + C — A closes the deadlock at the source; C guarantees nothing rots silently if a future gap reappears.

Acceptance

Related: #465 (eligibility gate), auto-rebase-reusable.yml, lib/eligibility.sh.

Activity

  1. don-petry commented on Jul 14, 2026

    @don-petry
    ContributorAuthor

    Validation + second failure mode (2026-07-14)

    Applied auto-rebase:ready to bmad-bgreat-suite#205 and dispatched auto-rebase (run 29298232627). The label fix works — #205 flipped from not eligible ... — skipping to:

    PR #205 (add/ci-failure-analyst-v2) is 22 commit(s) behind main — updating branch
    

    So Option A (wire up auto-rebase:ready) demonstrably breaks the deadlock: a non-approved PR becomes eligible and reaches the conflict path.

    But a second failure mode surfaced on that same run:

    ::warning::could not post conflict comment on #205 (comment cap / API error) — continuing
    

    The conflict sentinel that triggers dev-lead could not be posted — #205 has hit GitHub's ~2500-comment cap (see lib/comments.sh, which correctly swallows the error so it can't starve other PRs). Consequence: on long-lived, heavily-churned PRs the dev-lead handoff is blocked even once the PR is eligible.

    Implications for the fix:

    • A is necessary but not sufficient on legacy PRs — pair it with C (escalate/label needs-manual-rebase when the sentinel can't post) so a capped PR surfaces to a human instead of silently no-op'ing.
    • Applying auto-rebase:ready at PR creation (per A) avoids this entirely for new PRs — they never accumulate 2500 comments before becoming eligible. The cap only bites PRs that were already stuck for a long time.

    Revised triage for #205: not salvageable via automation (comment cap + 22-behind conflict). Recommend recreate from a fresh branch (cherry-pick the 2 ahead commits) rather than resolve in place.

  2. don-petry commented on Jul 14, 2026

    @don-petry
    ContributorAuthor

    Status update — fixes shipped (2026-07-13)

    Part A (label new PRs ready) — SHIPPED:

    • .github-private#1201 — dev-lead labels every PR it opens auto-rebase:ready.
    • .github-private#1202 — same for aw-standards-sync + aw-readme-refresh. (release-notes.sh excluded — self-repo changelog PRs that merge immediately.)

    Part C (surface skipped-but-conflicting PRs) — SHIPPED:

    • .github#713 — when the eligibility gate skips a PR that is mergeable_state=dirty, post a one-time <!-- auto-rebase-stuck --> notice (idempotent, zero extra API cost, comment-cap-safe). This is the safety net for anything Part A misses (legacy PRs, comment-capped PRs).

    Stuck-cohort triage — resolved (all superseded, none recreated):

    • bmad-bgreat-suite#205 — CLOSED; CI Failure Analyst + all its files already on main.
    • .github#292 — CLOSED; modifies the now-deleted claude.yml (claude workflow deprecation #456).
    • .github#217 — left open, needs a call: the org-standard dependency-audit.yml exists, but .github's own workflow still uses inline steps, so its 'replace standalone with org standard' goal may be partially unmet. Recommend verifying + closing or re-scoping.
    • markets#207 — already closed (deleted head branch).

    Remaining follow-up: standardize auto-rebase:ready in label management (no standards/labels.yml exists in this repo today; the label is currently created idempotently by the producers). Low priority now that Parts A+C are in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug reports

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions