Skip to content

Add a beta release channel with an in-app opt-in and pre-migration DB snapshots - #28

Merged
Automage merged 1 commit into
mainfrom
feat/beta-release-channel
Sep 15, 2026
Merged

Automage merged 1 commit into
mainfrom
feat/beta-release-channel

Conversation

@Automage

Copy link
Copy Markdown
Contributor

Summary

Adds a beta release channel on top of the existing GitHub Releases pipeline, an in-app opt-in for it, and pre-migration snapshots of the app database.

Release workflow (.github/workflows/release-desktop.yml)

  • A tag of the form vX.Y.Z-beta.N builds with the version taken from the tag (-c.extraMetadata.version) instead of app/package.json, so a beta can be cut from any commit without a version-bump commit.
  • Once the sourcemaps are attached, the beta's GitHub release is flagged as a pre-release and published. GitHub excludes pre-releases from /releases/latest, which is what electron-updater resolves for stable installs and what the download permalink serves, so beta builds never reach the stable channel. electron-builder does not set this flag from the version string on its own.
  • Stable tags gain two guards: the tag must match the committed app/package.json version, and the release must not be flagged as a pre-release.
  • Only the beta prerelease identifier is accepted. It is the one electron-updater treats as a channel that graduates to stable; other identifiers would never be offered the stable release.

App

  • New updateChannel setting (stable | beta), shown in Settings → About as Receive beta updates.
  • The host sets it to beta when the running version changes to a prerelease, so installing a beta build enrolls the install. It stays set until the user turns it off.
  • The launcher forwards the setting to the updater, which maps it onto electron-updater's allowPrerelease. The boot update check now runs from the first settings push (or immediately with the build's default if the host failed to start), so it always uses the chosen channel. The switch is disabled while a check or download is in flight.
  • Turning beta off on a beta build leaves the install on its current version until the next stable release, since downgrades are refused by the updater.

Database

  • Before an existing database is upgraded (before the DDL and any numbered migration), createDb() writes a VACUUM INTO snapshot to <home>/backups/app.db.<utc-stamp>.v<from>.bak. This gives a build with an older schema a file to restore by hand, since migrate() refuses a database stamped newer than the build.
  • Snapshots are best-effort (a failure is logged and the upgrade proceeds), taken with the DB in WAL mode as a consistent standalone copy, and never pruned.

Verification

  • bun test app/src: 425 pass, 0 fail
  • bun run --cwd app typecheck: clean
  • bunx @biomejs/biome check on all touched files: clean
  • bun run --cwd app build: succeeds
  • Workflow YAML parses; the tag classifier was exercised against v0.2.8, v0.2.8-beta.1, v0.2.8-beta.12 (accepted) and v0.2.8-rc.1, v0.2.8-beta, v0.2.8-alpha.1 (rejected).
  • electron-updater 6.6.2 / electron-builder 26.8.1 behaviour (pre-release resolution, channel walk, latest-mac.yml fallback, extraMetadata merge, release-type defaulting) was verified against the installed library sources.

No beta has been cut with this workflow yet; the first vX.Y.Z-beta.1 tag after merge is the live test.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Deploying opentradeoss with  Cloudflare Pages  Cloudflare Pages

Latest commit: 755ab7d
Status: ✅  Deploy successful!
Preview URL: https://59284473.opentradeoss.pages.dev
Branch Preview URL: https://feat-beta-release-channel.opentradeoss.pages.dev

View logs

… snapshots

Release workflow: a tag of the form vX.Y.Z-beta.N builds with the version
taken from the tag (-c.extraMetadata.version) instead of app/package.json,
and once the sourcemaps are attached the GitHub release is flagged as a
pre-release and published. GitHub excludes pre-releases from
/releases/latest, which is what electron-updater resolves for stable
installs and what the download permalink serves, so beta builds stay off
the stable channel. Stable tags gain two guards: the tag must match the
committed version, and the release must not be flagged as a pre-release.
Only the beta identifier is accepted, since it is the one electron-updater
treats as a channel that graduates to stable, and version numbers must be
strict semver (no leading zeros) so the updater can parse them.

App: a new updateChannel setting (stable | beta) is shown in Settings →
About as "Receive beta updates". The host sets it to beta when the running
version changes to a prerelease, so installing a beta build enrolls the
install; it stays set until the user turns it off. The launcher forwards
the setting to the updater, which maps it onto allowPrerelease. The boot
update check now runs from the first settings push (or immediately with
the build's default if the host failed to start) so it always uses the
chosen channel, and the switch is disabled while a check or download is in
flight. Turning beta off on a beta build leaves the install on its current
version until the next stable release, since downgrades are refused.

Database: before an existing database is upgraded, createDb() writes a
VACUUM INTO snapshot to <home>/backups/ so an older build's schema can be
restored by hand. Snapshots are best-effort, logged to the host log, taken
at most once per source schema version, and never pruned.
@Automage
Automage force-pushed the feat/beta-release-channel branch from a8ffa68 to 755ab7d Compare September 15, 2026 21:11
@Automage
Automage merged commit a94b076 into main Sep 15, 2026
1 check passed
@Automage
Automage deleted the feat/beta-release-channel branch September 15, 2026 21:17
@Automage Automage mentioned this pull request Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant