chore(chloggen): branch-name default, optional auto-filled PR, type/docs skip - #7368
Merged
zhxiaogg merged 1 commit intoJun 3, 2026
Merged
Conversation
zhxiaogg
force-pushed
the
chore/chloggen-tooling-improvements
branch
5 times, most recently
from
June 3, 2026 14:57
e1ceec7 to
eaebc7e
Compare
zhxiaogg
marked this pull request as ready for review
June 3, 2026 15:12
zhxiaogg
requested review from
carles-grafana,
electron0zero,
ie-pham,
javiermolinar,
mapno,
mattdurham,
mdisibio,
oleg-kozlyuk-grafana,
ruslan-mikhailov,
stoewer,
yvrhdn and
zalegrala
as code owners
June 3, 2026 15:12
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the repository’s chloggen-based changelog workflow by (a) making make chlog-new usable without extra flags, (b) allowing changelog issues to be omitted and backfilled from git history during chlog-update, and (c) updating CI/docs/templates to match the new intended behavior (including skipping changelog enforcement for type/docs PRs).
Changes:
- Add best-effort PR-number backfill for empty
issuesfields using the commit that added the entry file, and failchlog-update/chlog-previewwhen unresolved. - Improve
make chlog-newto default the entry filename to the current git branch (with guardrails formain/master/detached HEAD). - Update docs/templates/CI: clarify
issuessemantics, skip changelog check fortype/docs, and add a tools-module unit test workflow.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/chloggen/internal/chlog/entry.go | Makes issues optional in validation; adds git-based PR backfill + missing-issues detection; tracks entry source path. |
| tools/chloggen/internal/chlog/entry_test.go | Updates validation expectations and adds BackfillIssues unit tests; ensures test helpers populate entry.path. |
| tools/chloggen/cmd/validate_test.go | Updates validate behavior tests to treat empty issues as valid. |
| tools/chloggen/cmd/update.go | Performs issues backfill before rendering and errors out if unresolved (including in --dry). |
| tools/chloggen/cmd/update_test.go | Adds tests ensuring update/dry-run fail when PR can’t be determined and that errors list all unresolved entries. |
| Makefile | Defaults chlog-new filename to current branch and adds a safety check for non-derivable branch states. |
| CONTRIBUTING.md | Updates contributor guidance for chloggen usage, including optional issues and new filename behavior. |
| .github/workflows/tools-tests.yml | Adds a dedicated workflow to run unit tests for the tools/ Go module. |
| .github/workflows/changelog.yml | Extends changelog-check skip conditions to include type/docs label. |
| .github/pull_request_template.md | Updates checklist guidance to mention overriding the default chloggen filename. |
| .chloggen/TEMPLATE.yaml | Clarifies that issues is optional and can be auto-filled at release time. |
| .chloggen/README.md | Documents optional issues behavior, backfill semantics, and failure modes for update/preview. |
Comments suppressed due to low confidence (1)
CONTRIBUTING.md:451
- MEDIUM: This section recommends running
make chlog-previewbefore pushing while also documenting thatissuescan be left blank. With the currentchlog-previewimplementation (chloggen update --dry), entries with blankissueswill fail to preview until after merge/backfill (or untilissuesis set explicitly). It’d help to call out this constraint here so contributors don’t hit a confusing failure.
Validate and preview before pushing:
```bash
make chlog-validate
make chlog-preview
</details>
…ocs skip Several quality-of-life improvements to the changelog tooling: - chlog-new now defaults the entry filename to the current branch, so a bare `make chlog-new` works as the docs describe. Override with FILENAME=...; defaulting is refused on main/master/detached HEAD with a clear message. - The `issues` field is now optional. When left blank, `chlog-update` backfills the PR number from the commit that adds the entry file (Tempo squash-merges as "... (grafana#1234)"). Resolution happens in Go before the summary is rendered. On a release branch the backport PR number is used; set `issues` explicitly to pin a specific number. - Both `chlog-update` and `chlog-preview` fail if any entry's PR cannot be determined, listing every unresolved entry in one error, so an entry is never rendered or written without a link. - PRs labeled `type/docs` now skip the required changelog check. - Added a `Tools Unit Tests` workflow that runs `go test ./...` for the separate tools module (tools/go.mod) on every PR, so chloggen's tests run in CI. - Clarified TEMPLATE.yaml / README / CONTRIBUTING wording: `issues` holds the PR number (issue works too) and can be left blank.
zhxiaogg
force-pushed
the
chore/chloggen-tooling-improvements
branch
from
June 3, 2026 15:27
eaebc7e to
0bfcb2d
Compare
zhxiaogg
enabled auto-merge (squash)
June 3, 2026 15:41
zalegrala
approved these changes
Jun 3, 2026
This was referenced Jun 3, 2026
zhxiaogg
added a commit
to zhxiaogg/tempo
that referenced
this pull request
Jun 3, 2026
…ocs skip (grafana#7368) (cherry picked from commit d182bec)
zhxiaogg
added a commit
that referenced
this pull request
Jun 3, 2026
* chore(tools): add chloggen for changelog management (#7346) (cherry picked from commit 90e1d17) * chore(tools): configurable chloggen change types and required entry author (#7351) (cherry picked from commit 2e3dabb) * chore: adopt chloggen for changelog management (#7339) (cherry picked from commit f3e791f) * chore: update changelog check to include modified files (#7366) (cherry picked from commit 57897eb) * chore(chloggen): branch-name default, optional auto-filled PR, type/docs skip (#7368) (cherry picked from commit d182bec) * chore(chloggen): retarget changelog workflow to release-v2.9 Backport adaptation: the changelog workflow introduced in #7339 only runs for PRs targeting main and uses origin/main as the diff base. Point both at release-v2.9 so the check runs on backport PRs to this branch. --------- Co-authored-by: Ruslan Mikhailov <195758209+ruslan-mikhailov@users.noreply.github.com>
zhxiaogg
added a commit
that referenced
this pull request
Jun 3, 2026
* chore(tools): add chloggen for changelog management (#7346) (cherry picked from commit 90e1d17) * chore(tools): configurable chloggen change types and required entry author (#7351) (cherry picked from commit 2e3dabb) * chore: adopt chloggen for changelog management (#7339) (cherry picked from commit f3e791f) * chore: update changelog check to include modified files (#7366) (cherry picked from commit 57897eb) * chore(chloggen): branch-name default, optional auto-filled PR, type/docs skip (#7368) (cherry picked from commit d182bec) * chore(chloggen): retarget changelog workflow to release-v2.10 Backport adaptation: the changelog workflow introduced in #7339 only runs for PRs targeting main and uses origin/main as the diff base. Point both at release-v2.10 so the check runs on backport PRs to this branch. --------- Co-authored-by: Ruslan Mikhailov <195758209+ruslan-mikhailov@users.noreply.github.com>
zhxiaogg
added a commit
that referenced
this pull request
Jun 3, 2026
* chore(tools): add chloggen for changelog management (#7346) (cherry picked from commit 90e1d17) * chore(tools): configurable chloggen change types and required entry author (#7351) (cherry picked from commit 2e3dabb) * chore: adopt chloggen for changelog management (#7339) (cherry picked from commit f3e791f) * chore: update changelog check to include modified files (#7366) (cherry picked from commit 57897eb) * chore(chloggen): branch-name default, optional auto-filled PR, type/docs skip (#7368) (cherry picked from commit d182bec) * chore(chloggen): retarget changelog workflow to release-v3.0 Backport adaptation: the changelog workflow introduced in #7339 only runs for PRs targeting main and uses origin/main as the diff base. Point both at release-v3.0 so the check runs on backport PRs to this branch. --------- Co-authored-by: Ruslan Mikhailov <195758209+ruslan-mikhailov@users.noreply.github.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.
What this PR does:
Quality-of-life improvements to the new chloggen-based changelog tooling.
make chlog-newdefaults the entry filename to the current branch. A baremake chlog-newpreviously failed (the tool requires--filenamebut the Makefile didn't pass it); it now works as the docs describe. Override withFILENAME=.... Defaulting is refused onmain/master/detached HEAD with a clear message.issuesis now optional. When left blank, the PR number is backfilled from the commit that added the entry file (Tempo squash-merges as... (#1234)). Resolution happens in Go before the summary is rendered. On a release branch the file is added by the backport PR, so the backport PR number is used; setissuesexplicitly to pin a specific number.chlog-updateandchlog-preview(--dry) fail if any entry's PR cannot be determined, listing every unresolved entry in one error — they never render or write an entry without a link. (Earlier drafts left preview lenient; it is now strict in both modes. Setissuesexplicitly when no PR exists, e.g. a direct-to-maincommit.)type/docsskip the required changelog check (alongsideSkip Changelog,dependencies, andchore:titles).Tools Unit Testsworkflow runsgo test ./...for the separatetoolsmodule (tools/go.mod) on every PR, so chloggen's tests run in CI (the main unit-test jobs only cover the root module). Runs on every PR so it can be marked a required check without blocking unrelated PRs.TEMPLATE.yaml,.chloggen/README.md, andCONTRIBUTING.md:issuesholds the PR number (an issue number also works) and can be left blank.Which issue(s) this PR fixes:
Checklist
tools/chloggensuite green; addedTestBackfillIssuesand update fail-path tests)chore:change