Skip to content

Commit 9ff0482

Browse files
fix(ci): build the extension's release notes from its changelog
Review caught that the migration note this PR moves into a changeset never reaches anyone. `release-vscode-extension.yml` created its GitHub Release with `--generate-notes` and a static body, ignoring `vscode-extension/CHANGELOG.md` entirely — so the curated, per-PR voice that Changesets assembles was written and then discarded. The library and standalone tracks have always fed `extract-changelog.mjs` into `--notes-file`; the extension now does the same, and `npm-publishing.md` stops claiming that every track already did. Full history is fetched for it, because the script recovers each entry's Conventional Commit type from the SHA in the changelog line to group the notes. An empty section falls back to `--generate-notes`, as elsewhere. The contributor guide told authors to skip changesets for VS Code-only work, which the new flow depends on them writing. It also promised the library is never dragged up by a standalone bump — a `fixed` group drags every member, which is what one product number costs. Both corrected. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 8e01555 commit 9ff0482

3 files changed

Lines changed: 32 additions & 13 deletions

File tree

.github/workflows/release-vscode-extension.yml

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,9 @@ jobs:
216216
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
217217
with:
218218
ref: ${{ github.sha }}
219+
# Full history so extract-changelog.mjs can resolve each changelog
220+
# entry's commit type (feat/fix/...) to group the release notes.
221+
fetch-depth: 0
219222

220223
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
221224
with:
@@ -242,18 +245,34 @@ jobs:
242245
exit 1
243246
fi
244247
VSIX="${files[0]}"
245-
gh release create "$TAG" \
246-
--title "$TAG" \
247-
--target "$GITHUB_SHA" \
248-
--verify-tag \
249-
--latest=false \
250-
--generate-notes \
251-
--notes "VS Code extension \`tumaet.apollon-vscode@${VERSION}\`.
252248
249+
# Body = the Changesets-owned CHANGELOG section (curated per-PR voice),
250+
# regrouped by category (Features/Bug Fixes/...) from each entry's
251+
# commit type, plus an install footer. Fall back to GitHub's
252+
# --generate-notes only when there is no changelog section for this
253+
# version (e.g. a release that carried no changeset).
254+
CHANGELOG=$(node scripts/extract-changelog.mjs "$VERSION" vscode-extension)
255+
{
256+
if [ -n "$CHANGELOG" ]; then printf '%s\n\n' "$CHANGELOG"; fi
257+
cat <<EOF
253258
Install:
254-
\`\`\`
259+
260+
\`\`\`sh
255261
code --install-extension tumaet.apollon-vscode
256262
\`\`\`
257263
258-
Published to [VS Marketplace](https://marketplace.visualstudio.com/items?itemName=tumaet.apollon-vscode) and [Open VSX](https://open-vsx.org/extension/tumaet/apollon-vscode). VSIX attached for sideloading." \
264+
Published to [VS Marketplace](https://marketplace.visualstudio.com/items?itemName=tumaet.apollon-vscode) and [Open VSX](https://open-vsx.org/extension/tumaet/apollon-vscode). VSIX attached for sideloading.
265+
EOF
266+
} > release-notes.md
267+
268+
GENERATE=()
269+
[ -z "$CHANGELOG" ] && GENERATE=(--generate-notes)
270+
271+
gh release create "$TAG" \
272+
--title "$TAG" \
273+
--target "$GITHUB_SHA" \
274+
--verify-tag \
275+
--latest=false \
276+
"${GENERATE[@]}" \
277+
--notes-file release-notes.md \
259278
"$VSIX"

docs/contributor/deployment/npm-publishing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The cost of that group is worth naming: a changeset touching only the extension
2525
The per-PR side is Changesets: authors run `pnpm changeset` on every user-visible PR to record a changelog entry with its bump type (see [Release notes](/contributor/development/release-notes)). On every push to `main`, `release.yml` runs [`changesets/action`](https://github.com/changesets/action) in **version-only** mode (no `publish` input — the bespoke `release-*.yml` workflows own publishing) and opens or updates a single **Version Packages** PR. That PR runs `pnpm changeset:version`, which:
2626

2727
- consumes the accumulated `.changeset/*.md` files and bumps `@tumaet/apollon` and the paired `@tumaet/webapp` + `@tumaet/server` from the **declared** bump types — no human picks a bump;
28-
- keeps the standalone app's bump **at least as large as the library's**: a library minor → standalone minor, a library major → standalone major (via `scripts/cascade-standalone-bump.mjs`, which runs first and raises a floor only — the standalone can still bump higher on its own app-only changes, and the library is never dragged up). So a library change always ships to npm **and** as a comparable Docker release from the same merge;
28+
- bumps `@tumaet/apollon`, the standalone pair and `apollon-vscode` to one shared version, taking the largest bump any of them earned. `scripts/cascade-standalone-bump.mjs` still runs first and raises the standalone's floor to the library's bump; inside a `fixed` group that floor is already met, so it is a safety net rather than the mechanism. Because the group is fixed, a bump earned by **any** member raises all of them — a standalone-only or extension-only change does drag the library up, which is the price of one product number. So a library change always ships to npm **and** as a comparable Docker release **and** as a Marketplace release from the same merge;
2929
- regenerates every `CHANGELOG.md`, rewrites the pinned `@tumaet/apollon@X.Y.Z` CDN URLs (via `scripts/sync-library-version.mjs`), and refreshes the lockfile.
3030

3131
The GitHub Release body for each track is built from that `CHANGELOG.md` section (via `scripts/extract-changelog.mjs`), **regrouped by category** — Features, Bug Fixes, Performance, … — from each entry's Conventional Commit type (resolved from the commit SHA via git; full history is checked out for this, falling back to the semver bump when git can't resolve it) instead of the raw `### Minor/Patch Changes` bump headings (see [Release notes](/contributor/development/release-notes#how-your-change-gets-grouped)); it falls back to GitHub's auto-generated notes only when a version carried no changeset. PR Health Checks also run `sync-library-version.mjs --check`, so a CDN-URL drift can never merge — run `pnpm sync:version` locally to fix one.

docs/contributor/development/release-notes.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ description: How to write the changeset that becomes a changelog entry — voice
88

99
User-facing release notes come from [Changesets](https://github.com/changesets/changesets). One changeset per user-visible PR; its summary becomes the changelog entry verbatim.
1010

11-
Three release lines carry changesets: `@tumaet/apollon` on npm, and `@tumaet/webapp` + `@tumaet/server` as paired `ghcr.io` Docker images. The VS Code extension, the docs site, and the webview sub-packages are excluded in `.changeset/config.json#ignore`they have their own (or no) release flow, and without the exclusion a routine library bump would version them too, since every package depends on `@tumaet/apollon` via `workspace:*`.
11+
Four release lines carry changesets: `@tumaet/apollon` on npm, `@tumaet/webapp` + `@tumaet/server` as paired `ghcr.io` Docker images, and `apollon-vscode` on the VS Marketplace. All four share one version — they sit in a single `fixed` group in `.changeset/config.json`, so a release advances them together. The docs site and the extension's webview sub-package are excluded in `#ignore`: they have no release flow of their own, and without the exclusion a routine library bump would version them too, since every package depends on `@tumaet/apollon` via `workspace:*`.
1212

1313
:::note
1414
The pipeline that consumes changesets is live: `release.yml` opens a **Version Packages** PR that runs `changeset version` → regenerates `CHANGELOG.md` → triggers the release on merge. Write the changeset and the rest is automatic — don't hand-edit `CHANGELOG.md`. See [Releases](/contributor/deployment/npm-publishing).
1515
:::
1616

1717
## When do you need one?
1818

19-
Add a changeset whenever a **user, embedder, or operator would notice** a change to `@tumaet/apollon`, `@tumaet/webapp`, or `@tumaet/server` — a new feature, a bug fix, a changed API, or a new deployment step.
19+
Add a changeset whenever a **user, embedder, or operator would notice** a change to `@tumaet/apollon`, `@tumaet/webapp`, `@tumaet/server`, or `apollon-vscode` — a new feature, a bug fix, a changed API, or a new deployment step. A VS Code-only change needs one too: it is what gives the extension its version bump and its Marketplace release notes.
2020

21-
Skip it when nothing downstream is affected: docs, CI, tests, refactors, and formatting — plus anything touching only the VS Code extension or the docs site (both excluded above). When unsure, add one; an extra changelog line beats a silent gap. The advisory **Verify changesets** check on each PR reminds you.
21+
Skip it when nothing downstream is affected: docs, CI, tests, refactors, and formatting — plus anything touching only the docs site (excluded above). When unsure, add one; an extra changelog line beats a silent gap. The advisory **Verify changesets** check on each PR reminds you.
2222

2323
## What you write per PR
2424

0 commit comments

Comments
 (0)