Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ jobs:
npx prettier --write CHANGELOG.md
npx prettier --check CHANGELOG.md
node scripts/release-notes.mjs extract --version "$VERSION" \
--out "$RUNNER_TEMP/release-notes.md"
--out "$RUNNER_TEMP/release-notes.md" --prompt-out "$RUNNER_TEMP/prompt-notes.md"
cp CHANGELOG.md "$RUNNER_TEMP/CHANGELOG.md"

- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
Expand Down Expand Up @@ -267,28 +267,28 @@ jobs:
VERSION: ${{ needs.prepare.outputs.version }}
run: |
node scripts/release-notes.mjs extract --version "$VERSION" \
--out "$RUNNER_TEMP/release-notes.md"
cat "$RUNNER_TEMP/release-notes.md"
--out "$RUNNER_TEMP/release-notes.md" --prompt-out "$RUNNER_TEMP/prompt-notes.md"
cat "$RUNNER_TEMP/prompt-notes.md"

# The manifest the updater reads, with each platform's `format` (D26).
# The manifest the updater reads, with each platform's `format` (D26), and what the prompt
# shows: the section without what the user cannot see. Here and not in the application, since
# the prompt is drawn by the version already installed.
- name: Assemble latest.json
env:
TAG: ${{ needs.prepare.outputs.tag }}
REPO: ${{ github.repository }}
run: |
node scripts/latest-json.mjs --dir release --version "$TAG" \
--base "https://github.com/$REPO/releases/download/$TAG" \
--notes "$RUNNER_TEMP/release-notes.md"
--notes "$RUNNER_TEMP/prompt-notes.md"

- name: Checksums
run: |
cd release
sha256sum * > SHA256SUMS.txt
cat SHA256SUMS.txt

