Skip to content

Conversation

@bcoe
Copy link

@bcoe bcoe commented Jan 7, 2021

BREAKING CHANGE: footers that look like commits will now be displayed in the CHANGELOG.

This PR adds support for expanding multiple commits, represented by a single commit message, into multiple commits in the CHANGELOG.

It expects the format:

meta: multiple commits

feat(recaptchaenterprise): migrate microgenertor
  Committer: @miraleung
  PiperOrigin-RevId: 345559154
  BREAKING-CHANGE: for some reason this migration is breaking.
  Source-Link: googleapis/googleapis@5e0dcb2

fix(securitycenter): fixes security center.
  Committer: @miraleung
  PiperOrigin-RevId: 345559182
  Source-Link: googleapis/googleapis@e5eef86

Where:

  • after your standard conventional commit header (for example, meta: multiple commits, can be anything), there are footers that looks like Conventional Commits.
  • these footers can themselves have multiple lines, by spacing in each line attached to the footer.

Refs: #667
Fixes: #614
CC: @miraleung

@bcoe bcoe requested a review from a team as a code owner January 7, 2021 03:46
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Jan 7, 2021
@codecov
Copy link

codecov bot commented Jan 7, 2021

Codecov Report

Merging #686 (493a9eb) into master (a3a1df6) will increase coverage by 0.10%.
The diff coverage is 98.27%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #686      +/-   ##
==========================================
+ Coverage   85.04%   85.15%   +0.10%     
==========================================
  Files          48       48              
  Lines        5838     5894      +56     
  Branches      542      520      -22     
==========================================
+ Hits         4965     5019      +54     
- Misses        872      874       +2     
  Partials        1        1              
Impacted Files Coverage Δ
src/util/to-conventional-changelog-format.ts 97.17% <97.77%> (-0.21%) ⬇️
src/conventional-commits.ts 98.74% <100.00%> (-0.01%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a3a1df6...493a9eb. Read the comment docs.

(node: FooterNodes) => {
switch (node.type) {
case 'scope':
footerText += `(${node.value})`;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is necessary because we don't currently include ( and ) in the parser, I'd like to add a parenthesis node, which would simplify logic.

Copy link
Contributor

@chingor13 chingor13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the meta: header required to parse the extra commit messages?

If not, I could see inadvertent messages being parsed from a multiple commit squash and merge from the GitHub UI.

text: string;
}

function getParsedCommits(commits: Commit[]) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add the return type?

Copy link
Contributor

@chingor13 chingor13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the README to describe what you can do with this feature.

@bcoe bcoe requested a review from chingor13 January 8, 2021 01:13
@bcoe bcoe merged commit b3f96d8 into master Jan 8, 2021
@bcoe bcoe deleted the go-multi-ball branch January 8, 2021 17:36
@release-please release-please bot mentioned this pull request Jan 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parse multiple conventional commit messages

5 participants