Skip to content

feat(updates): add an opt-in beta update channel built from green main (needs owner OK) - #2805

Merged
devswha merged 7 commits into
mainfrom
feat/beta-channel
Nov 5, 2026
Merged

devswha merged 7 commits into
mainfrom
feat/beta-channel

Conversation

@devswha

@devswha devswha commented Nov 4, 2026 •

Copy link
Copy Markdown
Owner

What

An opt-in beta update channel, so a PC that opts in gets fixes from main within hours instead of at the next release. It is off by default, and a PC that did not opt in is never offered a beta.

  1. Server updater (server/updater.ts, shared/update.ts): on the beta channel the updater also fetches and takes beta/vX.Y.Z-beta.N tags. They live outside v* on purpose: the installers (install.sh, install.ps1), the Windows app setup, and the --latest checks in mac-dmg.yml/windows-app.yml read v* as releases, and git's version sort would rank a beta above its release. Tags are ordered in code (latestTag): v0.4.23 outranks every beta/v0.4.23-beta.N, and beta.10 outranks beta.9. A stable PC neither fetches nor considers betas. A beta installs exactly like a release: private checkout, typecheck, build, health check, and rollback if the health check fails. Nothing is ever downgraded. A PC that leaves the channel stays on its beta until a release is a descendant of it. The channel comes from OVIS_UPDATE_CHANNEL, else from the update-channel file in the app's state dir, else stable. It is read at every check, so writing the file takes effect without a restart. UpdateStatus.channel reports it. current_version stays the build's package.json version (the client's stale-tab check compares against it). A beta offer's notes are read under its base version.
  2. Desktop app (app/electron/src/updates.ts, main.ts): the same setting, read from the server's state dir (<userData>/server/update-channel) when the app starts. On beta the app reads the desktop-beta prerelease feed (beta-*.yml), with channel = "beta" and allowPrerelease set. allowDowngrade is forced back to false, because electron-updater turns it on whenever a channel is set. On stable the channel is pinned to latest.
  3. Workflow (.github/workflows/beta.yml, new): it runs after CI succeeds for a push to main (same repository only), or by hand from main.
    • tag picks the newest main commit with a successful CI push run, whichever run triggered it, so a queued or displaced run loses nothing and a manual run never publishes an unchecked commit. It tags that commit beta/vX.Y.Z-beta.N through the API. X.Y.Z is package.json's version, or its next patch once that version is released, and N counts up per version. A commit that a newer tag already contains gets no tag. A commit that is already tagged is rebuilt only by a manual run, which is how a failed desktop build is retried. Runs are serialized (concurrency: beta, no cancel).
    • host-build / host-publish: when no build of the Rust PTY host exists for the commit's crates/pty-sidecar tree (the release of package.json's version was built from another tree, or is not out yet), the run builds one with pty-sidecar.yml and attaches it to the prerelease pty-sidecar-<tree>, manifest last. That happens before the beta tag exists, because the updater's install of the beta fetches the host. It is built once per crate tree.
    • desktop stages hc, Bun and the server at main's own version, then packages the app at the beta version: Linux x64 and arm64 AppImages and an arm64 Mac build. The Mac build is signed and notarized only when DESKTOP_MAC_SIGN is true, with the same gate and secrets as the desktop release job. The app is built with the stable feed, so an app that leaves the channel waits for the release.
    • desktop-publish uploads the builds to the rolling desktop-beta prerelease, feed files last. It keeps the previous beta's files, for an app that read the old feed moments before, and removes older ones. A prerelease is never GitHub's latest, so the stable feed (releases/latest/download) never sees it. The job with the write token runs no repository code.

