Repository navigation
feat: build the release body from the SDK release notes on the share - #94
Merged
Merged
Conversation
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.
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.
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.pyextracts one version's section fromRelease Notes.pdfon the share and renders it as Markdown.release.ymlassembles the body as: SDK notes, a## \cuvis.sdk` repo Changes` heading, then this repository's changelog section. It was the changelog alone before.pypdfadded as areleaseextra (and totest, 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:
the use_compressed_lut settingsextracts astheuse_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.pro-/cessingarrive 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``ready`Publishes cuvis SDK 3.6.0.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
pypdfhands 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 --strictstill passes.Pitfalls
FURNITUREandSUBSECTIONSare 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.vX.Y.Zrc1dry run catches a share published without notes before the real tag.