feat(release): group the changelog by conventional-commit type - #472
Merged
Merged
Conversation
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
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.
Problem
The GoReleaser changelog rendered as a single flat commit list. There was no
grouping by commit type, so features, fixes, dependency bumps, and CI changes
were all interleaved.
Fix
Add a
changelog.groupslist to.goreleaser.yaml: Features, Bug Fixes,Performance, Refactors, Dependencies, CI & Build, and a catch-all Other
section, ordered in that sequence. GoReleaser assigns each commit to the
first group whose regexp matches, evaluated in
ordersequence, soDependencies is ordered ahead of CI & Build to make sure a dependency bump
lands in its own section instead of being swept into CI & Build.
Note on the Dependencies regexp: this repo's actual dependency-bump commits
come from Dependabot as
chore(deps): bump ..., notbuild(deps):or a baredeps:type. A regexp anchored ondeps/build(deps)as the commit typedoes not match that shape, so the Dependencies group instead matches any
commit whose scope is literally
(deps), regardless of type(
^.*?\(deps\)!?:.+$). This was confirmed by running the dry run below.The existing
filters.excludelist (docs/test/chore/merge commits) isunchanged, so the automated
chore: update state [skip ci]fleet churn andplain docs/test noise stay out of the changelog.
Verification
Ran a real dry run over the
v0.7.0..v0.8.0range with GoReleaser installedlocally:
(
--snapshotskips changelog generation entirely in this GoReleaser version,so the non-snapshot form with skips was used instead, pointed at a
GITHUB_TOKENfromgh auth tokensincechangelog.use: githubcalls theGitHub API.)
Observed grouped output (
dist/CHANGELOG.md), trimmed to the sectionheaders and a few entries per section:
No commit landed in both Dependencies and CI & Build, confirming the
ordering resolves the overlap correctly. No Performance or Refactors commits
existed in this range, so those sections simply did not render, which is
expected GoReleaser behavior for an empty group.
Also ran
goreleaser check(clean) andyq '.changelog' .goreleaser.yamlto confirm the YAML structure.
go build ./...passes; no Go code was touched.