# ⚠️ The page's body is the changelog section **plus a compare link**, and not the
# extracted file itself: that one is what the manifest carries, and a link in a `<pre>`
# inside the update prompt is noise nobody can click.
# The page's body is the whole changelog section, plus a compare link.
- name: Body for the release page
env:
TAG: ${{ needs.prepare.outputs.tag }}
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Read at the `angular-reference` tag; the egui mechanism is in `docs/architecture
## Tickets and pull requests

- **A pull request's title is its changelog entry** (`scripts/release-notes.mjs`), and a ticket's title is where it comes from: both say **what changes, factually and briefly** — `<Area>: <what now happens>`, the area in one or two words (a head of three words or more before `: ` is all the notes keep; ⚠️ never a commit kind — `CI`, `Docs`, `Test`, `Build`, `Fix`, `Security`… is read as a prefix and dropped), then the control, the action, the result; ≤ 70 characters. No figure of speech, no implementation detail, no « of our own ». ✗ « Search the code through a bar of our own » → ✓ « Code editor: new find-and-replace bar with match count and options ».
- **A ticket wears one section label**: `enhancement`, `change`, `bug` (any fix), `removal`, `security`, or `refactor`/`documentation`/`test`, `website` for the site and its pages; a pull request that closes no ticket wears it itself. ⚠️ Without one, the release notes file it under « Under the hood » without a word.
- **A ticket wears one section label**: `enhancement`, `change`, `bug` or `removal` for what someone using the application sees (the update prompt shows them), `security`, or `refactor`/`documentation`/`test` for the rest, a fix to the CI or the tests included, `website` for the site and its pages; a pull request that closes no ticket wears it itself. ⚠️ Without one, the release notes file it under « Under the hood » without a word.
- **A ticket's body opens on its context, then its change**: `**Context** —` what the application does today and where it was seen or who asked; `**Change** —` what will be different, in a sentence or two; then `**To do**` and `**Tests**` (naming the e2e scenario). A milestone's description lists what it changes, plainly.
- **No other software in a title, a description or a milestone**, unless the feature reads, writes or plugs into it (an import format, an extension's host): never a comparison with another product.

Expand Down
16 changes: 9 additions & 7 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -1677,11 +1677,13 @@ one-click action.
carried the key — so the block was dead markup that looked like a shipped feature, and
`update.body` was `undefined` at every release.

The text already exists at that point in the release job: `scripts/release-notes.mjs extract`
writes it to `$RUNNER_TEMP/release-notes.md` for the GitHub release body, and the manifest
step reads the same file. ⚠️ `generate_release_notes` appends the raw pull-request list
inside `action-gh-release` and does not touch that file, so the manifest carries the
hand-written section alone.
`scripts/release-notes.mjs extract` writes two files from the section at the tag: the whole of it,
for the GitHub release body, and the prompt's (`--prompt-out`), for the manifest. **The prompt keeps
what the user will notice**: the summary, additions, changes, fixes, removals and security. The
technical work (the tests, the documentation and the site with it) and the dependencies stay in
`CHANGELOG.md`, on the release page and in "What's new". Which section is shown is said beside its
labels, in `SECTIONS`. ⚠️ It is filtered in the manifest, not in the application: the prompt is drawn
by the version already installed. A release with nothing left to show says so in one line.

⚠️ **Shown open, at a fixed height.** Behind a `<details>` it was installed without being
read — and worse, opening it _changed the dialog's height_: the body is bounded at 160px but
Expand Down Expand Up @@ -6211,8 +6213,8 @@ key can produce an installable update. It is the key the Tauri releases were sig
answers.
- **The dot on the About menu** says « an update exists and is not installed », and outlives the
prompt it was raised with.
- **The notes the prompt shows** are the release's changelog section, carried by `latest.json`
(→ "The update prompt shows the release's notes").
- **The notes the prompt shows** are the release's changelog section less what the user cannot see,
carried by `latest.json` (→ "The update prompt shows the release's notes").
- **The manifest** (`latest.json`, `scripts/latest-json.mjs`) carries the NSIS installer and the
AppImage, each with its `format` (`nsis`, `appimage`), which the client requires. Windows is the
one platform whose absence fails the release; a missing Linux artefact only warns. It is
Expand Down
6 changes: 6 additions & 0 deletions docs/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ entry — so a surprise in the summary tells you which of the four fired.
Beyond GitHub's defaults, the labels worth reaching for are `change` (behaviour that already
existed and now differs), `security` and `removal`.

**The update prompt shows the sections a user can see**, so `enhancement`, `change`, `bug` and
`removal` are for what someone using the application notices. A fix to the CI, the tests, the
scripts, the release or the site wears `test`, `refactor`, `documentation` or `website`: filed
under « Under the hood », it is in `CHANGELOG.md` and on the release page, and out of the prompt.
The dry run says, entry by entry, whether the prompt shows it.

The sections, in their order: ✨ Added, 🔧 Changed, 🐛 Fixed, 🗑️ Removed, 🔒 Security,
🧰 Under the hood, 📦 Dependencies. The last one holds the pull requests labelled
`dependencies` — Dependabot applies that label itself — and nothing else. When a pull request
Expand Down
46 changes: 38 additions & 8 deletions scripts/release-notes.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,20 @@ import { pathToFileURL } from 'node:url';
* when a pull request wears two mapped labels: the first section that claims one of them
* wins, so `dependencies` + `enhancement` is an addition. Only the `dependencies` label
* (Dependabot sets it itself) reaches the last section, so a month of bumps no longer
* buries the refactors.
* buries the refactors. `prompt`: the update prompt shows it.
*/
export const SECTIONS = [
{ id: 'added', heading: '✨ Added', labels: ['enhancement', 'feature'], kinds: ['feat'] },
{ id: 'added', heading: '✨ Added', labels: ['enhancement', 'feature'], kinds: ['feat'], prompt: true },
{
id: 'changed',
heading: '🔧 Changed',
labels: ['change', 'performance'],
kinds: ['change', 'perf'],
prompt: true,
},
{ id: 'fixed', heading: '🐛 Fixed', labels: ['bug'], kinds: ['fix'] },
{ id: 'removed', heading: '🗑️ Removed', labels: ['removal'], kinds: ['remove'] },
{ id: 'security', heading: '🔒 Security', labels: ['security'], kinds: ['security'] },
{ id: 'fixed', heading: '🐛 Fixed', labels: ['bug'], kinds: ['fix'], prompt: true },
{ id: 'removed', heading: '🗑️ Removed', labels: ['removal'], kinds: ['remove'], prompt: true },
{ id: 'security', heading: '🔒 Security', labels: ['security'], kinds: ['security'], prompt: true },
{
id: 'internal',
heading: '🧰 Under the hood',
Expand Down Expand Up @@ -307,6 +308,28 @@ export function extractSection(markdown, version) {
return `${(end === -1 ? rest : rest.slice(0, end)).join('\n').trim()}\n`;
}

/** What the prompt says of a release whose every change is one the user cannot see. */
export const NOTHING_TO_SEE = '- Maintenance release: nothing changes in how the application is used.';

/**
* A section as the update prompt shows it: without the headings kept for the changelog. Read from
* the section rather than from the pull requests, so a heading edited by hand is shown.
*/
export function promptNotes(body) {
const hidden = new Set(
SECTIONS.filter((section) => !section.prompt).map((section) => `### ${section.heading}`),
);
let shown = true;
const kept = body.split('\n').filter((line) => {
if (line.startsWith('### ')) {
shown = !hidden.has(line.trim());
}
return shown;
});
const notes = kept.join('\n').trim();
return `${notes || NOTHING_TO_SEE}\n`;
}

// Everything below talks to git and to GitHub; nothing above does, which is what makes the
// table, the chain and the splice testable without a network.

Expand Down Expand Up @@ -431,7 +454,10 @@ function namedIssues(index) {
/** What the dry run is for: every entry, where it landed, and what put it there. */
function renderSummary({ version, date, since, section, entries, skipped }) {
const rows = entries
.map((entry) => `| ${entry.number ? `#${entry.number}` : '—'} | ${entry.text} | ${entry.via} |`)
.map((entry) => {
const shown = SECTIONS.find((section) => section.id === entry.section).prompt ? 'oui' : 'non';
return `| ${entry.number ? `#${entry.number}` : '—'} | ${entry.text} | ${entry.via} | ${shown} |`;
})
.join('\n');
const number = (value) => `#${value}`;
const squashed = entries.filter((entry) => entry.squashed);
Expand All @@ -450,8 +476,8 @@ function renderSummary({ version, date, since, section, entries, skipped }) {
'',
'### Traçabilité',
'',
'| PR | Entrée | Classée par |',
'|---|---|---|',
'| PR | Entrée | Classée par | Fiche de mise à jour |',
'|---|---|---|---|',
rows,
'',
].join('\n');
Expand Down Expand Up @@ -492,6 +518,10 @@ function main() {
if (typeof out === 'string') {
writeFileSync(out, body);
}
const prompt = options.get('prompt-out');
if (typeof prompt === 'string') {
writeFileSync(prompt, promptNotes(body));
}
process.stdout.write(body);
return;
}
Expand Down
66 changes: 66 additions & 0 deletions scripts/release-notes.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ import {
kindOf,
LEAD_HEADING,
leadItems,
NOTHING_TO_SEE,
parsePrNumber,
promptNotes,
publishedNumbers,
renderSections,
sectionFor,
Expand Down Expand Up @@ -426,3 +428,67 @@ describe('a summary written by hand', () => {
assert.equal(renderSections(withLead([], ['Faster'])), `### ${LEAD_HEADING}\n\n- Faster\n`);
});
});

describe('promptNotes', () => {
const body = [
`### ${LEAD_HEADING}`,
'',
'- A native application.',
'',
'### ✨ Added',
'',
'- Tabs: a dragged tab is raised (#1)',
'',
'### 🧰 Under the hood',
'',
'- E2E: passphrase typed once the panel rests (#2)',
'',
'### 🔒 Security',
'',
'- Log: errors no longer write what the user typed (#3)',
'',
'### 📦 Dependencies',
'',
'- Bump serde (#4)',
'',
].join('\n');

it('leaves out the technical work and the dependencies, wherever they stand', () => {
assert.equal(
promptNotes(body),
[
`### ${LEAD_HEADING}`,
'',
'- A native application.',
'',
'### ✨ Added',
'',
'- Tabs: a dragged tab is raised (#1)',
'',
'### 🔒 Security',
'',
'- Log: errors no longer write what the user typed (#3)',
'',
].join('\n'),
);
});

it('keeps every section a user can see, and a heading written by hand', () => {
const seen = ['✨ Added', '🔧 Changed', '🐛 Fixed', '🗑️ Removed', '🔒 Security', 'By hand'];
const all = seen.map((heading) => `### ${heading}\n\n- One (#1)\n`).join('\n');

assert.equal(promptNotes(all), all);
});

it('says so when nothing is left to show', () => {
const internal = '### 🧰 Under the hood\n\n- E2E: faster (#2)\n';

assert.equal(promptNotes(internal), `${NOTHING_TO_SEE}\n`);
});

it('takes nothing from the changelog, whose section stays whole', () => {
const changelog = `# Changelog\n\n## [1.2.0] - 2026-12-01\n\n${body}`;

assert.equal(extractSection(changelog, '1.2.0'), body);
});
});
Loading