-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
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:
- A prefix, which modules the PR touches (PR == commit message for us because we squash-merge PRs)
- A short description on what the PR does
With conventional commits, we would change this to:
- A prefix indicating the kind of change, e.g.
feat
,fix
,chore
,test
etc - A short description on what the PR does
See 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 of BREAKING 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:
- Our mapping of changelog entry to PR is already 1-to-1.
release-please
differentiates between e.g. betweenchore
andfeat
commits.chore
PRs will not show up in the changelog. This avoids the "noise" problem.- We can always manually sort the changelog after a release by priority.
- We already do and should continue to write PR titles really descriptive and in imperative form.
@mxinden @jxs @elenaf9 Please voice your opinion on this topic here :)