From 5d0262868923e16cd79b24936d02ba610d09f59c Mon Sep 17 00:00:00 2001 From: Duncan Tourolle Date: Fri, 21 Aug 2026 19:54:46 +0200 Subject: [PATCH] fix(release): publish real notes, and stop shipping old releases' installers Two defects found while preparing v0.9.2, both of which had been shipping for months without anything to notice them by. **Every release note was the same 1,050 bytes.** All 35 releases from v0.0.1 to v0.9.1 published identical generic install instructions whose "What's New" section read "See CHANGELOG.md" -- a link that does not resolve from a release page. A reader learned nothing about what changed in any release the project has ever made. The body now comes from the `## ` section of CHANGELOG.md, and a missing section fails the release: notes that say nothing are worse than a build that waits for a maintainer to write two sentences. The 35 published bodies have been backfilled from the changelog via the tea CLI. This also corrects something introduced two commits ago. That change generated the body from `bun run release:notes`, which CLAUDE.md is explicit about -- its output is "a reviewed draft, not a final changelog". Publishing it unreviewed proved the point immediately: the v0.9.1..HEAD range contains a repo-wide prettier sweep, so every file in src/ counted as changed, their TRACES resolved to nearly the whole matrix, and the draft claimed the release had added the entire application. The script now skips cosmetic commits (chore(format), chore(deps), style) and reports how many rather than silently returning a smaller set, but it stays a local drafting tool. **Every release from v0.1.0 to v0.8.2 shipped every Windows installer ever built.** src-tauri/target/*/release/bundle/ is not versioned, cargo never cleans it, and the runner reuses the target directory -- so the copy step's bundle/**/*-setup.exe glob collected the lot. v0.8.2 carried sixteen installers, thirteen of them stale; v0.5.0 offered users a download list going back to 0.1.0. Eight months, and nothing to notice it by: the upload loop reported success, the files were real, and the page looked busy rather than wrong. It stopped only because an unrelated cargo cache change wiped the runner's target dir, so it was dormant, not fixed. Both desktop builds now remove the bundle directory before building, so a stale file cannot exist to be copied. Filtering the copy by version would have hidden it instead. The Linux job gets the same treatment: it was never hit only because Linux packaging is newer, and the glob is identical. scripts/check-release-artifacts.sh is the backstop for whatever reintroduces one by a route nobody predicted. It runs before the SBOM, the checksums and the upload -- all of which describe the file set, so a stale artifact has to be caught before it is hashed and published as part of the release. Verified against a reconstruction of the real v0.8.2 accumulation. DR-219, DR-220, UT-210. --- .gitea/workflows/build-release.yml | 72 +++++++++++++++----- docs/requirements.md | 3 + docs/specs/README.md | 2 +- scripts/build-windows-cross.sh | 20 ++++++ scripts/check-release-artifacts.sh | 103 +++++++++++++++++++++++++++++ scripts/release-notes.test.ts | 58 ++++++++++++++++ scripts/release-notes.ts | 88 ++++++++++++++++++++++-- 7 files changed, 323 insertions(+), 23 deletions(-) create mode 100755 scripts/check-release-artifacts.sh create mode 100644 scripts/release-notes.test.ts diff --git a/.gitea/workflows/build-release.yml b/.gitea/workflows/build-release.yml index 2ed80ae1..8fa8be79 100644 --- a/.gitea/workflows/build-release.yml +++ b/.gitea/workflows/build-release.yml @@ -146,6 +146,15 @@ jobs: # If TAURI_SIGNING_PRIVATE_KEY is ever absent the build fails loudly rather # than quietly shipping an unsigned release that no client will accept -- # which is the behaviour we want. + # Same hazard as the Windows job: the bundle directory is never cleaned by + # cargo and the runner reuses src-tauri/target, while the copy step below + # globs bundle/deb/*.deb and friends. Windows is where this actually bit + # (v0.8.2 shipped thirteen stale installers), but only because Linux + # packaging is newer -- the glob is identical. Remove the directory so a + # stale artifact cannot exist to be copied. + - name: Clear previous bundle output + run: rm -rf src-tauri/target/release/bundle + - name: Build for Linux run: bun run tauri build env: @@ -413,6 +422,19 @@ jobs: name: jellytau-android path: artifacts/android/ + # Runs before the SBOM, the checksums and the upload -- everything + # downstream describes this set of files, so a stale artifact must be + # caught before it gets hashed into SHA256SUMS and published as though it + # belonged to this release. + # + # See the script for the eight months of releases that shipped their + # predecessors' Windows installers. + - name: Verify artifacts belong to this release + run: | + ./scripts/check-release-artifacts.sh \ + "${{ steps.tag_name.outputs.VERSION }}" \ + artifacts/linux artifacts/windows artifacts/android + # Software Bill of Materials, one per half of the app. Without it there is # no answer to "does this release contain ?" other than # rebuilding the tag and re-resolving it. cargo-cyclonedx is in the builder @@ -482,9 +504,11 @@ jobs: exit 1 fi - # Release notes for the update prompt come from the traceability graph, - # same source as the release body. - NOTES="$(bun run release:notes 2>/dev/null | head -c 4000 || echo "See the release page for details.")" + # What the in-app update prompt shows. Same reviewed source as the + # release body -- the CHANGELOG section for this version, not the + # traceability draft. + NOTES="$(awk -v ver="## $VERSION" '$0==ver{f=1;next} /^## /{if(f)exit} f' CHANGELOG.md | head -c 4000)" + [ -n "$NOTES" ] || NOTES="See the release page for details." jq -n \ --arg version "$PLAIN" \ @@ -549,24 +573,37 @@ jobs: # release rather than shipping and failing for users. sha256sum -c SHA256SUMS - # Release notes come from the traceability graph, not from a hardcoded - # heredoc. scripts/release-notes.ts resolves the commit range's changed - # files to their TRACES ids and then to requirement descriptions, grouping - # UR into Features and DR/IR into Improvements -- which is what CLAUDE.md - # has asked for all along, while this workflow pasted a fixed block of - # install instructions and a line saying "see CHANGELOG.md for detailed - # changes". It also linked "GitHub Issues" on a Gitea-hosted project. + # The published body is the hand-written CHANGELOG.md section for this + # version. `bun run release:notes` is printed into the job log as a + # drafting aid, but is NOT published: CLAUDE.md is explicit that its + # output is "a reviewed draft, not a final changelog", and publishing it + # unreviewed proved the point -- a range containing a repo-wide prettier + # sweep resolved to nearly the whole requirement matrix and produced notes + # claiming one release had added the entire application. + # + # A missing CHANGELOG section fails the release. A release whose notes say + # nothing is worse than one that waits for a maintainer to write two + # sentences, and the checklist already requires that entry. - name: Prepare release notes id: release_notes run: | set -e VERSION="${{ steps.tag_name.outputs.VERSION }}" + + echo "๐Ÿ“‹ Traceability draft (for reference; not published):" + bun run release:notes 2>/dev/null || echo "(could not derive a draft)" + echo "" + + # The section between this version's heading and the next one. + CHANGES=$(awk -v ver="## $VERSION" '$0==ver{f=1;next} /^## /{if(f)exit} f' CHANGELOG.md) + if [ -z "$(echo "$CHANGES" | tr -d '[:space:]')" ]; then + echo "::error::CHANGELOG.md has no '## $VERSION' section." + echo "::error::Add the entry for this version and re-tag; see docs/release-checklist.md." + exit 1 + fi + { - echo "## JellyTau $VERSION" - echo "" - # A generated summary of what actually changed; falls back to a - # pointer rather than failing the release if the range is odd. - bun run release:notes 2>/dev/null || echo "See the commit log for changes in this release." + echo "$CHANGES" echo "" echo "### Downloads" echo "" @@ -578,8 +615,8 @@ jobs: echo "| Windows | \`*-setup.exe\` (NSIS). Unsigned โ€” SmartScreen may warn on first run. |" echo "| Android | \`*.apk\` sideload, or \`*.aab\` for Play Console |" echo "" - echo "Desktop builds update themselves from here on: JellyTau checks this" - echo "release feed and can install a new version in place." + echo "Desktop builds check for updates from here and can install a new" + echo "version in place, verifying its signature first." echo "" echo "### Verifying your download" echo "" @@ -599,6 +636,7 @@ jobs: echo "---" echo "Report a problem: ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/issues" } > release_notes.md + echo "๐Ÿ“ Release notes:" cat release_notes.md diff --git a/docs/requirements.md b/docs/requirements.md index 84b1e044..983c3154 100644 --- a/docs/requirements.md +++ b/docs/requirements.md @@ -410,6 +410,8 @@ Internal architecture, components, and application logic. | DR-216 | Dependencies are gated on known vulnerabilities and on licence compatibility, and the build graph is pinned to what is actually shipped. The project had no scanning of any kind: nothing checked the ~500-crate Rust graph or the JS packages against an advisory feed, and nothing checked that everything redistributed inside an MIT-licensed bundle permits it. The first run found eight vulnerabilities and one unsoundness โ€” `bytes`, four in `rustls-webpki`, `time`, two in `quick-xml`, `rand` โ€” every one closed by a `cargo update` nobody had reason to run. `cargo deny` (src-tauri/deny.toml) now runs in CI over advisories, licences, bans and sources. Two structural fixes matter as much as the gate: the graph is scoped to the targets actually shipped, so an advisory against an Apple-only path is correctly absent rather than ignored by ID; and the one git dependency (`libmpv`) is pinned by revision instead of by branch, since a branch means any `cargo update` silently substitutes new upstream code in the one dependency that is unsigned and links a C library into the player. Licence findings are recorded rather than waved through โ€” `libmpv`/`libmpv-sys` are LGPL-2.1, which the app satisfies by dynamic linking, and that carries obligations (keep the linkage dynamic; ship libmpv's licence text with any bundle carrying the .so) | Tooling | - | Done | | DR-217 | In-app update, desktop only, over a manifest we control. `tauri-plugin-updater` and `tauri-plugin-process` are compiled for everything except Android/iOS โ€” spelled as a target-triple cfg rather than `cfg(desktop)`, which Cargo does not evaluate in a `[target.'cfg(โ€ฆ)']` table and which therefore drops the dependency silently, surfacing much later as "Permission updater:default not found". The release workflow signs updater artifacts with a minisign key held in Gitea secrets and publishes `latest.json` to a dedicated `updater` branch, read over Gitea's raw-file URL: this instance serves `/releases/download//` but returns 404 for `/releases/latest/download/`, so there is no stable latest-release URL to point at, and the docs branch is force-pushed by publish-docs.yml so it cannot host the manifest either. Bundle targets gain `appimage`, which the release notes had been advertising for months while `tauri.conf.json` never built it โ€” the artifact step globbed for `*.AppImage`, found nothing, and said nothing | Tooling | UR-077 | Done | | DR-218 | Persistent, redacted logging and a diagnostics export. `tauri-plugin-log` replaces the `env_logger` stdout-only init, giving a rotating 5 MB file, a webview target in dev, and โ€” the single largest gain โ€” logcat on Android, where `env_logger`'s stdout went nowhere. **Redaction runs in the log formatter, not at export**: a credential in a file on the device is already a disclosure, so stripping it on the way out would be too late; the exporter redacts a second time to cover files written by older builds. `api_key`/`X-Emby-Token`/`Authorization`/`"AccessToken"`/`Token="โ€ฆ"` all reduce to `[REDACTED]` while host, item ids and filenames are deliberately kept โ€” a bundle scrubbed of those is one nobody can debug from. The server URL is reduced to scheme and host, dropping any embedded `user:pass@`. The panic hook chains to the previous hook rather than replacing it, because `utils/lock.rs` installs a silencing hook around tests that provoke poisoned locks on purpose. The chosen level persists to disk and is re-applied at startup, since reproducing a bug usually means restarting into it. The frontend facade keeps its untouched `console.*` pass-through (DR-204) and additionally forwards a stringified copy at info and above, so one file holds both halves of the app in order โ€” which is what makes a race between them legible after the fact | Tooling | UR-078 | Done | +| DR-219 | Release notes are the reviewed CHANGELOG entry, not a generated draft. Every release from v0.0.1 to v0.9.1 published the same ~1,050 bytes of generic install instructions whose "What's New" section said "See CHANGELOG.md" โ€” a link that does not resolve from a release page. Thirty-five releases, byte-identical, telling a reader nothing about what changed. The workflow now publishes the `## ` section of CHANGELOG.md and fails the release if that section is absent, since notes that say nothing are worse than a build that waits for two sentences. `release:notes` is printed into the job log as a drafting aid but is deliberately *not* published: CLAUDE.md calls its output "a reviewed draft, not a final changelog", and publishing it unreviewed proved why โ€” a range containing a repo-wide formatting sweep resolved to nearly the entire requirement matrix and produced notes claiming one release had added the whole application. The script now skips cosmetic commits (`chore(format)`, `chore(deps)`, `style`) when deriving a range's files, and says how many it skipped rather than silently reporting a smaller set | Tooling | - | Done | +| DR-220 | A release ships only its own artifacts. `src-tauri/target/*/release/bundle/` is not versioned, cargo never cleans it, and the CI runner reuses the target directory โ€” so the copy step's `bundle/**/*-setup.exe` glob collected every installer ever built there. Every release from v0.1.0 to v0.8.2 shipped its predecessors': sixteen Windows installers on v0.8.2, thirteen of them stale, and a download list on v0.5.0 reaching back to 0.1.0. It went unnoticed for eight months because there was nothing to notice โ€” the upload loop reported success, the files were real, and the page looked busy rather than wrong. It stopped only when an unrelated cache change wiped the runner's target dir, leaving the defect dormant rather than fixed. Both desktop builds now clear the bundle directory first, so a stale file cannot exist to be copied โ€” filtering the copy by version would have hidden it instead. `scripts/check-release-artifacts.sh` is the backstop for the next route nobody predicts: it runs before the SBOM, the checksums and the upload, and refuses to publish when any artifact's embedded version disagrees with the tag | Tooling | - | Done | | DR-198 | The webview runs under a real Content-Security-Policy, and the asset protocol is scoped to the one directory it still serves. `csp` was `null`, which disables CSP entirely: any script that reached the web layer โ€” through a future `{@html}`, a dependency, or a devtools paste โ€” would have inherited the whole IPC surface, and with it the user's session. `script-src 'self'` (Tauri injects a nonce for SvelteKit's inline bootstrap script at build time, so no `'unsafe-inline'` is needed) plus `object-src`/`frame-src 'none'` and `base-uri 'self'` is the part that is genuinely restrictive. `img-src`/`media-src`/`connect-src` cannot be: the Jellyfin origin is typed in by the user at run time and is commonly plain `http` on a LAN, so they allow `http:`/`https:` โ€” a wide grant for *data*, but one that still bars `file:`, `filesystem:` and scripting schemes, and leaves `script-src` untouched. `style-src` keeps `'unsafe-inline'` because Svelte compiles `style="โ€ฆ"` attributes (including `app.html`'s `display: contents` wrapper) into markup; this is safe only while no `