Repository navigation
ci: merge a regen PR that fell behind its base during the merge wait - #164
Merged
Merged
Conversation
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.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 209200e. Configure here.
… 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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
land()waits, it checks whether the PR fell behind its base. If so, it takes in the base withgh pr update-branch, as the start of a run already did for a PR labelledsdk-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.catchup()function used by both places. A base that does not merge cleanly still goes to a human.How to verify
regen/autoand exits without a heads-up. The checks rerun on the new head, and the run started when its Regen integration completes merges the PR.Note
Medium Risk
Changes auto-merge timing in production CI; behavior is scoped to the regen bot workflow but affects when PRs merge without human intervention.
Overview
When a regen PR sits in
land()’s merge wait and another PR lands on the default branch, the workflow now detects that the branch is behind base (compare/behind_by), runscatchup()(gh pr update-branchplus waiting for the new head), and exits so checks rerun and a later Regen integration run can merge.The same catchup path is factored into a shared
catchup()function, replacing the duplicated inline logic that only ran for PRs labeledsdk-not-breaking. Merge conflicts on update still route to a human.Reviewed by Cursor Bugbot for commit 7a1dc42. Bugbot is set up for automated code reviews on this repo. Configure here.