merge-bot icon indicating copy to clipboard operation
merge-bot copied to clipboard

Allow merges even if the base branch changes

Open RevolutionTech opened this issue 4 years ago • 2 comments

Is your feature request related to a problem? Please describe. I am using merge-bot to merge Dependabot pull requests and often I want to mark several of them as ready simultaneously. Unfortunately, labeling multiple PRs as ready at the same time results in the first one succeeding and the remaining ones failing because of the changes to the base branch. I have tried the turnstyle Github Action to avoid concurrent workflows but that doesn't seem to matter so I'm guessing that the base branch for the merge is determined before the merge-bot action runs.

Describe the solution you'd like Ideally, merge-bot would be able to execute a merge of the PR even if the base branch changes since the workflow was kicked off. Perhaps this should be an option that needs to be enabled since some users might prefer that the merge fails if the base changes since the PR was marked as ready.

Describe alternatives you've considered One way to avoid my problem above is to mark PRs as ready one-at-a-time and wait some time between each label, but then the amount of manual effort required to merge each PR begins to approach where I was when I merged each PR manually anyways.

Additional context Here is an example of me running into this issue: Successful merge: Link Failing merges (at the same time as the successful merge above): Link 1 Link 2

RevolutionTech avatar Apr 28 '21 05:04 RevolutionTech

This is an interesting problem... I am doing some research into how this may be handled.

Only thing I can think of is if the merge fails for a Status: 409 Conflict maybe start the process over (need to refresh pull data including sha). I could also add a random "sleep" for the retries so any trying to run in parallel could be offset.

Haven't looked into this too much, but do you think that approach could solve your problem?

squalrus avatar May 01 '21 21:05 squalrus

Yeah, I think those approaches (especially in concert) could solve my problem!

Before I made this issue I was actually trying to figure out if I could do something similar with Github Actions, but sadly I think Actions don't yet support "retry step on failure" flow control. I guess maybe that wouldn't have worked anyway since to your point the pull data would have to be refreshed as part of the retry.

Thank you for the consideration!

RevolutionTech avatar May 02 '21 20:05 RevolutionTech