Merge commits can be created as part of mirror syncing which breaks CLA bots
Describe the bug
In cases where commits are added to a feature branch that private mirrors syncs to outside of syncing (update branch with latest), a subsequent sync will create a merge commit which adds private mirrors as a commit author and can cause CLA bots to break on repos that have them. These commits then may not be able to be removed by the contributor if they are limited to contributing through private mirrors causing their PR to be blocked.
To Reproduce
- Contribute through private-mirrors and create a pull request to a Source repo
- The Source repo has updates merged to the PR's destination branch
- Use the "Update Branch" button on the PR to rebase the feature branch with the latest changes
- Contribute additional changes through private-mirrors to the same pull request feature branch (using the same private mirror)
Expected behavior
The project should avoid creating merge commits when situations like this arise in favor of rebasing the new commits onto the sync destination feature branch.
Screenshots
Additional context
This issue will need to be fixed in src/server/git/controller.ts/syncReposHandler which should be updated to rebase instead of merge. The solution should handle a possible case where the feature branch doesn’t exist by just pushing the commits to that branch location. It should also determine the best way to gracefully handle rebase errors that may occur and present them to the user in some manner.
@riley-kohler it looks like this sentence got cut off midway through, maybe a copy-pasta problem?
In cases where users are working on a pull request and their target branch becomes out of date, they can use the Update Branch button to bring new commits into their feature branch. Once this has been
Thanks for catching that, I ended up rewording it in the first paragraph and that was leftover.
This is one of a few issues that our team will be creating over the next little bit as we figure out what we need to fix/add before we can fully launch our process with private-mirrors. We should have a better sense of a roadmap of when we can get these issues completed soon and we'll be sure to keep y'all in the loop to make sure we're in alignment.