-
-
Notifications
You must be signed in to change notification settings - Fork 300
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
Enforce Conventional Commits #1773
Comments
In meetings it was agreed to not enforce at the commit level. Maybe at the PR title level (see #1812), but with our regular bi-weekly release schedule and not yet following semver's breaking policy it's not necessary |
Reopened based on our Standup call from March 28. We would like to have better and more human-readable updates to our releases. A manual release summary and enforcing conventional commits on our monorepo should better organize our changelog and make it more useful for users. We should:
Quick examples
Commit types
More information on the spec here: https://www.conventionalcommits.org/en/v1.0.0/#specification |
Thanks for reopening this @philknows ! It will really help with standardizing our changes. A few points:
We can setup a husky pre-commit hook to enforce this once we agree upon it. |
Just using As for production dependencies, I would just use
Would not enforce this on commit level, we anyhow squash-merge. Need to enforce it on PR title which is also great because it gives contributors more freedom + git hooks are kinda annoying |
This is outlined in the spec I was not suggesting that we solely use the
That's why I included it in my example.
Give an example of this. A fix that is related to a bug rather an improvement could be classified as a
As @philknows suggested we would have a Github action to enforce it in the PR title, but enforcing it at the commit level is actually to assist in the PR review process, particularly when reviewing larger PRs, having a good commit etiquette can help people to review PRs faster. I agree it may be a deterrent for new contributors though so perhaps it can be optional, it would certainly be beneficial for maintainers though. |
I like to think about conventional commits in combination with semantic versioning which makes it easier to reason about
Based on this, let's just think about a change in isolation, if there was only one commit, what kind of release should it trigger if at all. This eliminates Now we can of course re-write the rules or add our own rules that fit the project better but I would suggest sticking as close to the standard as possible.
Then there won't be a lot of
Sure, these are few of the recent commits which are not a bug fix but should be of type
In theory I would agree but you can do good commits without following conventional commits and you can do bad commits even when following it. I would prefer to keep a feature branch more like a "playground" with loose restrictions.
sounds like the ideal solution to me, we get the benefits from using conventional commits without introducing too much overhead |
I think there was a grammatical error here that caused confusion, it should say A fix that is NOT related to a bug BUT rather an improvement could be classified as a refactor or perf so I think fix relating specifically to bugs is appropriate.
A changelog should contain all changes in order to provide visibility and improvements of a codebase (not just to users but also other developers and potential contributors), that would include refactors, CI changes, documentation changes etc. In the case of a refactor or a series of refactors, we probably would not do a release, but that is independent of what should be included in the changelog. In practice it is common to have multiple commits before a release and so whether we are doing a patch, minor or major release will be dependent on bug fixes, features, performance improvements and reverts and the refactors would more than likely be included alongside those changes.
I don't see this as a problem. I agree in that we would not want to have a lot of bug fixes but there is a possibility at some points we may. I agree that
All of the listed examples can be articulated as bug fixes or performance improvements (I wouldn't have labelled them refactors so I don't think it's a relevant example) since they are behaviours that were unintended but are now changed, or are improvements in the performance of the software, and so in those cases would trigger a release.
The rationale behind conventional commits is standardize commits so that we have good commits and to reduce the possibility of a bad commit. We agree on what those standards are and therefore determine what is bad and good. |
Well I guess we just disagree on what a changelog is supposed to do and who the audience should be. IMO it is for consumers of the software and not developers of the software. Therefore adding things not relevant to a consumer is just noise. I have used semantic-release for few years and have been involved in that ecosystem for quite a while, so I have rather strong opinions here, let's get input from others, will not come to a consent on this :)
Hard to define objective rules on how to classify
Happy to disagree here as well, I guess we just have different definitions of what a "bug" is, see other comment on how I define it, pretty much like here.
Just because you tell developers to prefix their commits with |
I think you are conflating release notes with a changelog - (which is understandable as they have been used interchangeably in some cases) If you examine Google's release-please - which we could actually use to automate changelog generation and release version bumps if we do decide to use Conventional Commit messages and Semantic versioning - there are changelogs which include refactors and build system changes for instance, so I am not sure if the idea that they should be excluded from changelogs is industry standard.
The definition that you posted here (which I also had used to derive my own explanation) states: A software bug is an error, flaw or fault in the design, development, or operation of computer software that causes it to produce an incorrect or unexpected result, or to behave in unintended ways. which was the explanation I had given in stating the following:
so I would say those examples can be articulated as bugs or performance improvements, regardless they should be in a changelog and potential triggers for release.
The reason behind us standardizing commits is to determine which commits are good as right now there is no codified consensus within the team on what a good commit is. I am not implying that there will not be bad commits, but rather we are reducing that possibility by standardization. If there is more leniency in commit etiquette then there a greater variance in commit standards and subsequently a greater possibility of bad commits. That doesn't mean we have to enforce commit hooks for instance, but we have to be open to the opportunity cost of not doing so. |
Yall are covering a lot of ground here XD... will throw in my thoughts:
Hoping that by using conventional commit PR titles, it will get us more comfortable with conventional commits in general, give us more tools for organizing our releases, and act as a foundation for future release process changes, if / when we need / want to change. |
RE @maschad
Like I said before my opinions are shaped by semantic-release, whether or not this can be considered an industry standard, I leave up for you to decide
I don't care what name we use for it, I just care how we can improve what we output here https://github.com/ChainSafe/lodestar/releases (or in a
the commit RE @wemeetagain
definitely, was just giving a theoretical example how conv commit are often used for clarification
Maybe if we have different sections in the changelog this will be bearable and people will dare to read the changelog. Technically, this also easy to realize because we basically only need conv commits to generate release notes, could just use https://github.com/semantic-release/release-notes-generator out of the box and define our own |
semantic release is intended to generate release notes as it states in it's description, which is distinct from the changelog.
We intentionally make a distinction between the two, as demonstrated in our last release as @wemeetagain mentioned the release notes help the consumers see what is relevant to them.
And one could make an argument that the way it ought to have worked in the first place was to have been less noisy and thus it was a UX/DX bug fix, regardless this is an unnecessary point to dwell on and has been discussed ad nauseam I think we can agree that bug fixes and features should be highlighted in release notes. |
agreed
I think @wemeetagain meant both the title/introducing aka lodestar-announcement done by @philknows + the Changelog (to be generated from conv commits) should be tailored towards consumers. Nothing further to add, like I said just care about final/combined result of https://github.com/ChainSafe/lodestar/releases
I leave it at that |
Regarding the tooling, even though we could use semantic-release with just the release notes/changelog generator to generate the Changelog, it seems suboptimal to me as customization is not as easy. Something like standard-version (or even conventional-changelog) seems to do just what we require and is much leaner. However, there is a deprecation warning and the author suggests to use release-please which @maschad also mentioned already, seems straight forward to customize as well. |
It was a bit hard to read the output for semantic-release if I'll be honest (was part of the rush.js monorepo tool used in prior project). It also kinda just gave what it gave when we played with making the output better. I def agree that |
Closed via #5342 |
There are some possible benefits to using/enforcing conventional commits. Pls discuss
Github action to enforce?
The text was updated successfully, but these errors were encountered: