-
-
Notifications
You must be signed in to change notification settings - Fork 110
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
PR merge strategy for long-lived branches #641
Comments
I’d go for the “Create a merge commit” strategy. I’ve had the worst experiences of my life with Git and rebasing 😅 An extra commit is not a problem. |
Bot has the same limits as other users. So if certain strategy is not enabled, bot also cannot use it. So I don't think it is an option
This is risky (although probably checkable) as someone can rebase to master by mistake
I suggest we do this. And do not restrict if this is rebase or merge, more important to say !squash. |
Whats the think you don't like with enabling |
sorry? 😅 you mean enabling permanently or temporarily? as permanently my opinion is the same, no matter if rebase or merge commit |
Permanently. If we allow
|
|
Please no; don't activate the The best way is to do a On my side, i apply the Here is my Github Action pipeline that automatically merge
Yep @fmvilas a lot of people suffering with the rebase command but this is an amazing command when used correctly :) |
I agree. Also, the point is that only code owners will be able to merge with such alternative. In fact, squash is already available, and it does the same except that it unifies all commits of the PR into one.
The point is that conflicts may appear when keeping up that branch with master. We do have already an action that keeps a branch up-to-date if a PR exists with the label |
I edited the description of this issue to clarify the case of merging long-lived branches into |
This issue has been automatically marked as stale because it has not had recent activity 😴 It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation. There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model. Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here. Thank you for your patience ❤️ |
Lately, we have been following the strategy of enabling
|
This issue has been automatically marked as stale because it has not had recent activity 😴 It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation. There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model. Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here. Thank you for your patience ❤️ |
This issue has been automatically marked as stale because it has not had recent activity 😴 It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation. There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model. Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here. Thank you for your patience ❤️ |
This issue can be a source of knowledge for the work Maintainers Growth Working Group plans to do; documenting the onboarding of new maintainers. cc @AceTheCreator @alequetzalli @thulieblack @Mayaleeeee @smoya |
Reason/Context
It is a common operation for contributors to update branches bringing changes from that main (
master
) branch. More common for long-lived branches.For example, updating the
next-major
branch with the latestmaster
changes and creating then a PR with such an update.Also, to merge those long-lived branches back to
master
once the development is considered done.All repositories have only enabled the "Squash and merge" merge strategy, so no other can be chosen. See:
This works perfectly most of the time except for syncing branches, like the example above and for merging long-lived branches to
master
.When the PR is merged with the
Squash and merge
strategy, all those commits will be lost forever. That, applied to the previous example, means all the latest commits frommaster
will be lost in thenext-major
branch.That translates into losing history of commits:
master
, means all commits pushed to the long-lived branch will be lost, and the code will be re-authored by the creator of the PR that merges it intomaster
.master
into the long-lived branch, since commits are also lost, diff between those branches will persist (in terms of commits. The code is the same). That also creates a problem in our CI since in practice, your branch is not up to date, and GH will keep showing you your branch is out of date.Description
To make it work, the
Squash and merge
strategy should not be used for long-lived branches. Instead, theRebase and merge
strategy is preferred. As an alternative,Create a merge commit
(but this adds an extra commit).Currently, there is no simple mechanism to do that, as only the
Squash and merge
strategy is allowed. Code owners need to temporarily enable the alternative strategy via repository settings, manually merge the PR, and then revert the config change. See:@asyncapi-bot has a feature to let a PR to keep up with changes in the target branch. However, this will stop working whenever conflicts appear. If those get fixed in a new PR, the same issue will happen with the merge strategy.
Solution
I guess there can be several solutions but the ones I see now are:
Rebase and merge
strategy for all repos./rtm
but with the alternative merge strategy. Maybe we can even use the same and add an argument to it. I.e./rtm rebase
or similar. Not sure if this is possible (how to detect the intention of the PR in a generic way?), but maybe the bot could also write a comment saying "Remember to merge withRebase and merge
by/rtm rebase
".Relates to
cc @jonaslagoni @derberg @fmvilas @dalelane @M3lkior
The text was updated successfully, but these errors were encountered: