fix(release): fit an oversized CHANGELOG section into the Release body - #693
Merged
Merged
Conversation
GitHub refuses a Release body over 125 000 characters. The 2.4.0 section is over 156 000, so the v2.4.0 tag's Release step failed with HTTP 422 after its verify and knowledge bundle had passed. - scripts/release-notes.mjs: a section that fits is left as written; a longer one becomes its heading, every ### subsection and each entry's bold lead, with a link to the full section at the tag. A lead that is only a name keeps the rest of its first sentence. - release.yml: runs it on the extracted section before creating or editing the Release. - scripts/release-notes.test.mjs, run by release-script-check.yml: the real 2.4.0 section fits and keeps all 99 entries and 8 subsections, the 2.3.0 section passes through unchanged, and release.yml still calls the script between the extraction and gh release create. - release-process.md: step 8 says what happens to a section over the limit.
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.
Why
release.ymlpublishes a tag's CHANGELOG section as the body of its GitHub Release, and GitHub refuses a body over 125 000 characters. The 2.4.0 section is over 156 000, so on the v2.4.0 tag the Create or update GitHub Release step failed withHTTP 422: body is too long (maximum is 125000 characters), after verify and the knowledge bundle had both passed. The v2.4.0 Release was then created by hand with a condensed body. Re-running the workflow could not help: the edit path posts the same body and hits the same limit.What changed
scripts/release-notes.mjs— takes the extracted section. One that fits is left byte for byte. A longer one becomes its heading, every###subsection, and each entry cut to its bold lead sentence, followed by a link to the full section at the tag. The CHANGELOG already writes that lead to be read on its own. An entry whose lead is only a name, such as`SvgGlyph.fromFile(Path)`., keeps the rest of its first sentence. A lead with no closing**is published as its first line rather than dropped.release.yml— the notes step runs the script right after theawkextraction, so bothgh release createandgh release editget a body that fits. Node is already set up earlier in the job for the knowledge bundle.scripts/release-notes.test.mjs— run by a new step inrelease-script-check.yml, whose path filter now also covers the script, its test andrelease.yml. Cases:release.ymldoes, fits: 7 264 characters, all 99 entries, all 8 subsections in order, every lead bold, and the link to the tag;release.ymlstill calls the script between the extraction andgh release create.docs/contributing/release-process.md— step 8 says what happens to a section over the limit.Limit: if even the condensed body exceeded the limit (on the order of a thousand entries), the Release would still be refused. No CHANGELOG section is near that.
Lane: build / release tooling. No runtime code, no public API.
Verification
node scripts/release-notes.test.mjs— 11 cases pass.release.yml→ the workflow-order case fails.node scripts/release-notes.mjs <extracted v2.4.0 section> v2.4.0 DemchaAV/GraphCompose→ notice: 156 097 characters condensed to 7 264, 99 entry leads. Called without arguments → usage message and exit 2../mvnw -B -ntp test -f core/pom.xml -Dtest='com.demcha.documentation.**'— 143 tests, 0 failures, BUILD SUCCESS (the knowledge-gate guards parserelease.yml).