-
Notifications
You must be signed in to change notification settings - Fork 246
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
Change default action to squash merge in cmssw repo. #2080
Comments
A new Issue was created by @antoniovilela . @Dr15Jones, @rappoccio, @smuzaffar, @makortel, @sextonkennedy, @antoniovilela can you please review it and eventually sign/assign? Thanks. cms-bot commands are listed here |
I don't think an agreement was reached (the topic was merely touched last week), and personally in many cases I want to preserve the commit history. (although I agree in many cases the commits can be squashed). |
Let's maybe discuss first what is needed in order for us to use the "Squash and merge" option? @smuzaffar |
I strongly disagree with this. I personally am very careful about creating commits with meaningful comments to help understand why code was changed. Squashing them all would make using git history far less useful. |
There are three ways one can merge the PR
I prefer to keep using the option 1. Option 2 loses all the commit history and option 3 (though keeps the commits) but it can build inconsistant IBs. |
I think we'd need to understand better the motivation(s) behind the proposal. Maybe there could be a different path forward to improve things? |
Do I understand correctly that if one does a Squash and merge the PR will not show up in the IB page. Is there a way around this? |
@antoniovilela, I agree with @makortel. Lets first understand the motivation(s) behind the proposal |
also note that with Squash and merge, we not only lose the history of commit but also the lose the history who to blame for the code. I did a give test PR where multiple developers provided changes but the blame only shows the user who actually open the PR. Also the actual committer loses the credit of the commit too. |
Here are some further downsides on "Squash and merge" model
Written that, I share the feeling that many PRs could probably be squashed into one commit without any of the downsides mentioned so far. I believe it would be possible to find a solution that balances the different aspects (and for that we need better understanding first). |
assign core, orp Let's include @cms-sw/all-l2 for more feedback. |
New categories assigned: core,orp @Dr15Jones,@makortel,@rappoccio,@antoniovilela,@smuzaffar,@sextonkennedy you have been requested to review this Pull request/Issue and eventually sign? Thanks |
I think the ability to do squashing w/o having to ask the developers is a welcomed addition. My main argument for asking for squashing from the developers was that when one looks at the diff between releases on github (e.g. cms-sw/cmssw@CMSSW_10_6_28...CMSSW_10_6_30) that shows the commit differences, and not the PR differences. So having one commit per PR will make that much more cleaner. Of course well constructed commits are good for this too, but many many times we have "fix", "fix typo", "code checks", "answer to reviewers", "code checks again" as commit msgs, that's when the squashing from the reviewers/orp would be nice IMO. |
Doesn't the squashed commit list all the |
Having worked with non-CMS repositories that enforce a linear history (like llvm) I noticed that they are a lot easier to browse and follow. Compare
with
|
Many thanks, it is very good to hear from @cms-sw/all-l2 |
yes the squashed commit message contains the co-author but does not contain the information about who change which part of the code e.g. 7819e3c is a squashed commit and the actual changed code does tell who change what. So you can not properly blame the right author :-) |
I still feel that in most cases, squashing into a single commit would be the better option. Could we add a "squash flag", different L2s could add it to flag the PR to be squashed, without needing to ask authors and delaying the approval, and release managers would then use Squash and merge for these PRs. On a different note, do we already have regular training sessions on project collaboration with Git? This might be a more important outcome of this discussion. |
As past release manager, I would have really liked the possibility to have a "squash" button, that just squashes the commits, without merging them. I would have used it in those (few) cases where the authors ended up with tens of useless commits, and were not able, or did not want, to squash them themselves. I would say that the release manager should use it only in particular cases, and with the agreement of the authors and the reviewers of the PR. Then the squashed commit(s) could be merged as usual in the next step, without renouncing to the merge commit. |
This is not a workflow that GitHub supports (squash, then merge). Also, what is the advantage of keeping the merge commits ? |
Hi all,
Just to give a small anecdote and a mixed opinion on this proposal. I recently implemented a runTheMatrix workflow which got squashed into someone else’s commit. That other person did the main development but needed help on runTheMatrix because they didn’t have experience with the runTheMatrix code. Now, this other person is the one who receives messages on how to use this workflow (which incidentally has a fairly large “consumer base”) and needs to forward questions to me about using it. It may help to avoid such confusions if the blame accurately reflects who introduced which feature.
Would it be possible to squash commits on the basis of committer, so as to keep the blame consistent, while reducing the number of individual commits on a single-user basis?
However, I do feel that it is important to be able to squash things because having to look at 10 different commits to track down what happened in particularly troublesome PRs can be really time-consuming and annoying.
|
To have them listed in the IBs, as well as in the release notes |
If all PRs were squashed instead of merged, the IBs and release notes could simply list all commits. And we could make the bot use a standardised format for the squashed commit message, like
|
Maybe post a recipe somewhere how to squash with leaving just a (new) single commit message... |
This exists, people just usually dont do it (and they have to be pushed which then makes the review process longer) |
Well yes I can google it and lots of different recipes come up, interactive work needed, editing a file, blah blah.... lots of work. We have cms specific git commands like git cms-addpkg, so I propose one makes a cms-squash command which assumes all commites in a repo (from which the PR is generated) to be quashed. This is listed together with the bot commands when a PR is made, so that proponents of PRs can choose to apply this easy recipe (similar to code formatting) and know what to do and do not need to search for it. (IOW, make it easy for non git experts). |
Yes, that's a reasonable request. I think the most complicated part in writing such tool is how to figure out what is the "starting point" to use for the squash. A possibility could be to use the commit corresponding to the release itself, i.e. if one is working in |
@makortel |
I'd suggest we discuss this topic in the core software meeting next week (as a first topic, so should have minimal impact to ORP attendees that want to participate but not follow full core software meeting). |
Outcome of the discussion in the core software meeting
|
see cms-sw/cms-git-tools#125 for cms-squash-topic |
Hi all,
Sorry to be a wet blanket on this very important development (and I totally support making improvements to the current situation) but---
I am still worried about the fact that contributors to CMSSW will get their contributions “erased” from history due to indiscriminate squashes.
There are many contributors to CMSSW already whose contributions are lost to the winds of time due to their contributions being incorporated “silently”. And these folks who contributed are really hard to dig out and to send emails to even though their input might be forthcoming but nobody can find them because their contributions are erased from history.
I really think it is important not to “squash” away contributors to CMSSW. But that is what you all have seemed to have agreed on. Please look at my earlier post here to reconsider this decision.
Best,
John
…________________________________
From: Matti Kortelainen ***@***.***>
Sent: Tuesday, October 10, 2023 5:59:23 PM
To: cms-sw/cms-bot ***@***.***>
Cc: Hakala, John Charles (jh7uq) ***@***.***>; Team mention ***@***.***>
Subject: Re: [cms-sw/cms-bot] Change default action to squash merge in cmssw repo. (Issue #2080)
Outcome of the discussion in the core software meeting
* we want to stay with the current merging strategy
* we will provide an easy-to-use command for developers to squash the commits in their branch (as suggested in #2080 (comment)<#2080 (comment)>, #2080 (comment)<#2080 (comment)>)
* we will improve cms-bot messages and documentation to point to the exact command to do the squash
* we will improve cms-bot to detect (earlier) big and/or binary file
* we will improve cms-bot to detect when the contents were not changed, and to not request new signatures if the PR's diff didn't change
* we will also look into making cms-bot to not require a new signature of a package A, when that package A was not touched in an update of the PR
—
Reply to this email directly, view it on GitHub<#2080 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AB6MZFSR3TAH6Y4NWXD2OHLX6VWFXAVCNFSM6AAAAAA5H345E6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJVG42DQMBTGQ>.
You are receiving this because you are on a team that was mentioned.Message ID: ***@***.***>
|
But @jhakala if the user does the above introduced |
@kpedro88 What does the |
As a side comment I'd find the model of directly approaching only the committer of a particular change and not including the assigned maintainers (that would be PdmV in case of |
@makortel to test this, I picked a random recent PR branch and added my own trivial commit to it.
In 3. the commit author is me, with the original commit authors listed in the combined commit message. In 4. the author of the first commit is preserved, with me as the committer. This is slightly better, but doesn't scale beyond 2 people (author and committer fields can be different, but each one can only have one value). GitHub and GitLab support a co-author standard described here: https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors. With a modified version of However, if This can be addressed with a further modification (at the cost of a bit of redundancy): cms-sw/cms-git-tools#125 is updated with the changes. |
@jhakala I hope #2080 (comment) addresses your concern more directly. The issues you raised were actually the subject of a long discussion in the core software meeting on Tuesday, and generally there was agreement that we want to attribute changes properly. That led to the plan in #2080 (comment) to provide a tool whose use can be requested at the discretion of the release manager (or for other purposes for which it might be convenient). |
Also, it would be really helpful if people opened pull requests with a
useful commit history and meaningful messages.
.A
|
Thanks Kevin,
This does address all my concerns and I appreciate your work on them.
Best,
John
…________________________________
From: Kevin Pedro ***@***.***>
Sent: Friday, October 13, 2023 1:06:41 PM
To: cms-sw/cms-bot ***@***.***>
Cc: Hakala, John Charles (jh7uq) ***@***.***>; Mention ***@***.***>
Subject: Re: [cms-sw/cms-bot] Change default action to squash merge in cmssw repo. (Issue #2080)
@jhakala<https://github.com/jhakala> I hope #2080 (comment)<#2080 (comment)> addresses your concern more directly.
The issues you raised were actually the subject of a long discussion in the core software meeting on Tuesday, and generally there was agreement that we want to attribute changes properly. That led to the plan in #2080 (comment)<#2080 (comment)> to provide a tool whose use can be requested at the discretion of the release manager (or for other purposes for which it might be convenient).
—
Reply to this email directly, view it on GitHub<#2080 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AB6MZFWE3TM4CKFXRRGFKQDX7EOEDAVCNFSM6AAAAAA5H345E6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRRGMZTCOJZHE>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Hi Kevin, all, belated thanks! Let's continue to follow up on the list in #2080 (comment), namely pointing to the squash command in cms-bot messages; check if there is no diff in the PR and if so not reset the tests & signatures; more generally, not reset signatures related to a given package that was not updated in a new commit in the PR. Thanks again. |
FYI, bot PR #2144 should allow to squash a cmssw PR without resetting the L2's signatures. As squashed creates a new commit so the PR checks will be reset but bot will re-run the code-checks and PR tests automatically. |
Fantastic! |
@antoniovilela , can we close this issue now? |
Yes, I think so. |
As discussed in the ORP meeting (2023-SEP-19), managers and users agree to squash commits when merging to master. This issue is to follow-up on what is needed in cms-bot.
The text was updated successfully, but these errors were encountered: