-
Notifications
You must be signed in to change notification settings - Fork 961
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
Decision required: Change commit messages to "conventional commits" #3054
Comments
I am in favor of this. I would like to continue putting the path (i.e. in conventional commit terminology it is scope) into the commit message, e.g. |
At least Is there much value in adding the scope? It often takes up a significant portion of the commit message title, which makes it hard to keep under 50 characters (that is the recommended length). Can we loosen this to a "we MAY add the scope"? I'd personally prefer not to, esp. when multiple things are being touched. GitHub's file free makes it quite to see what is being touched and I am sure there are funky Git one-liners too! |
👍 In favor of conventional commit messages.
Agreed. I stopped used full paths because of those reasons. In favor of optional scopes where it makes sense. |
Thanks everyone, I'll consider this change to be approved unless someone objects by Friday, Nov 11th. |
No objections on my end.
I suggest updating https://github.com/libp2p/rust-libp2p/blob/master/docs/coding-guidelines.md accordingly and consider this the new convention once merged.
It does help me to quickly understand the context of a pull request. A couple of examples:
Sounds like a good middle ground. |
Where in that document would you like to see this documented? I was thinking of enforcing this via mergify: #3083 |
With #3083 I don't think we need any documentation. Thanks for doing both of these. |
with #3165 should we re-think adding documentation? |
I'd suggest to use GitHub actions instead. There should be plenty of them out there that either directly validate conventional commits or let you define a regex for the title. Worst case we use bash :) |
I'd like to propose to change our commit message convention to "conventional commits": https://www.conventionalcommits.org/en/v1.0.0/
The main driver for this is automation in the form of automated changelogs and automated version bumps. See #2902.
In particular, tools like https://github.com/googleapis/release-please can do this but there are many others and I'd like to make this decision independent of which tool we are going to use.
At the moment, the convention for our commit messages is:
With conventional commits, we would change this to:
feat
,fix
,chore
,test
etcSee some examples here: https://www.conventionalcommits.org/en/v1.0.0/#examples
I benefits I see are pretty much the ones mentioned in the specification: https://www.conventionalcommits.org/en/v1.0.0/#why-use-conventional-commits
Something that works really well with our current workflow is the squash-merging. It means we don't have to educate users in how to write commit messages but just edit the titles of their PRs to match our conventions. That is not very hard and something one of us can do as we review it. The only important bit is that we need to review that title (and whether the change is breaking) before merging. I'd suggest we use the
!
instead ofBREAKING CHANGE
to identify those.There are also some downsides to conventional commits:
There is an argument that changelogs should be written manually and not auto-generated. The argument is mostly that changelogs are for humans and thus should be written with priority and clarity in mind, something that is hard to do in an automated fashion. There is more criticism here: https://common-changelog.org/#42-conventional-commits
I think the provided criticism is somewhat valid but can also be dealt with:
release-please
differentiates between e.g. betweenchore
andfeat
commits.chore
PRs will not show up in the changelog. This avoids the "noise" problem.@mxinden @jxs @elenaf9 Please voice your opinion on this topic here :)
The text was updated successfully, but these errors were encountered: