Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple pull request overlap - not able to rebase #65

Open
maggie44 opened this issue Nov 23, 2021 · 6 comments
Open

Multiple pull request overlap - not able to rebase #65

maggie44 opened this issue Nov 23, 2021 · 6 comments

Comments

@maggie44
Copy link
Contributor

maggie44 commented Nov 23, 2021

What is the behaviour when there are multiple pull requests merged and rebased? It seems the current behaviour is to not record other commits in the finalised version. For example:

  • Open pull request 1
  • Open pull request 2
  • Merge with rebase pull request 2
  • Pull request 1 does not have the merged changes of pull request 2 in it as they were added after the pull request 1 branch was created
  • Merge with rebase pull request 1, which triggers Balena Cloud to mark the build made from pull request 1 as final
  • Latest version now doesn't contain changes from pull request 2.

If the branch merged to is not the same as the one previous committed, it should probably to a rebuild rather than mark as final?

@20k-ultra
Copy link
Contributor

Hey, I might be misunderstanding but if you merged PR 2 to master then you cannot merge PR 1 unless you update it with master.

After you update PR 1 with master you'll now have PR 2 changes. This update (PR sync) triggers another build.

Are any of the things I just said incorrect for your situation ? Do you have any repositories I could see that have the git workflow you just described ?

@maggie44
Copy link
Contributor Author

maggie44 commented Nov 30, 2021

Hey, I might be misunderstanding but if you merged PR 2 to master then you cannot merge PR 1 unless you update it with master.

Not really sure what you mean here. As long as the two branches do not have any merge conflicts, then you can merge them without first having to update either of the PRs with the contents of the other and this is a fairly standard workflow I believe.

In a pull request, you propose that changes you've made on a head branch should be merged into a base branch. By default, any pull request can be merged at any time, unless the head branch is in conflict with the base branch.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/merging-a-pull-request

@maggie44
Copy link
Contributor Author

maggie44 commented Nov 30, 2021

  • Merge with rebase pull request 2

Yes, that is what I mean by merge with rebase, but I can see that it isn't very clear in my post.

@20k-ultra
Copy link
Contributor

hey @Maggie0002 just wanted to confirm I didn't consider the merge with rebase workflow so I'll have to see what events this triggers. In the meantime I'd suggest you rebase your PRs then merge in another step.

@maggie44
Copy link
Contributor Author

As a quick update for others to reference, I enabled the Require branches to be up to date before merging protection rule to ensure that each pull request is always pushing the latest code and not reverting back to an old version stored in the pull request.

It's not the solution in terms of the action, just logging it here as a useful protection mechanism for people to use in the meantime to avoid encountering the issue.

@maggie44 maggie44 changed the title Multiple pull request overlap Multiple pull request overlap - not able to rebase Jan 2, 2023
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

No branches or pull requests

2 participants