fix(release): keep the release notes to what a human wrote - #50
Merged
Merged
Conversation
Two problems found while backporting this script to js-rest-api-clients, where nine packages move in lockstep instead of two. `packages()` asked npm for the workspace locations. `npm query` resolves them through node_modules, which during a release rehearsal is a symlink to another checkout — so it answered with paths pointing outside the copy being rehearsed, and the changelog lookup found nothing. The rehearsal is a documented step, so this would have looked like a broken script to whoever ran it. The list is now read straight off the filesystem, which needs no node_modules at all. The bigger one: every package in a `fixed` group accumulates a changelog entry saying the other packages moved. With two packages that's one wasted section; with nine it was 46 lines of release notes carrying a single line of actual content. A section is now included only if it has a bullet that isn't `Updated dependencies` or a bare `pkg@version`, and a footer lists every package published at that version so none of them becomes invisible. Checked against the real v2.2.7 changelogs and against a nine-package rehearsal, plus the case of an entry whose prose happens to begin with a `pkg@version`.
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.
Two problems in
bin/publish.sh, both found while backporting it tojs-rest-api-clients, where nine packages move in lockstep instead of two.packages()broke during a release rehearsalIt asked npm for the workspace locations.
npm queryresolves those throughnode_modules— which, in the rehearsal described in our migration notes, is asymlink to a different checkout. So it answered with paths like
../../../../Users/.../js-rest-api-clients/packages/cma-client, pointingoutside the copy being rehearsed, and the changelog lookup found nothing:
The rehearsal is a documented verification step, so this would have read as "the
script is broken" to whoever ran it. The package list is now read straight off
the filesystem from the
workspacesglobs, which needs nonode_modulesat all— and it skips private packages, which are never published anyway.
Release notes were mostly bookkeeping
Every package in a
fixedgroup gets a changelog entry saying the others moved:With two packages that's one wasted section. With nine it was 46 lines of
release notes carrying one line of actual content.
A package now gets a section only if its entry has a bullet that is neither
Updated dependenciesnor a barepkg@version. So nothing is lost, but nothingrestates the release either. A footer lists every package published at that
version, so a package with no prose doesn't silently vanish from the notes:
Verified
their actual output.
js-rest-api-clients(
changeset versionon a scratch copy), which is what surfaced both problems:46 lines down to 9 plus the footer.
has_prosewas checked on six cases, including the one that could bite it: anentry whose prose begins with a
pkg@version(- @datocms/cma-client@6 is now required, and the old client is gone.) is kept, while a bare- @datocms/rest-client-utils@5.9.0is dropped.