ejoffe / spr

Stacked Pull Requests on GitHub
MIT License
796 stars 68 forks source link

Merge Queue strategy produces error if multiple merged at same #317

Closed jameskyle closed 1 year ago

jameskyle commented 1 year ago

If you have a stack with multiple ready to merge commits:

❯ git spr status
> git rev-parse --show-toplevel
> github fetch pull requests
> git branch --no-color
> git branch --no-color
> git log --format=medium --no-color origin/develop..HEAD
> git branch --no-color

 ┌─ github checks pass
 │ ┌── pull request approved
 │ │ ┌─── no merge conflicts
 │ │ │ ┌──── stack check
 │ │ │ │
[✅✅✅✅] https://github.com/SafeGraphInc/galaxy/pull/6422 : EF-571: Don't create requests for invalid endpoint #ci
[✅✅✅✅] https://github.com/SafeGraphInc/galaxy/pull/6421 : EF-569: API for triggering endpoint audits #ci
[✅✅✅✅] https://github.com/SafeGraphInc/galaxy/pull/6419 : EF-552: Auditing Endpoint #ci

And merge them all at the same time

git spr merge

SPR throws an error on the last stack.

 git spr merge
> git rev-parse --show-toplevel
> github fetch pull requests
> git branch --no-color
> git branch --no-color
> git log --format=medium --no-color origin/develop..HEAD
> git branch --no-color
> github update 6422 : EF-571: Don't create requests for invalid endpoint #ci
> git branch --no-color
> github merge 6422 : EF-571: Don't create requests for invalid endpoint #ci
> github add comment 6419 : EF-552: Auditing Endpoint #ci
> github close 6419 : EF-552: Auditing Endpoint #ci
> github add comment 6421 : EF-569: API for triggering endpoint audits #ci
> github close 6421 : EF-569: API for triggering endpoint audits #ci
MERGED https://github.com/SafeGraphInc/galaxy/pull/6419 : EF-552: Auditing Endpoint #ci
MERGED https://github.com/SafeGraphInc/galaxy/pull/6421 : EF-569: API for triggering endpoint audits #ci
MERGED https://github.com/SafeGraphInc/galaxy/pull/6422 : EF-571: Don't create requests for invalid endpoint #ci
> git fetch
> git branch --no-color
> git rebase origin/develop --autostash
> github fetch pull requests
> git branch --no-color
> git branch --no-color
> git log --format=medium --no-color origin/develop..HEAD
> git branch --no-color
> git branch --no-color
> git log --format=medium --no-color origin/develop..HEAD
> github update 6422 : EF-571: Don't create requests for invalid endpoint #ci
> git branch --no-color
3:08PM FTL ../../../runner/work/spr/spr/github/githubclient/client.go:543 > pull request update failed error="updatePullRequest: Cannot change the base branch because the branch has been added to a merge queue.\n" id=PR_kwDOBV0xv85PaWhL number=6422 title="EF-571: Don't create requests for invalid endpoint #ci"

The final PR is targeting the develop branch and has been added to the merge queue.

ejoffe commented 1 year ago

full merge queue support is now available starting v0.14.0