-
Notifications
You must be signed in to change notification settings - Fork 1.4k
doc: Update the CONTRIBUTING.md to follow Conventional Commits #16823
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
base: master
Are you sure you want to change the base?
Conversation
|
cederom
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also need "!" mark before ":" in the git commit topic for breaking changes as stated by [1]. Otherwise we are hiding breaking changes and this is not the goal, these should be clearly visible.
@cederom the issues are those I submitted to the mailing list:
It is not mandatory: please see items 12 and 13 of specification. If "!" is included in the commit title the "BREAKING CHANGE: " in the foot are not required. Just it! :-) |
I am for placing both "!:" in the git commit title and "BREAKING CHANGE" mark in the git commit body. "!:" is not self-explanatory, but if someone sees two git commits in the logs with both "!:" and "BREAKING CHANGE" they will quickly associate. We cannot hide breaking changes, these must be clearly exposed and easy to find. People with broken code will search for 1. git log, 2. changelog based on PR titles, so both git commits and PR titles should follow. This "BREAKING CHANGE: blah blah" part in the footer with description is a bit awkward because upper part of commit message already contains description what was changed and why. Thus only BREAKING CHANGE mark seems necessary if someone git --grep based on "!:" or "BREAKING" string and if someone does not yet know what the "!" in topic means. |
hartmannathan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for proposing updates to CONTRIBUTING.md. I need to think about this for a while before I can form an opinion...
@cederom the commit message normally says what was done, the message after "BREAKING CHANGE: " will give a hint to user how a feature was used in the past and how it is used now. The breaking features is not supposed to be hidden, but they we don't need to be in the title :) |
|
Could you modify the git commit message template file in this repository to also remind contributors at commit time to mark the breaking change?
|
|
Update from the mailing list: @jerpelea proposes to use I like the idea best as it is most versatile no matter what comes after, costs only single char, and its easy to parse. But it does not fully align with Conventional Commits spec.. and so we may propose that idea over there? :-) I also agree that "BREAKING CHANGE" should be put somewhere in the git commit message and PR description, just in case someone does not know what the "!" means, or parses logs by "BREAKING" string. If we want to put this in the footer as Conventional Commits declares, then a short sentence on how to fix should follow (i.e. BREAKING CHANGE: lvgl api changed from 8 to 9, update your code.). |
linguini1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you modify the git commit message template file in this repository to also remind contributors at commit time to mark the breaking change?
.gitmessage
Following this convention will let NuttX commits to be easily parsed by standard tools: https://www.conventionalcommits.org/en/v1.0.0/ Signed-off-by: Alan C. Assis <[email protected]>
Nobody is proposing it Tomek! The exclamation mark will be needed by the Release Notes script... Could you please look at the code Luke! https://github.com/apache/nuttx/pull/16823/files |
Release Notes are generated from Pull Requests not git commits:
This "!" (+"BREAKING CHANGE:") mark should be both part of Git Commit and the Pull Request too as this tells more attention needed here when checking, and it aligns with existing release process as explained above. This is my last message about this. Let @jerpelea decide he is the Release Manager :-) |
|
@cederom a PR could contains more than one commit, and more than one commit can break different things. Currently we don't track Break Changes, so the script will need to be updated anyway. Then we modify it to detect breaks on commit instead of PR BTW, looking at https://github.com/apache/nuttx/blob/master/tools/doreleasenotes.py seems like it go by commits, not PR |
|
@linguini1 please review, I already fixed the suggest. @cederom please review and remove Change Request since the modification as implemented as suggested and adding it to PR too as you later suggested is redundant. |
jerpelea
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Alan,
I think that the proposed changes should be discussed in the mailing list and voted by the community since they impacts the release process.
- Our release notes are generated from PR messages and without an indication that there is a breaking change we will create issues for our users.
- Breaking change PR should not contain more than 1 commit that breaks the compatibility and that commit MUST have the same mark in the commit title for easy identification.
|
Ok @jerpelea, let us to discuss there, but I think there is no way to prevent people to create a PR with more than one commit. And some cases it is necessary to have more than one commit to avoid compilation errors (when you modify and driver and need to modify the board files). You cannot include the board modifications in the driver commit and you cannot separate it in a new PR otherwise the driver PR will break the board building. |
|
@acassis case by case we should accept more than 1 commit if the breaking change is in a sequence. I was referring to the case when 1 commit is breaking and the rest are fixing bugs or adding features |
|
I think we should merge this PR and then use @raiden00pl script to automatically indicate the [breaking changes] in the PR |
|
@acassis please modify the PR to include
We need to send a clear message to our developers and users |
|
@cederom any concerns? |
|
Thanks @jerpelea my all remarks are above already, text proposition too :-) My main concern was about not only changing breaking change mark but also process (i.e. no mark in the PR which I know would impact release process, etc). I am happy we are back on the track already, thank you guys :-) |
|
@acassis please update the commit to
|
|
@jerpelea I will add the breaking information in the pull request, but asking people to include only breaking commits in the PR doesn't work: commits are separated by logical features, however adding a breaking will requires modifications in other files (and commits) to pass the CI. Forcing a PR to have only breaking changes could means we will have to merge PR that doesn't pass in the CI, because it could requires board modifications that not necessarily are breaking commits. @xiaoxiang781216 @hartmannathan @simbit18 @linguini1 @cederom what do you think? Does it make sense to force devs to include only 1 commit or only commits with breaking changes? |
|
It sounds like when breaking change is provided, PR should only contain breaking change and nothing more, it should pass build, but should not contain any additional features or updates, any additional features or updates should be sent in another PR linked by "depends-on" or "provides" kind of reference, right @jerpelea ? I think this is required by release process handling and backporting changes from master to a release branch, so PR with breaking change can be backported, verified, and then following related PRs can be backported? Long story short the changes should be as small as possible but not smaller, that is they should pass build, but different changes should be provided with separate PRs, that is out current process already :-) But it may be good to underline that for breaking changes too :-) |
I'm not sure as I'm not too familiar with the release process. It might be hard to separate in some cases. The example I can think of is a breaking change commit for some code + another commit to update the documentation to explain that breaking change. Logically these two would be separate commits since one is a code change and the other is a doc change, but I personally am of the opinion that code changes + corresponding doc change commits should be in the same PR so they are merged at once. I'm not sure how much of a headache that is for @jerpelea in the release process though, maybe he could explain how it causes issues so we can brainstorm other solutions? |
|
I think since the current release process only uses the PR title to be generated, it is ideal that each PR has only one commit, but life is no so simple. We need to fix the release process, not force people to create PRs with a single commit, that is the point! :-) |
|
Don't fix stuff that is not broken :-P |
|
Well how difficult would it be to use the commit subject in releases instead of the PR title? Maybe we can just follow @jerpelea 's request for now (breaking changes are rare so we probably won't encounter this multi commit issue right away) and then try to work towards using commit subjects instead of PR titles for the releases? |
Yes, we can add it, but we know there are many case where it will not work. |
Yes, not broken, just PReliminary :-D |
|
Hey there @acassis can we please update this text to the one below and move forward? Do we agree now that both git commits and pull requests need breaking mark? :-)
I saw |
cederom
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets stick to this please and move on, both git commits and pull requests needs this breaking mark.
Breaking Changes must be clearly marked both in Git Commits and Pull Requests: 1. Put ! (exclamation mark) as first character of the title; 2. Put BREAKING CHANGE: in the body with a brief change description and the quick-fix instructions. This helps users identify areas that need an update on their side, grep git logs, and auto-generate Release Notes.
|
@jerpelea what is the decision here? :-) |
Summary
Following this convention will let NuttX commits to be easily parsed by standard tools: https://www.conventionalcommits.org/en/v1.0.0/
Impact
Avoids using "[BREAKING]" in the commit title table sends a bad message for anyone reading the git history, also avoid cluttering the title, specially when more tags are used, since the title should be restricted to 50 chars.
Testing
N/A