Skip to content

🐛 Base preparation re-refreshes the front while its CI runs and lets successors overtake it #19274

Closed

Description

@clubanderson

Problem

On repositories gated by auto_merge.require_current_base, the base preparation front is refreshed again and again:

  • The owner can be refreshed again while required CI on its previous bot refresh is still running. The new merge commit cancels that CI and pays for it again. Today the preparation front 🐛 fix: smuggling and header hygiene coverage for proxy relays #19228 was refreshed 5 times; two refreshes were 7 minutes apart.
  • A successor that is already current, green and reviewed may merge ahead of the owner ("ownership serializes refreshes, not ready merges"). When the owner has just turned green and reviewed on its refresh, that merge moves the base under it and sends it back for another refresh, CI run and review, so the front stays perpetually behind.

Context: over 48h on v5 there were 258 merges and 133 bot base refreshes; each refresh costs about 16 workflow runs and 38 runner-minutes.

Proposed fix

In automerge_base_preparation.go / automerge_preparation_readiness.go:

  1. Do not refresh the preparation owner again while required CI on its last bot refresh is still pending, unless the new base delta touches the PR's files or the previous refresh's CI already failed.
  2. Do not let a successor merge ahead of a preparation owner that is already green and reviewed on its current refresh.
  3. Bound both waits with a named max-wait constant so nothing stalls forever; any unreadable evidence keeps today's behavior.

Document in src/docs/hive-merge.md (preparation section).

Tests

  • no re-refresh while CI on the last refresh is pending
  • refresh allowed after that CI finishes (green or red) or when the base delta conflicts
  • green, reviewed owner is not overtaken
  • max-wait fallback for both

Activity

  1. self-assigned this
    on Nov 19, 2026
  2. clubanderson commented on Nov 19, 2026

    @clubanderson
    MemberAuthor

    Claiming this one; a PR is in progress.

  3. clubanderson commented on Nov 19, 2026

    @clubanderson
    MemberAuthor

    PR: #19275

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions