Shorter in-app release notes with a link to GitHub, one release per hour at most

This commit is contained in:
Frederic Jung 2026-10-25 15:38:49 +01:00
parent 6b0f3d6eeb
commit 683b7bad3c
No known key found for this signature in database
6 changed files with 60 additions and 3 deletions

View file

@ -10,8 +10,26 @@ Bumping `version` in `package.json` on `main` is the release button. The
that version's CHANGELOG section as notes, and dispatches `release.yml`, which deploys
to GitHub Pages (https://seriesoftub.es).
## At most one release per hour
Players get an update banner and a "What's new" window for every release, so ship at
most one release an hour. Before bumping, check when the last one went out:
```bash
gh api repos/fjaeckel/seriesoftubes/releases/latest --jq '.tag_name+" "+.published_at'
```
- **Less than 60 minutes ago:** don't bump. Commit and push the work with its bullets
under `## [Unreleased]`; it goes out with the next release. Tell the user when the
next release slot opens.
- **60 minutes or more:** release everything under `## [Unreleased]` together, as one
version.
- **Only exception:** the live game is broken for players (it won't start, saves are
lost, a phone can't get past a screen). Then hotfix right away as a patch release.
## Pick the version
- Several changes batched together: use the biggest one (any feature → minor).
- Patch (`x.y.Z`): fixes, small tweaks, wording, icons.
- Minor (`x.Y.0`): new features or content.
@ -41,6 +59,10 @@ to GitHub Pages (https://seriesoftub.es).
## Release notes rules
- The first sentence of each bullet is all the in-app "What's new" shows (at most five
bullets; longer notes get a link to the full GitHub release). Make that sentence
stand on its own: "Tier 1 networks can lay their own subsea cable (#22)." Detail goes
after it.
- Written for players, in plain English. One bullet per change, issue numbers like `(#37)`.
- Never mention hidden easter eggs or explain jokes.
- No internal function names.

View file

@ -6,6 +6,9 @@ All notable changes to this project are documented here. The project follows
## [Unreleased]
- The in-app "What's new" is shorter: the first sentence of each change, at most
five, with a link to the full release notes on GitHub.
## [1.25.2] — 2026-10-25
- Tier 1 networks can lay their own subsea cable (#22). Pick two cities with a

View file

@ -28,7 +28,12 @@ To play during development, open `site/index.html` directly or run `npm run serv
or any other attribution trailers.
- **Releases** happen by bumping `version` in `package.json` on `main` (see the
`release` skill). Small fixes or tweaks get a patch release (`x.y.Z`); new features a
minor release.
minor release. **At most one release per hour**: until the hour is up, push work with
its CHANGELOG bullets under `## [Unreleased]` and batch it into the next release. Only a
broken live game justifies an immediate hotfix.
- **Release notes in the app are short**: only the first sentence of each CHANGELOG bullet
(and at most five bullets) shows in "What's new", with a link to the full GitHub
release. Write that first sentence so it stands on its own.
- **Names are puns.** No real company names for networks, vendors, cables, banks,
data centers or exchanges (Cogentle, Goggle, NetChill, Junipurr, Arrrhipster…).
Real conference names (NANOG, RIPE, DENOG) are fine. Avoid lazy "-ish" names: find

View file

@ -2248,4 +2248,7 @@
"Replace ten of them and the cable pays for itself in about {n} months.":"Sostituiscine dieci e il cavo si ripaga in circa {n} mesi.",
"Cuts still happen, anchors and sharks included, but the repair ship is yours to call.":"I tagli succedono lo stesso, ancore e squali compresi, ma la nave di riparazione la chiami tu.",
"Lay the cable <small>{price}</small>":"Posa il cavo <small>{price}</small>",
"…and {n} more change":"…e {n} altra modifica",
"…and {n} more changes":"…e altre {n} modifiche",
"Read the full notes on GitHub":"Leggi le note complete su GitHub",
};

View file

@ -3339,10 +3339,18 @@ function whatsNew(returning,force){
try{seen=localStorage.getItem('sot-seen-version');localStorage.setItem('sot-seen-version',APP_VERSION);}catch(e){}
if(!force&&(!returning||seen===APP_VERSION))return false;
openModal(`<div style="display:flex;align-items:center"><div><div class="eyebrow">${tr('Release notes')}</div><h2 style="font-size:28px">${tr('New in Series of Tubes {v}',{v:esc(APP_VERSION)})}</h2></div><button class="x" data-act="${UI.started?'closeModal':'helpClose'}" aria-label="${tr('Close')}">×</button></div>
<ul class="notes">${RELEASE_NOTES.map(n=>`<li>${esc(n)}</li>`).join('')}</ul>
${notesHtml(RELEASE_NOTES,APP_VERSION)}
${returning&&S?`<p class="note">${tr('Your network {name} was saved and is waiting for you.',{name:esc(S.name)})}</p>`:''}
<div class="btns" style="margin-top:12px">${btn(UI.started?tr('Back to my network'):tr('Got it'),UI.started?'closeModal':'helpClose',{},'pink big')}<a class="b ghost" href="https://github.com/fjaeckel/seriesoftubes/blob/main/CHANGELOG.md" target="_blank" rel="noopener">${tr('Full changelog')}</a></div>`);
<div class="btns" style="margin-top:12px">${btn(UI.started?tr('Back to my network'):tr('Got it'),UI.started?'closeModal':'helpClose',{},'pink big')}${notesLong(RELEASE_NOTES)?'':`<a class="b ghost" href="https://github.com/fjaeckel/seriesoftubes/blob/main/CHANGELOG.md" target="_blank" rel="noopener">${tr('Full changelog')}</a>`}</div>`);
return true;}
/* In-app notes stay short: at most NOTE_MAX changes, each cut to its first sentence. When anything was cut, a
link leads to the full notes of this version on GitHub. The CHANGELOG and the GitHub release keep every word. */
const NOTE_MAX=5,NOTE_CH=140;
function slimNote(n){const m=String(n).match(/^(.+?[.!?])(\s|$)/);let t=m?m[1]:String(n);if(t.length>NOTE_CH)t=t.slice(0,NOTE_CH-1).replace(/\s+\S*$/,'')+'…';return t;}
const notesLong=ns=>ns.length>NOTE_MAX||ns.some(n=>slimNote(n)!==n);
function notesHtml(ns,ver){const more=Math.max(0,ns.length-NOTE_MAX);
return `<ul class="notes">${ns.slice(0,NOTE_MAX).map(n=>`<li>${esc(slimNote(n))}</li>`).join('')}${more?`<li class="meta">${trn('…and {n} more change','…and {n} more changes',more)}</li>`:''}</ul>`+
(notesLong(ns)?`<p style="margin:6px 0 0"><a class="b pink sm" href="https://github.com/fjaeckel/seriesoftubes/releases/tag/v${esc(ver)}" target="_blank" rel="noopener">${tr('Read the full notes on GitHub')}</a></p>`:'');}
function newerVer(a,b){const x=String(a).split('.').map(Number),y=String(b).split('.').map(Number);for(let i=0;i<3;i++){if((x[i]||0)>(y[i]||0))return true;if((x[i]||0)<(y[i]||0))return false;}return false;}
// While the game is open, look for a newer release now and then and offer a reload.
function checkUpdate(){

View file

@ -76,3 +76,19 @@ test('#46 an update that adds networks gives a courtesy route, and Tier 1 is sho
assert.equal(ev("BADGES.find(b=>b.id==='t1').ok()"), true, 'the badge stays');
assert.deepEqual(errors, []);
});
test('in-app release notes stay short and link to the full notes on GitHub', () => {
const { ev, errors } = load();
const long = ['Tier 1 networks can lay their own subsea cable (#22). Pick two cities with a landing station, pay a lot, wait.',
'Short one.', 'A 1.6T wave is now cheaper. More text here.', 'Four.', 'Five.', 'Six.', 'Seven.'];
const h = ev(`notesHtml(${JSON.stringify(long)},'9.9.9')`);
assert.match(h, /lay their own subsea cable \(#22\)\./);
assert.doesNotMatch(h, /Pick two cities/, 'only the first sentence');
assert.match(h, /A 1\.6T wave is now cheaper\./, 'decimals do not end a sentence');
assert.match(h, /and 2 more changes/);
assert.match(h, /releases\/tag\/v9\.9\.9/, 'links to the full notes');
const short = ev(`notesHtml(${JSON.stringify(['One fix.', 'Another fix.'])},'9.9.9')`);
assert.doesNotMatch(short, /releases\/tag/, 'short notes need no link');
assert.equal(ev(`slimNote('${'x'.repeat(300)}')`).length <= 140, true);
assert.deepEqual(errors, []);
});