Skip to content

ci: merge a regen PR that fell behind its base during the merge wait - #121

Merged
mogita merged 2 commits into
masterfrom
fix/regen-catch-up-behind-base
Nov 27, 2026
Merged

mogita merged 2 commits into
masterfrom
fix/regen-catch-up-behind-base

Conversation

@mogita

@mogita mogita commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

The default branch requires a PR to be up to date before it merges. When another PR merges while a regen PR waits for its checks, the regen PR falls behind, and every merge the bot tries is refused until the 45-minute wait runs out and a human is pinged, although every check is green. GetStream/stream-py#363 hit this on 2026-11-27.

Solution

  • While land() waits, it checks whether the PR fell behind its base. If so, it takes in the base with gh pr update-branch, as the start of a run already did for a PR labelled sdk-not-breaking, and exits. The checks start over on the new head, and the run that its Regen integration starts on completion merges it, with a full wait of its own.
  • That update moves into a catchup() function used by both places. A base that does not merge cleanly still goes to a human.

How to verify

  1. While a regen PR waits for its checks, merge another PR into the default branch.
  2. The Regenerate run merges the base into regen/auto and exits without a heads-up. The checks rerun on the new head, and the run started when its Regen integration completes merges the PR.

The default branch requires an up-to-date PR, so a PR merged during the 45-minute wait left the regen PR unmergeable until the wait ran out. The wait now takes in the base, as the start of a run already does for a labelled PR, and keeps waiting on the new head.
… starts

Its checks start over on the new head, so waiting out the rest of this run's 45 minutes often ended in a human ping. The run that the new head's Regen integration starts on completion merges it, with a full wait of its own.
@mogita
mogita merged commit 9a26043 into master Nov 27, 2026
12 checks passed
@mogita
mogita deleted the fix/regen-catch-up-behind-base branch November 27, 2026 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant