flag unlabeled PRs with wildcard label #1
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
Exploring how to use
lerna-changelog
to identify unlabeled PRs that we committed. Related issue: lerna#74Result
Example from my testing:
Approach
Check all the labels on a commit, if none of them match the
labels
in the config file, this tool adds a label to the commit. This makes sure that whencommit.categories
is built, the commit is included since it is now labeled.A developer can use the existing
labels
config to decide what heading goes on it in the terminal output.This
wildcardLabel
feature is optional because it means any commit tomaster
that isn't using a label from the config'slabels
is going to get flagged. That's great if you want to make sure you review every PR in the terminal output, but might be annoying if you feel you are super diligent about labeling your PRs and don't need a reminder.Pros:
wildcardLabel
can match a real label being used by the development team and still get the desired result. In fact, it can add as a safeguard for times people forget to put thisunlabeled
label.Questions:
What do you do when
wildcardLabel
has a value, but no matching key inunlabeled
? Provide a default message?In
lerna-changelog
configuration, there is a default title fornextVersion
of "Unreleased". I could go with a default heading for unlabeled PRs, and if someone wants a specific heading, they just need to add it to thelabels
config.Decision: I decided to provide a default in the
configuration.ts
so that a default heading is provided. The user can override this by providing a value for the same label in thelabels
property.