Skip to content

feat: build the release body from the SDK release notes on the share - #94

Merged
birkholz-cubert merged 1 commit into
mainfrom
feature/release-notes-from-share
Oct 16, 2026
Merged

birkholz-cubert merged 1 commit into
mainfrom
feature/release-notes-from-share

Conversation

@birkholz-cubert

@birkholz-cubert birkholz-cubert commented Sep 11, 2026 •

Copy link
Copy Markdown
Collaborator

Automates the step that was done by hand for v3.6.0: taking the SDK's own release notes and putting them at the top of the GitHub Release body.

What

  • scripts/release_notes.py extracts one version's section from Release Notes.pdf on the share and renders it as Markdown.
  • release.yml assembles the body as: SDK notes, a ## \cuvis.sdk` repo Changes` heading, then this repository's changelog section. It was the changelog alone before.
  • Fails the release when the share carries no release notes, or when the notes have no section for the version being tagged. Both exit 1; verified.
  • pypdf added as a release extra (and to test, so the module imports under pytest).

Why it needs more than a text dump

The PDF is cumulative (26 versions, newest first) and typeset with LaTeX. Two properties of its text layer would otherwise show up as bugs in the release body:

  • No space around verbatim spans. the use_compressed_lut settings extracts as theuse_compressed_lutsettings. Layout-mode extraction does not fix it. The spans are recoverable because they carry their own typewriter font (SFTT1095), which is both how the spacing is restored and how they end up correctly fenced in backticks.
  • Hard-wrapped with hyphenation. pro- / cessing arrive on separate lines and are rejoined; bullets are folded back into one block.

Running heads, folios and the table of contents sit inline in the text layer and are dropped.

Verified against the real thing

Generated the body for 3.6.0 and diffed it against what was published by hand. Three differences, all acceptable:

`sudo apt-get install gpsd` manual paste has backticks; the PDF does not mark it verbatim, so the extraction leaves it as prose
`ready` the PDF does mark it verbatim; the manual paste missed it, the extraction gets it right
Publishes cuvis SDK 3.6.0. the changelog section's lead line, dropped by the manual paste

Everything else is byte-identical, including the section order and the one-sentence-per-line layout.

Tests

7 new tests, 77 total. The PDF I/O is one thin function; the folding logic is pure and tested against a fixture shaped exactly as pypdf hands the runs over — running heads inline, no space around the verbatim span, hyphenated wrap. Covers furniture stripping, re-spacing and fencing, section boundaries, de-hyphenation, sentence splitting, and the fatal missing-version path.

mkdocs build --strict still passes.

Pitfalls

  • A term the PDF renders as prose stays prose; it cannot be inferred. The Release is a draft, so that is a copy-edit before publishing rather than a defect. The durable fix would be a Markdown or text source for the notes from the SDK side, which would let this drop the PDF parsing entirely.
  • FURNITURE and SUBSECTIONS are tied to the current LaTeX template. If the notes are re-typeset, those two constants are what needs adjusting, and a bad extraction is visible in the workflow log because the step prints what it extracted.
  • The notes step runs for pre-release tags too, so a vX.Y.Zrc1 dry run catches a share published without notes before the real tag.

The release body was this repository's changelog alone, which says nothing
about what the SDK itself changed. That half was being pasted in by hand after
every release.

Lift it out of Release Notes.pdf on the share instead. The PDF is cumulative,
so only the section for the version being released is taken, and a share
carrying no notes, or notes with no section for that version, now fails the
release rather than publishing a body that describes nothing.

Two properties of the PDF's text layer shape the extraction. LaTeX emits no
space around a verbatim span, so "the use_compressed_lut settings" arrives as
one word; the spans carry their own typewriter font, which is what restores the
spacing and lets them be fenced in backticks. Paragraphs are hard-wrapped with
hyphenation, so bullets arrive split across lines and are rejoined.

Checked against the 3.6.0 notes: the generated body matches the one pasted by
hand, except that it also backticks a verbatim span the manual paste missed.
@birkholz-cubert
birkholz-cubert merged commit e7bbd67 into main Oct 16, 2026
1 check passed
@birkholz-cubert
birkholz-cubert deleted the feature/release-notes-from-share branch October 16, 2026 20:43
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