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
Add documentation and tests for label changelog label section assignment behavior #822
Add documentation and tests for label changelog label section assignment behavior #822
Conversation
Codecov Report
@@ Coverage Diff @@
## master #822 +/- ##
==========================================
+ Coverage 85.39% 85.47% +0.07%
==========================================
Files 36 36
Lines 2404 2402 -2
Branches 337 309 -28
==========================================
Hits 2053 2053
+ Misses 274 272 -2
Partials 77 77
Continue to review full report at Codecov.
|
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.
Great additions to the docs ❤️
<details><summary>Click here to see the default label configuration</summary> | ||
|
||
```json | ||
[ |
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.
This is a great addition!
docs/pages/autorc.md
Outdated
#### Changelog Titles | ||
|
||
By default auto will create sections in the changelog for the following labels. | ||
Each PR included in the release will be matched to the first label defined in the config with a `changelogTitle` in priority order of the `releaseType` (major, minor, patch, then all others) and included as an entry within that section |
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.
Each PR included in the release will be matched to the first label defined in the config with a `changelogTitle` in priority order of the `releaseType` (major, minor, patch, then all others) and included as an entry within that section | |
Each PR included in the release will be matched to the first label defined in the config with a `changelogTitle`. | |
All matching commits are grouped together and rendered as one section in the changelog. | |
Sections are in priority order based on the `releaseType` (`major`, `minor`, `patch, then all others). |
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.
@hipstersmoothie
I agree that the wording can be improved...
One piece of info that we may lose by removing that wording is the following scenario:
my config
{
"labels": [
{ "releaseType": "none", "name": "foo", "changelogTitle": "Foo" },
{ "releaseType": "minor", "name": "bar", "changelogTitle": "Bar" }
]
}
if a PR has both foo
and bar
labels, then technically, the first label in the config is foo
, but the PR would be assigned to the bar
section.
This likely will not be a common use case, but wondering if it is worth keeping the info in the docs in a different format for completeness.
What are your thoughts?
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.
Ah I see. I just wanted to break up the sentence a little bit. I agree with
you we should keep the original wording maybe a little clearer
Definitely open to suggestions about how to improve the wording.
How about rewording to something like below?
Changelog Titles
Each PR included in the release will be assigned to a label section based upon the matching label with the highest releaseType
that has a changelogTitle
.
- Priority order of
releaseType
from highest to lowest: major, minor, patch, and then all others - If a PR has multiple labels of the same
releaseType
, then the PR is assigned based upon the label that is assigned first in the config
By default auto will create sections in the changelog for the following labels:
- major
- minor
- patch
- internal
- documentation
For example:
- Using the default config, if a given PR has the labels
minor
andinternal
, then it will be included in theminor
label section - Using the default config, if a given PR has the labels
documentation
andinternal
, then it will be included in theinternal
label section
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.
I like it!
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.
should be addressed in: 0d286f9
@@ -200,6 +199,78 @@ describe('generateReleaseNotes', () => { | |||
expect(await changelog.generateReleaseNotes(normalized)).toMatchSnapshot(); | |||
}); | |||
|
|||
test('should prefer section with highest releaseType for PR with multiple labels', async () => { |
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.
I like that you used test to validate how it works for your docs! Awesome
Ah I see. I just wanted to break up the sentence a little bit. I agree with
you we should keep the original wording maybe a little clearer
…On Thu, Dec 19, 2019 at 3:05 PM bnigh ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In docs/pages/autorc.md
<#822 (comment)>:
> #### Changelog Titles
-By default auto will create sections in the changelog for the following labels.
+Each PR included in the release will be matched to the first label defined in the config with a `changelogTitle` in priority order of the `releaseType` (major, minor, patch, then all others) and included as an entry within that section
@hipstersmoothie <https://github.com/hipstersmoothie>
I agree that the wording can be improved...
One piece of info that we may lose by removing that wording is the
following scenario:
my config
{
"labels": [
{ "releaseType": "none", "name": "foo", "changelogTitle": "Foo" },
{ "releaseType": "minor", "name": "bar", "changelogTitle": "Bar" }
]
}
if a PR has both foo and bar labels, then technically, the first label in
the config is foo, but the PR would be assigned to the bar section.
This likely will not be a common use case, but wondering if it is worth
keeping the info in the docs in a different format for completeness.
What are your thoughts?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#822?email_source=notifications&email_token=AAJDEBFP5LO33EQLWEOKR73QZP4Z3A5CNFSM4J5RUJVKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCP3YMUY#discussion_r360161546>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJDEBCZSFTIIIZ4UXADJKLQZP4Z3ANCNFSM4J5RUJVA>
.
|
🚀 PR was released in v8.8.0 🚀 |
What Changed
Why
Todo:
Callouts
Published PR with canary version:
Published under canary scope @auto-canary
@auto-canary/auto@8.7.3-canary.822.10958.0
@auto-canary/core@8.7.3-canary.822.10958.0
@auto-canary/all-contributors@8.7.3-canary.822.10958.0
@auto-canary/chrome@8.7.3-canary.822.10958.0
@auto-canary/conventional-commits@8.7.3-canary.822.10958.0
@auto-canary/crates@8.7.3-canary.822.10958.0
@auto-canary/first-time-contributor@8.7.3-canary.822.10958.0
@auto-canary/git-tag@8.7.3-canary.822.10958.0
@auto-canary/jira@8.7.3-canary.822.10958.0
@auto-canary/maven@8.7.3-canary.822.10958.0
@auto-canary/npm@8.7.3-canary.822.10958.0
@auto-canary/omit-commits@8.7.3-canary.822.10958.0
@auto-canary/omit-release-notes@8.7.3-canary.822.10958.0
@auto-canary/released@8.7.3-canary.822.10958.0
@auto-canary/s3@8.7.3-canary.822.10958.0
@auto-canary/slack@8.7.3-canary.822.10958.0
@auto-canary/twitter@8.7.3-canary.822.10958.0
@auto-canary/upload-assets@8.7.3-canary.822.10958.0