Skip to content

feat: add beta release channel plumbing - #507

Merged
khaira777 merged 6 commits into
mainfrom
fm/flocafe-beta-release-channel
Aug 24, 2026
Merged

khaira777 merged 6 commits into
mainfrom
fm/flocafe-beta-release-channel

Conversation

@khaira777

@khaira777 khaira777 commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Intent

Implement FloCafe's beta release channel plumbing (epic #463, policy decision #503). Policy (decided, do not revisit): beta builds publish as prerelease-flagged GitHub releases with tags like 3.3.1-beta.1 carrying correct electron-updater channel manifests so beta-enabled clients can find them; stable installs (pre-releases disabled) can never be offered a beta; promotion from beta to stable is always a deliberate human action with no automatic path; nightly releases are explicitly rejected; betas later serve as the N+1 update source for the #468 runtime upgrade matrix.

Delivered: (1) removed the rejected nightly publish path from .github/workflows/release.yml and scripts/verify-release-assets.cjs (the beta publish capability itself already exists in release.yml via workflow_dispatch channel=beta from prior work #488 - verified against installed electron-builder 26.x that GitHub publish configs generate exactly one channel manifest set, beta builds emit only beta*.yml, never latest.yml, so the stable feed is structurally isolated); documented these electron-updater 6.8.x channel semantics in docs/release-process.md. (2) Added workflow-text assertions to tests/release-config.test.ts proving stable-feed isolation: PRERELEASE/MANIFEST_PREFIX gated on non-stable channels, --latest=false on draft creation, promotion job refuses non-stable/prerelease releases, stable-only AppX Store submission, zero nightly paths. (3) Implemented updates:get-beta-channel()/updates:set-beta-channel(enabled) IPC across main/index.ts + main/preload.ts + frontend/src/types/electron.d.ts, persisted in the SQLite settings store as updates.beta_channel_enabled, resolving through new pure module main/update-channel.ts; switching is refused while an update is staged or in flight (#467 honest-state model), then resets to real pre-check state and re-checks the new feed; no renderer UI files touched (sibling crew owns those). (4) Added cut-a-beta and manual promote-to-stable runbooks to docs/release-process.md.

Acceptance: manual dispatch of channel=beta produces a draft/prerelease release without touching the stable feed; stable clients never see betas; IPC round-trip persists across restarts; workflow-text tests pass; lint/build/i18n unaffected.

Environment notes for validation: the pipeline worktree starts without node_modules - run npm ci before testing; use assertion/log-based evidence only, no screenshots.

What Changed

  • Removed nightly publishing paths and hardened release workflow checks for beta/stable feed isolation, prerelease handling, manual promotion, and stable-only Store submission.
  • Added persisted beta-channel IPC plumbing with update-state guards, updater feed switching, and restart-safe settings storage.
  • Documented beta cut/promotion runbooks and channel semantics, with expanded release, API contract, and update-channel test coverage.

Risk Assessment

⚠️ Medium: The normal beta toggle path is bounded, but restore/reset can leave the runtime updater on a feed inconsistent with the persisted preference and the release-channel documentation is contradictory.

Testing

All targeted automated checks passed. The actual main-process beta IPC handlers returned the expected initial value, successful write, persisted SQLite value, and same value after database restart; resolver output confirmed stable-feed isolation, explicit beta opt-in, beta-build channel behavior, and nightly fallback. No screenshots were produced because the supplied validation context requires assertion/log evidence only; no test-generated files remain in the worktree.

Evidence: Effective update-channel resolution scenarios
stable-off {"channel":null,"allowPrerelease":false,"allowDowngrade":false}
stable-on {"channel":"beta","allowPrerelease":true,"allowDowngrade":false}
beta-build {"channel":"beta","allowPrerelease":true,"allowDowngrade":true}
nightly-off {"channel":null,"allowPrerelease":false,"allowDowngrade":false}
Evidence: Main-process beta IPC persistence harness
ipc-before false
ipc-set-result {"success":true}
sqlite-stored-value true
ipc-after-restart true
Evidence: Beta updater manifest mapping
beta-manifests ["beta.yml","beta-mac.yml","beta-linux.yml","beta-linux-arm64.yml"]
beta-windows-mapping accepted

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

🔧 **Rebase** - 2 issues found → auto-fixed ✅
  • ⚠️ main/index.ts - merge conflict rebasing onto origin/main
  • ⚠️ package.json - merge conflict rebasing onto origin/main

🔧 Fix applied.
✅ Re-checked - no issues remain.

⚠️ **Review** - 2 issues (1 warning, 1 info)
  • 🚨 main/index.ts:811 - The new IPC registrations are inserted inside an extra restart-and-install handler at line 811, while the original handler remains at line 848. They therefore are not registered during initialization, contradicting the required “IPC round-trip persists across restarts” behavior. Register the beta handlers alongside the existing handler and retain only one restart registration.
  • ⚠️ main/update-channel.ts:65 - resolveUpdateChannel enables allowDowngrade for a stable install that opts into beta. A stable 3.4.0 client can therefore auto-download a lower 3.4.0-beta.1 because autoDownload is enabled, risking an updater/schema downgrade. Only a prerelease-stamped install should enable downgrade; update the resolver and its assertion at tests/update-channel.test.ts:52.
  • ⚠️ tests/release-config.test.ts:169 - The new stable-feed checks assert behavior by searching shell snippets and entire source files with includes, so comments or dead code can satisfy them without proving workflow behavior. Keep the required coverage, but use normalized workflow structure and executable metadata/argument behavior instead of source-content matching.
  • ⚠️ docs/release-process.md:114 - The beta runbook says to push the tag and then manually dispatch the workflow, but release.yml already triggers on pushed tags. A successful automatic run publishes the release; the instructed manual run is then queued and fails because the release is no longer a draft. Clarify whether beta releases are push-triggered or dispatch-only and make the runbook match.

🔧 Fix: Fixed beta channel review findings and verified focused checks
3 warnings still open:

  • ⚠️ main/index.ts:813 - The beta IPC is exposed for managed installs too. On MAS/MSIX builds, updater setup is skipped; on Linux deb/rpm/snap installs, checks return store-managed/linux-managed. Nevertheless the Settings toggle sees a valid boolean API, reports success, and persists an opt-in that can never check a beta feed. Gate this contract to self-updating artifacts or return unsupported for managed installs.

  • ⚠️ docs/release-process.md:114 - The beta runbook instructs adding ## [X.Y.Z-beta.N] to CHANGELOG.md, but the workflow strips the prerelease suffix and calls changelog-notes.sh with X.Y.Z; that script only matches ## [X.Y.Z]. Following the runbook for 3.3.1-beta.1 therefore makes draft creation fail due to missing release notes.

  • ⚠️ docs/release-process.md:116 - The workflow still triggers on every numeric tag, including beta tags, so pushing 3.3.1-beta.1 automatically runs and publishes the beta. The runbook then instructs a manual dispatch for the same tag; that second run finds the published release and exits at release.yml:168-170. Choose one beta trigger path and align the runbook and workflow.

  • ⚠️ main/index.ts:99 - New beta-channel handlers bypass the shared withDatabaseRequest maintenance boundary, allowing preference reads/writes to race backup/restore/reset operations. Route them through the database request gate and serialize the channel transition.

  • ⚠️ main/index.ts:836 - Database restore can change updates.beta_channel_enabled, but the updater is reconfigured only at startup or toggle time. After restoring beta-off settings, the running updater may still fetch beta updates (or miss them in the reverse case). Re-derive the channel at the restore/check boundary or define restore behavior.

  • ℹ️ docs/release-process.md:13 - The docs say non-beta prereleases get stable updates only, but betaOptIn=true deliberately overrides that stamp and follows the beta feed. Align the documentation with this opt-in behavior or make unsupported prereleases always stable.

🔧 Fix: Gated beta preference IPC through serialized database requests
2 issues (1 warning, 1 info) still open:

  • ⚠️ main/index.ts:844 - After restoring or resetting the database, the persisted beta preference can change but the running updater is not reconfigured. A stable install with beta enabled can restore a backup with beta disabled, then checkForUpdates() still uses beta.yml and may stage a prerelease. Re-derive the channel at the restore/reset completion boundary.
  • ℹ️ docs/release-process.md:13 - The docs say any non-beta prerelease gets stable updates only, but resolveUpdateChannel assigns the beta feed when betaOptIn=true even for nightly/alpha versions. Align the documentation with the explicit opt-in behavior or make unsupported prerelease stamps always use stable.
✅ **Test** - passed

✅ No issues found.

  • npm ci
  • npm run test:update-channel
  • npm run test:update-state
  • npm run test:update-ui
  • npm run test:electron-api-contract
  • npm run test:release-config
  • Inline main-process IPC/SQLite close-reopen harness
  • Transient artifact cleanup check

✅ No issues found.

  • npm run test:update-channel
  • npm run test:electron-api-contract
  • npm run test:update-ui
  • npm run test:update-state
  • npm run test:release-config
  • Inline resolver scenarios via node -r ts-node/register/transpile-only for stable opt-out, stable beta opt-in, beta-stamped builds, and rejected nightly stamps
  • Inline stubbed-Electron harness invoking updates:get-beta-channel and updates:set-beta-channel, then closing/reopening SQLite and reading through the IPC handler
  • Inline release-verifier checks for beta manifest names and Windows platform mapping
  • git diff --check and final worktree-residue inspection
✅ **Document** - passed

✅ No issues found.

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

✅ No issues found.

Implement the beta release channel policy:

- Enforce #503's rejected-nightly decision: remove the nightly channel
  option and edge-mapping branches from release.yml and restrict
  scripts/verify-release-assets.cjs to latest/beta manifests.
- Document verified electron-updater channel semantics for this app's
  electron-builder 26.x / electron-updater 6.8.x pair in
  docs/release-process.md: GitHub publish configs generate exactly one
  channel manifest set (beta builds emit only beta*.yml), stable clients
  follow GitHub's Latest pointer and ignore prereleases, and beta clients
  resolve the newest feed entry then fetch that release's channel manifest
  with a latest.yml fallback for stable targets.
- Add workflow-text assertions to tests/release-config.test.ts proving
  stable-feed isolation: PRERELEASE/MANIFEST_PREFIX gating, --latest=false,
  prerelease-flagged promotion refusal, stable-only AppX submission, and
  zero nightly publish paths.
- Add main/update-channel.ts (pure) resolving the effective updater feed
  from the running version stamp plus a persisted opt-in; nightly/alpha
  stamps fall back to stable updates.
- Wire the beta-channel opt-in across main + preload + electron.d.ts as
  updates:get-beta-channel / updates:set-beta-channel, persisted in the
  SQLite settings store (updates.beta_channel_enabled). Switching is
  refused while an update is staged or in flight (#467 honest-state) and
  resets the updater to a real pre-check state followed by an immediate
  re-check against the new feed.
- Add docs/release-process.md runbooks for cutting a beta and manually
  promoting it to stable; betas remain the N+1 source for the #468 matrix.
- New tests/update-channel.test.ts wired into npm test.
@greptile-apps

greptile-apps Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds persisted beta-channel selection for desktop updates and restricts release automation to stable and beta channels.

  • Adds main/preload IPC and pure channel-resolution logic for beta opt-in.
  • Removes nightly release paths and updates release verification coverage.
  • Documents beta publication and explicit stable promotion procedures.

Confidence Score: 2/5

The PR is not safe to merge until managed installs reject the unsupported beta opt-in and the beta runbook is aligned with the executable release workflow.

Managed installations can report a successful beta opt-in without ever checking that feed, while following the documented beta procedure either fails changelog extraction or launches a redundant release run that is refused after publication.

Files Needing Attention: main/index.ts, main/preload.ts, docs/release-process.md, .github/workflows/release.yml

Important Files Changed

Filename Overview
main/index.ts Adds persisted beta-channel IPC handlers and reconfigures the updater after safe state-transition checks.
main/update-channel.ts Defines the pure stable/beta channel resolution and strict persisted-value parsing.
.github/workflows/release.yml Removes nightly publishing and keeps prerelease publication and stable promotion as separate release paths.
docs/release-process.md Documents beta channel semantics, beta release operations, and manual stable promotion.
scripts/verify-release-assets.cjs Restricts release asset verification to stable and beta manifest sets.

Reviews (2): Last reviewed commit: "no-mistakes(document): Corrected stale b..." | Re-trigger Greptile

…heckout no longer fails under `pipefail` when calculating the optional previous tag. Verified with `npm run test:release-config` and `git diff --check`; both passed
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