No tag is pushed by hand: the workflow makes the beta tags. No workflow triggers on beta/*, and tags created with GITHUB_TOKEN trigger no workflows.

  1. Rust PTY host for betas (scripts/pty-sidecar.ts): install takes the host of release v<package.json version> only when that release was built from this checkout's crate tree. Now, when the release has no host or has another tree's, it falls back to the pty-sidecar-<tree> prerelease, which goes through the same checks: crate tree, SHA-256, and that it runs here. Without this, every beta since fix(usage): report a browser sign-in's own outcome #2649 changed the crate would run without the Rust host, and the desktop app, which ships Bun but not Node, would mirror its panes.

Needs owner OK

This adds a workflow that creates tags, publishes a prerelease, and uses the Mac signing secrets (behind DESKTOP_MAC_SIGN).

Coordination

release.yml and desktop.yml are untouched (they belong to the desktop release work). beta.yml repeats desktop.yml's build steps for now. Once desktop.yml takes a channel input, it can call that instead.

Validation

  • bun test server/updater.test.ts: new cases with real Git repositories and builds. A stable PC is never offered a beta tag (or a v* pre-release). A beta PC opts in through the file without a restart, installs the newest beta, and then takes the release that follows. Unit cases cover tag ordering and channel precedence. The old updater had no beta channel: its RELEASE_TAG filter dropped every -beta.N tag, so the beta install case cannot pass against it.
  • bun test scripts/pty-sidecar.test.ts: a new case installs the host from the crate tree's prerelease when the release's is from other sources, and refuses one built from other sources or one whose SHA-256 does not match.
  • bun test app/electron/src/updates.test.ts and bun run typecheck in app/electron.
  • bun run check fast: passed. That covers workflow syntax and actionlint, typecheck, build, and unit tests (11247 pass, 0 fail).
  • The tag-picking script from beta.yml, run against a scratch Git repository with a stubbed gh: a released commit, a new commit (beta/v0.4.23-beta.1 from 0.4.22 released), an already-tagged commit (skipped automatically, reused by hand), and an older commit contained by a newer beta (skipped).
  • actionlint on beta.yml.
  • Not run: the workflow itself (it runs only on main), and a real electron-updater update from a desktop-beta feed.

@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 31 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 029780f and d1f1709.

Files selected for processing: 13

  • .github/workflows/beta.yml
  • app/electron/src/main.ts
  • app/electron/src/updates.test.ts
  • app/electron/src/updates.ts
  • changelog.d/beta-update-channel.md
  • docs/guide.md
  • scripts/pty-sidecar-workflow.test.ts
  • scripts/pty-sidecar.test.ts
  • scripts/pty-sidecar.ts
  • server/supervisor.ts
  • server/updater.test.ts
  • server/updater.ts
  • shared/update.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

… and stage the desktop beta at main's version
@devswha

devswha commented Nov 4, 2026

Copy link
Copy Markdown
Owner Author

Review round 1 (omo: BLOCK at 348e974, Codex Terra xhigh), resolved in the next commit:

  • HIGH: beta tags under v* would keep a stable release from becoming GitHub's latest. mac-dmg.yml and windows-app.yml take the top of git tag --list 'v[0-9]*' --sort=-v:refname. The installers and the Windows setup read v* too. Fixed: beta tags are now beta/vX.Y.Z-beta.N. Only a beta-channel updater fetches refs/tags/beta/*.
  • HIGH/MEDIUM: desktop betas shipped without the Rust PTY host (the version bump ran before the host was fetched by version). Fixed: bun scripts/build.ts stage runs at main's own version, and only package runs at the beta version.
  • MEDIUM: a tag-derived current_version would leave a tab permanently flagged as stale (staleClientVersion), and releaseVersion would return null. Fixed: current_version stays the build's package.json version. Release.version is removed.
  • MEDIUM: a manual run could publish a commit CI had not passed; a displaced pending run could skip the newest commit. Fixed: every run picks the newest main commit with a successful CI push run.
  • MEDIUM/LOW: "Re-run all jobs" could not retry a failed desktop build. Fixed: a manual run reuses the beta tag that already points at the commit.
  • MEDIUM/LOW: the previous build's assets were deleted right after the feed swap. Fixed: the previous beta's files stay, and older ones go.
  • LOW: a beta offer had no notes. Fixed: notes are read under the beta's base version.

Left as is (LOW):

  • A desktop app on beta reads only the beta feed. The release commit itself gets no new beta, so the app moves on with the next main commit's beta (X.Y.(Z+1)-beta.1), which contains the release.
  • --clobber briefly replaces a feed file. A client that hits that window retries at its next check (6 h).
  • server/machines.ts releaseVersion() reads a beta latest_version as null in the machines roster. That affects display only.

This PR adds a workflow that creates tags, publishes a prerelease, and uses the Mac signing secrets: it needs the owner's OK before merge.

@devswha

devswha commented Nov 4, 2026

Copy link
Copy Markdown
Owner Author

Review round 2 (omo: BLOCK at 6e22efb, Codex Terra xhigh), resolved in the next commit:

  • HIGH (omo, reproduced): betas lose the Rust PTY host. scripts/pty-sidecar.ts install only takes the host of release v<package.json version> when it was built from this checkout's crates/pty-sidecar tree. Main's tree (8bc8d833) already differs from v0.4.22's (962c65e1). Fixed: the beta workflow builds the host with pty-sidecar.yml for any crate tree that has no build yet, and attaches it to the prerelease pty-sidecar-<tree> before it creates the beta tag. install falls back to that prerelease, with the same crate tree, SHA-256 and runs-here checks (new test in scripts/pty-sidecar.test.ts).
  • HIGH (Codex): a beta made while a release is being prepared has no host. The same fallback covers this case, so the interim "no beta until released" rule from the previous commit is removed again.
  • Lead's blocker check: server/updater.ts at v0.4.18 through v0.4.22 fetches only +refs/tags/v*:refs/tags/v* and offers only ^vX.Y.Z$. Beta tags are beta/*, which no released updater fetches. Pinned by a test: a stable check leaves no refs/tags/beta/ in the checkout.

Left as follow-ups (MEDIUM/LOW, round limit reached):

  • MEDIUM: a desktop app on beta reads only the beta feed. After a release, it takes the next green main commit's beta (X.Y.(Z+1)-beta.1, which contains the release) instead of the release build itself.
  • LOW: a release tagged on an older commit than the newest beta ranks above that beta for its base version, so a PC on the release waits for the next beta.
  • LOW: a beta's running version shows package.json's (the released version). The tag-derived version was dropped because it broke the client's stale-tab check.
  • LOW: with DESKTOP_MAC_SIGN off, beta-mac.yml is published for an unsigned build, so a signed Mac app on beta logs a failed update.
  • LOW: server/machines.ts releaseVersion() shows a beta latest_version as null.
  • updateChannel exists twice (server and desktop app): sharing it would pull the server updater's process and git code into the desktop main bundle.

@devswha

devswha commented Nov 4, 2026

Copy link
Copy Markdown
Owner Author

Final review at 9257e28. CodeRabbit did not review this head (review limit reached), so these review agents stand in for it:

  • omo: CLEAR. No reproduced HIGH. Remaining LOWs:
    • A desktop app that leaves the beta channel waits on releases/latest/download, which has no stable desktop feed until the desktop release workflow (separate PR) attaches latest-*.yml. Until then it logs a failed update check.
    • A desktop app on beta takes the next main commit's beta after a release, not the release build itself.
    • A beta's running version shows package.json's version.
    • The PTY host install's two attempts each have their own 90 s deadline, inside the updater's 120 s bound.
  • Codex (Terra 6.1 fast, xhigh): no HIGH findings at 9257e28.

Round 1 and round 2 findings and their fixes are in the comments above. Not run: the workflow itself (it runs on main only).

@devswha

devswha commented Nov 4, 2026

Copy link
Copy Markdown
Owner Author

Owner-approved (delegated to the lead on 2026-11-05): the new beta.yml workflow and its use of the Mac signing secrets behind DESKTOP_MAC_SIGN.

@devswha

devswha commented Nov 5, 2026

Copy link
Copy Markdown
Owner Author

Merge note: owner decisions delegated to the lead (workflow/signing approved). omo CLEAR at this head, Codex rounds done (no HIGH left), required checks green.

@devswha
devswha merged commit fda9c00 into main Nov 5, 2026
44 of 48 checks passed
@devswha
devswha deleted the feat/beta-channel branch November 5, 2026 01:05
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