Skip to content

feat(updater): in-app nightly release channel#497

Open
NewtTheWolf wants to merge 7 commits into
TabularisDB:mainfrom
NewtTheWolf:feat/nightly-update-channel
Open

feat(updater): in-app nightly release channel#497
NewtTheWolf wants to merge 7 commits into
TabularisDB:mainfrom
NewtTheWolf:feat/nightly-update-channel

Conversation

@NewtTheWolf

Copy link
Copy Markdown
Collaborator

What

Adds an in-app release channel selector (Stable / Nightly) so users on direct installs can opt into nightly builds and receive in-app updates from the newest nightly-* prerelease. Default stays stable — nothing changes for users who never touch the setting.

Follow-up to #419 (nightly workflow) and #490 (glibc container).

How it works

  • Config: new AppConfig.release_channel ("stable" default | "nightly"), persisted like the other update settings. Single source of truth — the channel never crosses the IPC boundary.
  • Backend (updater.rs): for the nightly channel, check_for_updates / download_and_install_update resolve the newest nightly-* prerelease at runtime (GitHub /releases → newest by published_at), read its latest.json asset URL, and override the tauri-plugin-updater endpoint with it. Stable path is untouched. Nightlies are signed with the same key, so the existing tauri.conf.json pubkey validates them — no key work.
  • UI (InfoTab.tsx): segmented Stable/Nightly control in the Updates section, only for direct installs (installationSource == null); managed installs (AUR/Snap/Flatpak) keep the existing "managed by package manager" note. Nightly shows a warning banner.

Versioning (the important part)

The updater compares via SemVer, where a prerelease sorts below its base — so a naive 0.15.0-nightly.<ts> would be seen as older than stable 0.15.0 and never offered. To fix this, the nightly build bakes the next patch as its base:

0.15.0 (stable)  →  nightly = 0.15.1-nightly.<UTC-ts>
0.15.0  <  0.15.1-nightly.<ts₁>  <  0.15.1-nightly.<ts₂>  <  0.15.1 (next stable)
  • A nightly always supersedes the current stable.
  • Any real next release (patch/minor/major) supersedes the nightly.
  • No manual main version bump needed; the base auto-tracks tauri.conf.json.

A stable release then "promotes" the channel by shipping that same base without the -nightly.<ts> suffix (convention on the release cut for now; automating it in the release path is a follow-up, since it touches the production release process).

Also hardens is_newer_version with a SemVer fallback so a user running a nightly build can still be offered the stable release when switching back to the stable channel (the old 3-part-only parser returned false for prerelease versions, stranding them).

Testing

  • Rust: unit tests for nightly resolution (select_newest_nightly, nightly_latest_json_url) and the prerelease version comparison (is_newer_version nightly↔stable ordering). cargo test updater:: → 25 pass.
  • Frontend: InfoTab tests — selector renders on direct install, persists the channel, hidden for managed installs. 4 pass.
  • The channel resolution was verified end-to-end against the real nightly-20260718-e8e729c release (its signed latest.json validates against the pubkey).

Notes / out of scope

  • Version bump convention: when cutting a stable release, bump to the current nightly base so it drops the -nightly suffix cleanly. Documented here; release-path automation is a follow-up.
  • Channel-scoped update cache (nightly path currently skips the cache) and deduping the stable check onto the plugin-updater are left as follow-ups.

A prerelease sorts below its own base in SemVer, so `0.15.0-nightly.<ts>`
would be seen as older than stable 0.15.0 and never offered. Bake the NEXT
patch as the base (`0.15.1-nightly.<ts>`) so a nightly always supersedes the
current stable, and any real next release (patch/minor/major) supersedes the
nightly. A stable cut promotes the channel by shipping that base without the
`-nightly.<ts>` suffix.
Comment thread src-tauri/src/config.rs
/// Defaults to the built-in instance when unset.
pub tabularium_registry_url: Option<String>,
/// Update channel: "stable" (default) or "nightly". None ⇒ stable.
pub release_channel: Option<String>,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CRITICAL: release_channel is not persisted by save_config

The save_config function explicitly merges every field with if config.X.is_some(), but release_channel has no corresponding block. When the frontend calls updateSetting("releaseChannel", "nightly"), the backend receives an AppConfig where only release_channel is Some, and the field is silently dropped. The channel selector appears to work in the UI but resets on app restart.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

echo "Patched version to $v"

- uses: tauri-apps/tauri-action@v0.6.1
env:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: sed -i fails on macOS BSD sed

This step runs on all platforms including macOS runners, but sed -i without a backup extension is a GNU-ism. BSD sed on macOS requires sed -i '' or sed -i.bak, causing the macOS build to fail.

Suggested change
env:
sed -i.bak "0,/^version = \".*\"/s//version = \"$v\"/" src-tauri/Cargo.toml && rm -f src-tauri/Cargo.toml.bak

Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

kilo-code-bot Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 1
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

CRITICAL

File Line Issue
src-tauri/src/config.rs 67 release_channel not persisted by save_config

WARNING

File Line Issue
.github/workflows/build.yml 147 sed -i fails on macOS BSD sed
Files Reviewed (8 files)
  • .github/workflows/build.yml - 1 issue
  • .github/workflows/nightly.yml - 0 issues
  • src-tauri/src/config.rs - 1 issue
  • src-tauri/src/updater.rs - 0 issues
  • src/components/settings/InfoTab.tsx - 0 issues
  • src/contexts/SettingsContext.ts - 0 issues
  • src/i18n/locales/en.json - 0 issues
  • tests/components/settings/InfoTab.test.tsx - 0 issues

Fix these issues in Kilo Cloud


Reviewed by kimi-k2.6 · Input: 143K · Output: 34.2K · Cached: 1.9M

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