Require a release-notes label on every pull request - #42
Merged
Merged
Conversation
release.yml groups the generated notes by label, so an unlabelled PR lands silently in "Other" — which is what every PR merged before it existed did. Fail the check while the PR is still open and labelling costs nothing, rather than discovering it at tag time. The accepted labels are exactly the ones release.yml categorises, so a PR that passes cannot end up uncategorised. Both files are listed in AGENTS.md as a pair to keep them in step. Dependabot is skipped: it applies `dependencies` itself, but not before this first runs on `opened`, so the check would fail and then pass on the relabel. Those PRs are categorised by author in release.yml anyway.
{{ errorString }} is only the quantifier the action substitutes into
"requires {{ errorString }} {{ count }} of" — one of exactly, at least,
at most. Used on its own it rendered as "and has exactly.", which says
nothing about what is wrong.
{{ applied }} lists the labels the PR actually has, which is the part
someone reading a failed check needs.
{{ applied }} is empty in the common case — a PR with no labels at all —
so the message ended "and has: .". The tokens the action offers describe
the rule, not what the reader should do about it; the list to choose from
is fixed, so state it plainly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
#41 made the release notes group by label. This makes sure the labels are actually there.
Without it the failure is silent: an unlabelled PR still appears in the notes, just dumped in "Other". That is what every PR merged before #41 did — I had to go back and label #34 and #36–#40 by hand so the 3.0.0 notes would read properly. This check moves that discovery to while the PR is open, when labelling costs nothing.
Accepted labels
Exactly one is required.
These are deliberately not signalk-server's list (
fix, feature, doc, chore, test, ignore, other, dependencies, refactor). Four of those —chore,test,refactor,other— have no category in this repo'srelease.yml, so a PR could pass the gate and still land in "Other", which is the exact failure the gate exists to prevent. Anddoc/ignorewould duplicate thedocumentation/skip-changelogalready in use here.So the gate accepts precisely what
release.ymlcategorises. Verified as an invariant rather than by eye:AGENTS.md notes the two files as a pair, since adding a label to one without the other reopens the hole.
Dependabot is skipped
It applies
dependenciesitself, but not before this first runs onopened— the check would fail, then pass on the relabel, producing a red tick on every dependency PR for no reason.release.ymlcategorises those by author regardless.Tested
The invariant above was checked by parsing both files and diffing the label sets.
{{ errorString }}in the failure message is confirmed against the action's documented template variables. YAML parses; typecheck, lint, format, 79 tests and build all pass.This PR is itself the first to go through the gate.