Skip to content

extract release notes from date-headed changelog entries#60

Merged
fabracht merged 1 commit intomainfrom
release-prep-v0.7.6
May 9, 2026
Merged

extract release notes from date-headed changelog entries#60
fabracht merged 1 commit intomainfrom
release-prep-v0.7.6

Conversation

@fabracht
Copy link
Copy Markdown
Contributor

@fabracht fabracht commented May 8, 2026

Summary

The release workflow at .github/workflows/release.yml extracts the GitHub Release body via:

```awk
/^## [$TAG]/{found=1; next} /^## [/{if(found) exit} found{print}
```

That pattern looks for `## [0.7.5]`-style headings, but every CHANGELOG entry in this repo uses the date-led form `## YYYY-MM-DD — mqdb- `. Net effect: every release since at least v0.7.5 has shipped with an empty release body. Confirmed via `gh release view v0.7.5 --json body` (length: 0).

This PR replaces the awk one-liner with a small Python script (heredoc inside the existing `run:` step — no new tooling) that:

  1. Finds the heading containing `mqdb-cli ` and remembers its date (the release date).
  2. Walks the file again and emits every section dated the same day — covering parallel crate bumps like the pending v0.7.6, which carries both `mqdb-cli 0.7.6` and `mqdb-cluster 0.3.4` dated 2026-05-06.
  3. Trims trailing blank lines.
  4. Falls back to an empty body (not a failure) if no matching heading is found, so a release where the CHANGELOG was forgotten still publishes binaries.

No CHANGELOG content moves; the existing date-led convention is preserved.

Test plan

  • Dry-run for tag `0.7.6` against current `CHANGELOG.md` — extracts both the `mqdb-cli 0.7.6` and `mqdb-cluster 0.3.4` sections plus the "Discovered while running the new E2E" subsection.
  • Dry-run for tag `0.7.5` against current `CHANGELOG.md` — extracts the `mqdb-cluster 0.3.2` and `mqdb-cli 0.7.5` sections (both dated 2026-04-25). Confirms backward extraction.
  • YAML parses cleanly via `yaml.safe_load`; the heredoc closing `PY` lands at column 0 after block-scalar de-indentation.
  • `cargo make format-check` — clean.
  • `cargo make clippy` — clean (pedantic, all targets + wasm).
  • Pre-commit hook ran on the commit and passed.

@fabracht fabracht merged commit 80ca5eb into main May 9, 2026
5 checks passed
@fabracht fabracht deleted the release-prep-v0.7.6 branch May 9, 2026 00:08
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.

1 participant