Skip to content

A publish that builds what it ships - #856

Merged
sridharkalaibala merged 3 commits into
developfrom
fix/a-publish-that-builds-what-it-ships
Sep 17, 2026
Merged

sridharkalaibala merged 3 commits into
developfrom
fix/a-publish-that-builds-what-it-ships

Conversation

@sridharkalaibala

Copy link
Copy Markdown
Contributor

The root cause of tonight's silent installer, and it is one line.

frontend/public/ is gitignored build output. Nothing in the repository holds it, so whatever is on the packaging machine's disk when electron-builder runs is what goes into the exe.

Every build variant guards that with a prebuild:* step, which npm runs automatically and which calls prepare:bundle and so prepare:frontend. That script runs the gulp build and then refuses to continue if the artifacts are older than the run, so a stale bundle cannot get past it.

publish had no such step. One script out of eight, and it is the one that makes the installer customers actually receive.

"publish": "electron-builder --win --x64 --publish always"

What it cost

The exe on a customer machine carried a current main process: src/kitchen-call.js, src/kitchen-announce.js with both switches, the posnic:kitchen-call preload bridge, the autoplay switch, all correct and all verifiable by reading the asar. And a dashboard.20f9c50d.js built before the renderer half of that feature existed, containing no kitchenCall and no speechSynthesis.

So the main process sent its announcement to a page where nothing was listening. Every file was present on disk. One of them was simply older than the code that needed it. Nothing failed, nothing logged, and the feature looked shipped.

frontend/static/script/js/core/kitchen-call.js was even in the package, as an unbuilt source file sitting beside the bundle that should have contained it.

The change

publish now mirrors every other variant: clear:brand-seed, check:mongodb, prepare:bundle, then electron-builder.

Tests

tests/a-build-builds-what-it-ships.test.js

  • there is more than one way to make an installer, so the sweep below is not passing by finding nothing
  • every script that invokes electron-builder prepares first, by its own line or by a pre script npm runs for it
  • the preparation is the one that refuses stale artifacts, so "we ran a build" cannot quietly become "the build failed and the old files are still here"

Verified failing on the parent commit, where it names publish exactly.

The rule is asserted rather than the single script, because the next variant somebody adds will be added the way the last one was.

Promote develop to main: the kitchen can make a sound
Release: promote develop to main (the printed bill and the kitchen ticket)
frontend/public/ is gitignored build output, so whatever is on the
packaging machine's disk when electron-builder runs is what goes into the
exe. Every build variant guards that with a prebuild step that calls
prepare:bundle, which runs the gulp build and then refuses to continue if
the artifacts are older than the run.

publish had no such step. One script out of eight, and it is the one that
makes the installer customers receive.

What that cost today: an exe carrying a current main process - the
kitchen announcement, the tone, the preload bridge, all correct - and a
dashboard bundle built before the renderer half of that feature existed.
The main process sent posnic:kitchen-call to a page where nothing was
listening, so the kitchen stayed silent. Every file was present on disk;
one was simply older than the code that needed it. Nothing failed and
nothing logged, and the feature looked shipped.

The test asserts the rule rather than that one script, because the next
variant somebody adds will be added the way the last one was.
@sridharkalaibala
sridharkalaibala merged commit 0c3dfed into develop Sep 17, 2026
9 checks passed
@github-actions github-actions Bot added the ready for QA Merged to develop and live on develop.posnic.io - anyone can test it label Sep 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Merged to develop. Anyone can test this - you do not need write access.

Try it at https://develop.posnic.io, or run it yourself:

git fetch origin develop && git checkout develop
npm install && npm --prefix api install
npm run dev   # then http://localhost:3000

When you have tested it, say what you did and what happened, and set
QA passed or QA failed. If you cannot set labels, just comment -
a maintainer will.

Reporting that something is broken is as useful as fixing it. It is
better found here than by a shopkeeper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for QA Merged to develop and live on develop.posnic.io - anyone can test it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant