Skip to content

ci: set up commit message conformance rules using ng-dev #20580

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

Merged

Conversation

josephperrott
Copy link
Member

@josephperrott josephperrott commented Sep 15, 2020

With this change, commit messages are now checked as they are created locally, and then verified against CI upstream as well. Local commit message validation failures are treated as warnings, while on CI they are errors which are blocking.

On a bad commit message, you will see something like the following output:

!  Invalid commit message
Error:
  'badscope' is not an allowed scope.
   => SCOPES: cdk/a11y, cdk/table, (removed scopes to make this less verbose in illustration), youtube-player
The expected format for a commit is:
<type>(<scope>): <summary>
<body>

Before this commit can be merged into the upstream repository, it must be
amended to follow commit message guidelines.

If you would like commit message validation failures locally to to be treated as errors, failing to create a commit if the commit message validation failed, you can do so by setting a local config in your .ng-dev.user file (which is expected to be in a json format, or a js/ts file providing a default export object).
.ng-dev.user

{
  "commitMessage": {
    "errorOnInvalidMessage": true
  }
}

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Sep 15, 2020
@josephperrott josephperrott force-pushed the commit-message-conformance branch 2 times, most recently from 85c4f2f to c26871b Compare September 15, 2020 22:26
@josephperrott josephperrott changed the title WIP ci: set up commit message conformance rules using ng-dev Sep 15, 2020
@josephperrott josephperrott force-pushed the commit-message-conformance branch from c26871b to 1ffc8c6 Compare September 15, 2020 22:31
@josephperrott josephperrott force-pushed the commit-message-conformance branch from 1ffc8c6 to 32f57fa Compare September 15, 2020 22:44
@josephperrott josephperrott added the target: patch This PR is targeted for the next patch release label Sep 15, 2020
@josephperrott josephperrott marked this pull request as ready for review September 15, 2020 22:44
@josephperrott josephperrott requested a review from a team as a code owner September 15, 2020 22:44
@josephperrott josephperrott added action: merge The PR is ready for merge by the caretaker merge safe labels Sep 15, 2020
@josephperrott josephperrott removed the request for review from a team September 15, 2020 22:49
@wagnermaciel wagnermaciel merged commit 42be968 into angular:master Sep 16, 2020
wagnermaciel pushed a commit that referenced this pull request Sep 16, 2020
@devversion
Copy link
Member

@josephperrott Just came across this. Nice! Finally we can have consistent commit messages (and working changelog output then). I wonder if we should compose this list automatically in the future? With this change we now have multiple sources of truth for entry points (i.e. the corresponding config.bzl files)

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants