Skip to content

feat(vdev): automate release upgrade guide from breaking fragments#25877

Draft
pront wants to merge 9 commits into
masterfrom
pront-breaking-fragment-schema
Draft

feat(vdev): automate release upgrade guide from breaking fragments#25877
pront wants to merge 9 commits into
masterfrom
pront-breaking-fragment-schema

Conversation

@pront

@pront pront commented Jul 16, 2026

Copy link
Copy Markdown
Member

Summary

Automates the release upgrade guide end to end. Previously website/content/en/highlights/<date>-<v>-upgrade-guide.md was written by hand for every minor release.

This PR:

  • Defines a structured format for *.breaking.md fragments — YAML frontmatter (title, optional anchor) followed by ## Summary and ## Migration sections, then the trailing authors: line.
  • Ships a scaffolder (cargo vdev changelog new <type> <slug>) that writes a prefilled template. Slug is validated (blocks path traversal); author auto-fills from git config github.user / gh api user / a users.noreply.github.com email; falls back to a TODO_your_gh_handle placeholder that the checker rejects, so scaffolded-but-unfilled fragments can't slip through CI.
  • Enforces the schema in vdev check changelog-fragments (already CI-wired): missing frontmatter, missing/empty required sections, wrong order, bad anchor, TODO still in title, and the author placeholder all fail with a targeted error. Header matching is fence-aware, so ## Summary inside a fenced code block doesn't count.
  • Auto-generates the upgrade guide during release: vdev release generate-cue parses breaking fragments as the new schema, feeds only the Summary into the changelog list (no more frontmatter or migration content leaking into it), and emits website/content/en/highlights/<date>-<v>-upgrade-guide.md with a TOC and per-fragment sections. Fragment authors aggregate into the guide's authors:. If there are zero breaking fragments, no highlights file is written.

Forward-only — there are no *.breaking.md fragments in changelog.d/ on master today, so no back-migration is needed.

Vector configuration

N/A — CI/tooling change.

How did you test this PR?

  • cargo build -p vdev / cargo clippy --workspace --all-targets --all-features -- -D warnings clean
  • 93 vdev unit tests pass (added coverage for: slug validation & traversal, the TODO_your_gh_handle placeholder, TODO-in-title rejection, fence-aware header matching, structured breaking-fragment parser, slugify, upgrade-guide filename, and the rendered highlights markdown shape)
  • End-to-end: cargo vdev changelog new breaking foo -> git add -> make check-changelog-fragments passes; deleting a section, reordering, or leaving TODO all fail with the intended error

Change Type

  • Bug fix
  • New feature
  • Dependencies
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on our guidelines.
  • No. A maintainer will apply the no-changelog label to this PR.

pront added 2 commits July 16, 2026 15:40
*.breaking.md fragments now require YAML frontmatter (title, migration,
optional anchor) so the release process can auto-generate the upgrade
guide from them. Non-breaking fragments are unchanged.

vdev check changelog-fragments parses the frontmatter and enforces the
required fields; unit tests cover the happy path and each failure mode.
cargo vdev changelog new <type> <slug> writes changelog.d/<slug>.<type>.md
with a prefilled template. Author line is auto-filled from
git config github.user, gh api user, or a users.noreply.github.com email;
falls back to a TODO placeholder that fails the checker with a clear
message. Breaking-type template includes the required frontmatter block.
@github-actions github-actions Bot added the domain: vdev Anything related to the vdev tooling label Jul 16, 2026
@datadog-vectordotdev

datadog-vectordotdev Bot commented Jul 16, 2026

Copy link
Copy Markdown

Pipelines  Tests

⚠️ Warnings

🚦 1 Pipeline job failed

Changelog | validate-changelog   View in Datadog   GitHub Actions

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 43b4310 | Docs | Give us feedback!

pront added 2 commits July 16, 2026 15:48
All prose now lives in structured frontmatter fields (title, summary,
migration). Body between frontmatter and the trailing authors: line
must be empty — the validator rejects stray prose so authors can't
put content in a place the release generator will silently drop.
…tion

Frontmatter is now metadata-only (title, optional anchor). Multi-paragraph
markdown with fenced code blocks lives under `## Summary` and `## Migration`
headers, dodging YAML block-scalar indentation traps and rendering natively
as markdown on GitHub.
@pront pront changed the title feat(vdev): formalize breaking changelog fragment schema feat(vdev): structured breaking changelog fragments Jul 16, 2026
pront added 3 commits July 16, 2026 15:55
- Slug: reject anything but ASCII alnum, _, -. Blocks path traversal
  (../outside), absolute paths, and stray punctuation.
- Author: reject the TODO_your_gh_handle sentinel and any TODO left
  in the breaking `title`, so scaffolded-but-unfilled fragments fail
  the checker with a clear message.
- Header matching: track fenced code blocks so `## Summary` /
  `## Migration` inside a code sample no longer satisfy the schema.

New unit tests cover slug traversal, the TODO placeholder, and the
fence case.
release generate-cue now parses *.breaking.md as a structured schema
(frontmatter + ## Summary + ## Migration). It:

- feeds only the Summary into the release CUE changelog list
- emits website/content/en/highlights/<date>-<version>-upgrade-guide.md
  with a TOC and per-fragment sections (title + anchor + Migration
  content) whenever there is at least one breaking fragment
- aggregates fragment authors as the upgrade guide's authors field

Anchors are derived from titles (kebab-case slugify) when the fragment
does not set one explicitly. Existing behavior for non-breaking
fragments is unchanged.

Tests cover the new parser, slugify, upgrade-guide filename, and the
rendered highlights markdown shape.
@pront pront changed the title feat(vdev): structured breaking changelog fragments feat(vdev): automate release upgrade guide from breaking fragments Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: vdev Anything related to the vdev tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant