Skip to content

docs: add changelog guidelines and align the /changelog prompt#10867

Merged
mergify[bot] merged 9 commits into
mainfrom
fix/changelog-prompt-guidelines
Jul 1, 2026
Merged

docs: add changelog guidelines and align the /changelog prompt#10867
mergify[bot] merged 9 commits into
mainfrom
fix/changelog-prompt-guidelines

Conversation

@gustavovalverde

@gustavovalverde gustavovalverde commented Jul 1, 2026

Copy link
Copy Markdown
Member

Motivation

Two related gaps. CONTRIBUTING.md, AGENTS.md, and the PR template all point contributors at a CHANGELOG_GUIDELINES.md that never existed in the tree. And the /changelog command's drafts drift from those (unwritten) rules: section headings alternate between ### Fixed and bold **Fixed**, PR links appear on some entries and not others, some drafts use em dashes or nest a code fence, and on #10820 the two new ReadRequest variants land under ### Added in the crate changelog though ReadRequest is not #[non_exhaustive], so adding a variant is breaking for crate consumers.

Solution

Commit the guidelines and align the automation to them from one source.

  • Add the guidelines as a book developer page (book/src/dev/changelog-guidelines.md) next to the release process, list it in SUMMARY.md, and repoint CONTRIBUTING.md and AGENTS.md at it.
  • Rewrite the /changelog prompt to encode the rules it kept missing: the operator-plus-per-crate structure and a fixed output shape, required PR links and exact ### headings, the corrected breaking rule (a new variant on an enum that is not #[non_exhaustive], not the reverse), operator-breaking versus crate-breaking, the Fixed-versus-Changed test, and no em dashes or extra code fences.
  • A comment on the prompt marks the page as the source its rules distill, so the two stay in sync.

AI Disclosure

AI tools were used: Claude analyzed the drafts against the guidelines, transcribed the guidelines, and wrote the prompt.

The drafted entries drifted from CHANGELOG_GUIDELINES: inconsistent section
headings, missing PR links, em dashes, and a broken code fence, and one enum
addition was filed under Added when it is breaking. The prompt inverted the
breaking-enum rule (it named non-exhaustive enums, the safe case) and never
described the operator-plus-per-crate changelog structure, so the model
reinvented the layout each run.

State the two-changelog structure and output shape, require the PR link and
exact `### ` headings, correct the breaking rule to a new variant on an enum
that is not `#[non_exhaustive]`, separate operator-breaking from crate-breaking,
add the Fixed-versus-Changed test, and forbid em dashes and extra code fences.
Copilot AI review requested due to automatic review settings July 1, 2026 05:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR rewrites the natural-language prompt used by the /changelog GitHub Actions command (changelog-command.yml) so that Claude-drafted changelog entries follow Zebra's actual conventions. It encodes the two-tier changelog structure (operator root CHANGELOG.md plus one block per affected crate), a fixed output shape, a required PR link on every entry, exact ### Keep-a-Changelog section headings, and — most importantly — corrects the breaking-change rule so that a new variant on an enum that is not #[non_exhaustive] (rather than the previously-named non-exhaustive case) is flagged as breaking. It also separates operator-breaking from crate-breaking changes, adds a Fixed-vs-Changed test, and forbids em dashes and stray code fences.

The change is confined to prompt text; no code paths, permissions, or workflow triggers are altered. The corrected Rust semantics are accurate, and the encoded structure/section ordering matches the repo's existing changelog files. The one issue is an internal contradiction in the new prompt wording (see below).

Changes:

  • Restructure the drafting prompt to state the operator-root + per-crate changelog layout and a fixed output shape.
  • Correct the breaking-change definition to target non-#[non_exhaustive] enums, and split operator-breaking from crate-breaking criteria.
  • Require a PR link per entry, exact ### headings, the Fixed-vs-Changed test, and ban em dashes/extra code fences.

Comment thread .github/workflows/changelog-command.yml Outdated
CONTRIBUTING.md, AGENTS.md, and the PR template pointed at a root
CHANGELOG_GUIDELINES.md that never existed. Add the guidelines as a book dev
page next to the release process, list it in SUMMARY.md, and repoint the
references. A note on the /changelog prompt marks the page as the source its
rules distill, so the two stay in sync.
@gustavovalverde gustavovalverde changed the title fix(ci): align the /changelog prompt with the changelog guidelines docs: add changelog guidelines and align the /changelog prompt with them Jul 1, 2026
Address review feedback that one bullet per changelog file contradicts the repo's
own convention: a single PR routinely produces several entries in one file, and a
breaking-yet-additive change (a new variant on an enum that is not non_exhaustive)
is listed under both Breaking Changes and Added, as zebra-state does for the
AnyChainBlock variants. Draft one bullet per distinct change, dual-list such
additions, record the same convention in the guidelines, and point the release
notes prompt at the GitHub Release Format section so both prompts track the doc.
Copilot AI review requested due to automatic review settings July 1, 2026 05:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/changelog-command.yml
The page still said one entry per PR and one section only, which the prompt (now
per distinct change) and the repo contradict: PR #10798 alone carries three
entries across Fixed and Security. Relax the page to one entry per distinct
change, with a PR of several independent changes getting one entry each, so the
page, the prompt, and the existing changelogs agree. The anti-padding and
anti-grouping examples stand, and section priority now scopes to a single change.
@gustavovalverde gustavovalverde changed the title docs: add changelog guidelines and align the /changelog prompt with them docs: add changelog guidelines and align the /changelog prompt Jul 1, 2026
The step produces the summary and Update Priority parts of the GitHub Release
Format, not the full format; How to Upgrade and Compatibility are added at
release time. Correct the comment so it does not overstate the step.
Copilot AI review requested due to automatic review settings July 1, 2026 12:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread CONTRIBUTING.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 1, 2026 12:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Comment thread .github/workflows/changelog-command.yml
Comment thread .github/workflows/release.yml Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 1, 2026 12:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread book/src/dev/changelog-guidelines.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 1, 2026 12:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/changelog-command.yml Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 1, 2026 13:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@mpguerra mpguerra left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good enough for now, can revisit and iterate on this if necessary :)

@mergify mergify Bot added the queued label Jul 1, 2026
@mergify

mergify Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 11 minutes 38 seconds in the queue, including 47 seconds running CI.

Required conditions to merge

mergify Bot added a commit that referenced this pull request Jul 1, 2026
@mergify
mergify Bot merged commit 7ed7ec0 into main Jul 1, 2026
89 checks passed
@mergify
mergify Bot deleted the fix/changelog-prompt-guidelines branch July 1, 2026 13:35
@mergify mergify Bot removed the queued label Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants