Skip to content

auto-rebase: default eligibility to all; remove dead review-ready code; lock merge-method invariant #927

Closed

Description

@don-petry

Part of #926 (AC1 + AC3 + reusable-side cleanup for AC5).

  • Flip auto-rebase-reusable.yml's eligibility input default from review-ready to all.
  • Remove the now-dead review-ready eligibility mode and ready_label input plumbing from lib/eligibility.sh and the reusable, since nothing needs to opt around an approval gate that no longer exists.
  • Add/keep a regression test asserting update-branch is always called with update_method=merge, never rebase — this must not regress.

See #926's "Decisions (2026-08-02)" section for rationale (accepting CI cost — measured ~50s/re-test, <0.5% of serial-merge capacity per docs/initiatives/auto-rebase-vs-merge-queue.md §5 in petry-projects/.github-private).

Activity

  1. don-petry commented on Aug 3, 2026

    @don-petry
    ContributorAuthor

    Dev-Lead Implementation Plan

    Issue: #927 — auto-rebase: default eligibility to all; remove dead review-ready code; lock merge-method invariant

    Scope

    Flip the reusable auto-rebase eligibility default from review-ready to all, delete the now-dead review-ready mode and ready_label plumbing from lib/eligibility.sh and the reusable, and add a regression test pinning update_method=merge (never rebase).

    Implementation Checklist

    • .github/scripts/auto-rebase/lib/eligibility.sh — drop review-ready case, auto_rebase_has_ready_label, auto_rebase_has_current_approval; keep auto_rebase_pr_eligible (all + unknown-mode only)
    • .github/workflows/auto-rebase-reusable.yml — default eligibility: all; remove ready_label input, READY_LABEL env, the HAS_LABEL/IS_APPROVED computation, and the review-ready-only stuck-escalation block; update header comments
    • .github/scripts/auto-rebase/README.md — update eligibility contract table
    • standards/ci-standards.md — update eligibility table + default to match

    Tests to Write

    • test/workflows/auto-rebase/merge-method.bats (new) — assert the reusable calls update-branch with update_method=merge and never rebase
    • test/workflows/auto-rebase/eligibility.bats — remove tests for deleted functions/mode; keep all + unknown-mode cases (single-arg signature)

    Test Command

    bats test/workflows/auto-rebase/ (plus shellcheck -x .github/scripts/auto-rebase/lib/*.sh and bash .dev-lead/scripts/dev-lead-lint.sh)

  2. don-petry commented on Aug 3, 2026

    @don-petry
    ContributorAuthor

    Dev-Lead: Implementation Complete

    Plan Execution

    • lib/eligibility.sh — dropped review-ready mode + auto_rebase_has_ready_label + auto_rebase_has_current_approval; auto_rebase_pr_eligible MODE now handles only all (0) / unknown (2)
    • auto-rebase-reusable.yml — default flipped to eligibility: all; removed ready_label input, READY_LABEL env, the HAS_LABEL/IS_APPROVED computation, and the review-ready-only <!-- auto-rebase-stuck --> escalation block (unreachable under all); updated header/input comments. Conflict/blocked sentinel handling untouched.
    • Contract docs updated to match: .github/scripts/auto-rebase/README.md, standards/ci-standards.md, and the copy-paste stub standards/workflows/auto-rebase.yml
    • Regression test test/workflows/auto-rebase/merge-method.bats pins update_method=merge, asserts the rebase method never appears
    • eligibility.bats trimmed to the surviving contract + added guards that the removed mode/helpers are gone

    Test Results

    1..13
    ok 1 post_comment_best_effort: comment-cap failure is non-fatal (returns 0)
    ok 2 post_comment_best_effort: failure logs a continue warning naming the PR
    ok 3 post_comment_best_effort: success returns 0, posts the comment, no warning
    ok 4 post_comment_best_effort: a capped PR does not abort a bash -e loop over multiple PRs
    ok 5 pr_eligible all: every behind PR is eligible
    ok 6 pr_eligible: unknown mode errors out (exit 2)
    ok 7 pr_eligible: empty mode errors out (exit 2)
    ok 8 pr_eligible: the removed review-ready mode is rejected as unknown (exit 2)
    ok 9 auto_rebase_has_current_approval is no longer defined
    ok 10 auto_rebase_has_ready_label is no longer defined
    ok 11 merge-method: reusable workflow file exists
    ok 12 merge-method: update-branch is called with update_method=merge
    ok 13 merge-method: update-branch is never called with the rebase method
    

    Also passing: shellcheck -x on both libs, .dev-lead/scripts/dev-lead-lint.sh (all checks passed), yamllint (repo CI config, max: 200), and actionlint 1.7.7 (repo CI invocation) on all three workflow files.

    Files Changed

    • .github/workflows/auto-rebase-reusable.yml: default all; removed ready_label/approval plumbing + stuck-escalation block
    • .github/scripts/auto-rebase/lib/eligibility.sh: reduced to the all mode dispatch
    • .github/scripts/auto-rebase/README.md, standards/ci-standards.md, standards/workflows/auto-rebase.yml: contract/docs synced
    • test/workflows/auto-rebase/eligibility.bats: pruned dead tests, added removal guards
    • test/workflows/auto-rebase/merge-method.bats (new): merge-method invariant regression guard

    Notes

    • The eligibility input and the pure-predicate architecture are kept as the documented extension seam for a future "front-of-queue N" mode, per the reusable's own design note — only the review-ready implementation was removed.
    • The <!-- auto-rebase-stuck --> escalation (issue auto-rebase deadlock: 'review-ready' gate skips unapproved PRs but the auto-rebase:ready label is never applied (#465 gap) #711) was removed because it fired only on the skip path, which is unreachable once every behind PR is eligible; it was dead review-ready code.
    • Left untouched deliberately: docs/initiatives/pull-request-limits-adr.md still says the eligibility lever is "(already review-ready)". That is a point-in-time ADR record outside this issue's scope; rewriting historical decision records seemed inappropriate. Flag if you'd prefer it updated.
  3. added a commit that references this issue on Aug 3, 2026
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions