Skip to content
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

feat!: support multiple commits in footer #686

Merged
merged 7 commits into from Jan 8, 2021
Merged

feat!: support multiple commits in footer #686

merged 7 commits into from Jan 8, 2021

Conversation

bcoe
Copy link
Contributor

@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
Contributor 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.

@@ -71,6 +71,30 @@ interface Note {
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
gcf-merge-on-green bot pushed a commit that referenced this pull request Jan 8, 2021
🤖 I have created a release \*beep\* \*boop\* 
---
## [9.0.0](https://www.github.com/googleapis/release-please/compare/v8.2.0...v9.0.0) (2021-01-08)


### ⚠ BREAKING CHANGES

* support multiple commits in footer (#686)

### Features

* support multiple commits in footer ([#686](https://www.github.com/googleapis/release-please/issues/686)) ([b3f96d8](https://www.github.com/googleapis/release-please/commit/b3f96d8dd988b7d482223e8a7868a45043db4880))


### Bug Fixes

* `findFilesByfilename` respects `path` option ([#665](https://www.github.com/googleapis/release-please/issues/665)) ([a3a1df6](https://www.github.com/googleapis/release-please/commit/a3a1df690f48b38c539ee5aab5ae046d640c6811))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please).
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