Skip to content

auto-rebase still merges main into every open PR on every push, though the ruleset no longer requires up-to-date branches — the treadmill's driver outlived the strict fix #1881

Closed

Description

@don-petry

Summary

Dropping strict_required_status_checks_policy (see #1864's decision record) removed the ruleset's demand that every PR be up to date with main — but auto-rebase.yml still merges main into every open PR on every push to main, unconditionally. The ruleset no longer requires it; the automation does it anyway. So the treadmill's driver is still live, one layer down.

Evidence, 2026-09-21

strict was set false at ~02:55Z. Since then, two pushes landed on main, and the cascade fired on both:

13:22:07  push to main   (feat: implement issue #1874 …)
13:22:11  auto-rebase.yml  event=push  success
13:23:12  #1794  "Merge branch 'main' into dev-lead/…"   author=Don Petry committer=GitHub
13:23:20  #1770  "Merge branch 'main' into dev-lead/…"   author=Don Petry committer=GitHub

Cost of that single cascade — pr-auto-review runs in the 30 minutes either side:

Window Runs
12:50–13:20 (before) 25
13:22–13:52 (after) 51

Accumulated merge-from-main commits on individual PRs remain high: #1742 has 23, #1770 has 22, #1794 has 16 — the great majority carrying no content change at all.

Correction to an earlier reading

A pre/post run-rate comparison appeared to show an ~86% drop after the ruleset change. That comparison was confounded and should not be relied on. The "before" window contained four PR merges landed by hand within ~20 minutes (four pushes → four full cascades); the "after" window contained a single push. The lower rate mostly reflects fewer merges to main, not a structurally quieter fleet. When a push did occur, the cascade behaved exactly as before.

Why strict alone could not have fixed it

strict and auto-rebase were two independent enforcers of the same invariant. Removing the first leaves the second untouched: auto-rebase.yml triggers on push: branches: [main] and updates open PRs without ever consulting whether being behind main actually blocks anything.

Acceptance Criteria

  1. auto-rebase updates a PR from its base only when being behind actually blocks that PR — i.e. when the ruleset requires up-to-date branches, or the PR is queued to merge, or a human/label explicitly requests it. Being merely BEHIND with no such requirement is not a reason to push.
  2. The condition is derived from repository configuration, not hardcoded. If strict is re-armed later (Merge protections are unsatisfiable at N>1 open PRs: one merge to main forces a full re-review of every other PR — ~154 forced re-reviews in 48h, zero merges #1864 records it as a one-field revert), auto-rebase resumes its current behaviour with no further code change.
  3. Genuine conflict resolution is unaffected: a DIRTY PR still gets the existing rebase/conflict path. This issue is only about the no-op base merges.
  4. A deterministic counter distinguishes base merges that were required from those that were skipped as unnecessary, so the effect is measurable rather than assumed — and so Merge protections are unsatisfiable at N>1 open PRs: one merge to main forces a full re-review of every other PR — ~154 forced re-reviews in 48h, zero merges #1864 AC Optimize review: small-PR and incremental fast paths #4's metric has a second input alongside pr-review re-runs the full tier stack for a conflict-free base merge — carry the prior verdict forward when the diff-vs-merge-base is unchanged #1865's.
  5. Measured over a window containing at least three pushes to main, no-op base merges on non-queued PRs fall to zero.

Relationship to the rest of #1864

#1865 stops the re-review that follows a no-op base merge. This issue stops the no-op base merge itself. They are complementary and neither subsumes the other: #1865 protects against any source of a content-identical new SHA, while this removes the main producer of them. Landing only #1865 still leaves every PR accumulating empty merge commits and churning CI; landing only this still leaves re-reviews triggered by other pushes.

References

Activity

  1. github-actions commented on Sep 21, 2026

    @github-actions
    Contributor

    Thanks for the exceptional write-up — the cascade timing data and corrected pre/post comparison make the root cause extremely clear. One question before we dig into the fix: since auto-rebase.yml is a thin caller stub and behavioral changes need to land in the reusable workflow, do you want the fix implemented as a new eligibility mode (e.g. eligibility: blocking-only) passed via with: — keeping the default all for repos that still want unconditional updates — or should the reusable auto-detect the ruleset strict setting without requiring a caller-side change?

  2. don-petry commented on Sep 22, 2026

    @don-petry
    CollaboratorAuthor

    Dev-Lead Implementation Plan

    Issue: #1881 — auto-rebase still merges main into every open PR on every push, though the ruleset no longer requires up-to-date branches

    Scope & architectural boundary

    The behavioural gate (deciding whether update-branch fires) lives entirely in the
    central reusable petry-projects/.github/.github/workflows/auto-rebase-reusable.yml
    (lib/eligibility.sh) — this repo holds only the channel-pinned thin caller stub
    .github/workflows/auto-rebase.yml (@auto-rebase/v2-next). Per the AGENTS.md
    "Caller-stub input forwarding across channel pins" guardrail, I will not add a with:
    forward for a new eligibility mode the pinned channel does not yet declare/implement — that
    gate (AC #1 behaviour, AC #2 config-read, AC #5) must land in the central reusable first
    (the #738/#468 pattern), then be promoted onto the channel, then forwarded. That sequence
    cannot be completed from this repo.

    What can and should land here is AC #4 — the deterministic, config-derived counter
    that makes the no-op base-merge volume measurable (the second input to #1864 AC #4,
    alongside #1865's reviews_carried_forward). It lives in this repo's existing auto-rebase
    measurement surface, scripts/auto_rebase_health.sh, mirroring how #1865's re-review counter
    landed here.

    Implementation Checklist

    Tests to Write

    • tests/auto_rebase_health.bats: strict_from_branch_rules true/false/absent/empty
    • tests/auto_rebase_health.bats: summarize_base_merges — strict-off all-skippable,
      strict-on all-required, queued→required, labelled→required, draft/dependabot/DIRTY excluded, empty→0/0
    • tests/auto_rebase_health.bats: render_report surfaces the base-merge-necessity section + counters

    Test Command

    bats tests/auto_rebase_health.bats (full: scripts/run-bats.sh tests/*.bats) · lint: bash .dev-lead/scripts/dev-lead-lint.sh

  3. don-petry commented on Sep 22, 2026

    @don-petry
    CollaboratorAuthor

    Dev-Lead: Progress (in progress — not yet durable)

    Provisional. Nothing is pushed yet; the automation posts the authoritative
    completion record (with PR number + head SHA) after the push. Treat the notes
    below as intent, not delivered results.

    Plan Execution (intended)

    Scope note (why this half lands here)

    Local check output (provisional — not the pushed run)

    bats tests/auto_rebase_health.bats  →  39 passing, 0 failing (16 new)
    bash .dev-lead/scripts/dev-lead-lint.sh  →  all checks passed
    live read-only run  →  exit 0; renders "Base-merge necessity (#1881)" with strict=false
    

    Files touched (this workspace, not yet pushed)

    Notes

    • No workflow permission change needed — the ruleset read uses the existing contents: read
      on auto-rebase-health.yml; unreadable config degrades gracefully.
    • Follow-up (not this repo): land the necessity gate in auto-rebase-reusable.yml, promote
      the channel, then forward — after which AC feat: add Copilot engine support via REVIEW_ENGINE toggle #5's skippable count should fall to zero.
  4. don-petry commented on Sep 22, 2026

    @don-petry
    CollaboratorAuthor

    Dev-Lead: Implementation Complete — PR #1887

    The implementation for issue #1881 is durable: commits are pushed and a pull request is open. This record is backed by verifiable artifacts you can confirm in one click.

    Review happens on the PR. Acceptance criteria and test results are evidenced by the PR's diff and CI checks — not asserted here. If a later stage fails, this claim is retracted in place.

  5. added a commit that references this issue on Oct 2, 2026
  6. don-petry commented on Oct 9, 2026

    @don-petry
    CollaboratorAuthor

    Status 2026-10-09: PR 1887 (merged) added only the measurement counter (scripts/auto_rebase_health.sh). The actual gate, which is this issue's AC 1, 2 and 5, belongs in the central auto-rebase-reusable.yml and was not tracked anywhere in the public repo. It is now tracked as combsmith/.github#1272 (generic, since that repo is public). This issue stays open until that gate has landed and been promoted, and the base-merge-only share measured by the counter has fallen. Note PRs here still receive 'Merge branch main' commits today (for example on two open dev-lead PRs this afternoon), so the producer is still live.

  7. don-petry commented on Oct 9, 2026

    @don-petry
    CollaboratorAuthor

    Correction 2026-10-09, now that the merge queue is enabled (see #1864): disabling auto-rebase outright is NOT safe. Two dependencies found. (1) scripts/dev-lead-intent.sh treats a comment containing '<!-- auto-rebase-conflict:' as its highest-priority event and starts the automatic conflict-resolution (rebase) run, so auto-rebase's failed update attempt is the only thing that detects a conflicting PR and triggers recovery; disabling it would leave DIRTY PRs unrecovered. (2) scripts/dev-lead-fix-issue.sh pre-applies the auto-rebase:ready label to every PR it opens (to avoid the #711 deadlock), so a gate that treats that label as an explicit request would never skip an agent PR. The corrected design, tracked in combsmith/.github#1272: skip the push for cleanly mergeable PRs unless strict or a queue requires it, but keep detecting conflicts WITHOUT pushing and keep posting the exact same conflict notice once per base SHA; the pre-applied label alone no longer forces an update. This issue stays open until that has landed and been promoted.

  8. don-petry commented on Oct 11, 2026

    @don-petry
    CollaboratorAuthor

    The central gate is live here; first measured push

    The fix for this landed centrally as "auto-rebase updates every behind PR on every push even where being behind blocks nothing" (petry-projects/.github #1272, merged 2026-10-10 23:27 UTC as 98c8a23b). This repository pins auto-rebase/v2-next, and the scheduled cut moved that tag to 98c8a23b at about 23:47 UTC, so no change was needed in this repository.

    First push to main after the cut (4748e457, 2026-10-11 00:22 UTC), run 38098230072:

    Open PRs behind main 17
    Skipped at the gate (none applied (strict up-to-date not required)) 13
    Attempted because GitHub reports a merge conflict (so the conflict notice is posted; no commit can result) 4
    No-op base merges pushed to cleanly mergeable PRs 0

    For comparison, the last push before the cut (23:33 UTC, old tag) pushed a base merge to every PR that was behind.

    Against the criteria here:

    1. Met, with one deliberate difference recorded on the central issue: the only condition is the base branch's effective rules. Merge-queue membership, auto-merge and labels were dropped as conditions by maintainer decision, because 9 of 12 open PRs here had auto-merge on a queue-enabled base and would all still have been pushed to.
    2. Met: the policy is read from the rulesets and classic protection through the API. Re-arming strict restores the old behaviour with no code change.
    3. Met: conflicting PRs still take the existing conflict path, with the marker text pinned by a test.
    4. Met by the per-PR log line (updating branch [gate: …] or skipping update [gate: …]), which is what the table above counts.
    5. One of the three pushes measured so far. I will add the next two here and close this once no-op base merges stay at zero across all three.

    Removing the dev-lead label so no second implementation is started in this repository.

  9. don-petry commented on Oct 11, 2026

    @don-petry
    CollaboratorAuthor

    Criterion 5 measured: three pushes, zero no-op base merges

    Every push to main since the gate reached this repository's channel, counted from the per-PR log lines of each auto-rebase run:

    Push (UTC) Commit Run Skipped at the gate Conflict attempts No-op base merges to clean PRs
    00:22 4748e457 38098230072 13 4 0
    01:27 63c03b4f 38101878234 17 4 0
    01:55 a44bb9bb 38103456372 19 3 0

    49 updates that the old behaviour would have pushed were skipped; 11 attempts were made, all on PRs GitHub reports as conflicting (the existing conflict path, which cannot create a commit); none was a no-op base merge. No run fell back to "could not evaluate".

    All five criteria are met, with the one recorded difference from the wording of criterion 1 (the base branch's rules are the only condition; merge-queue membership, auto-merge and labels are not). Closing.

    Scope note: this repository has it because it pins the next channel of auto-rebase. The other consumer repositories get it as that channel promotes through its rings.

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