Skip to content

Add nightly build support#3623

Open
wojtekn wants to merge 2 commits into
trunkfrom
add-nightly-build-support
Open

Add nightly build support#3623
wojtekn wants to merge 2 commits into
trunkfrom
add-nightly-build-support

Conversation

@wojtekn
Copy link
Copy Markdown
Contributor

@wojtekn wojtekn commented May 26, 2026

Related issues

How AI was used in this PR

Claude helped implement the changes. All code was reviewed and iterated on by the author.

Proposed Changes

  • Enable automatic update polling for dev builds — previously dev builds had polling disabled entirely; manual "Check for Updates" already worked but nothing fired automatically
  • 24-hour TTL for nightly update checks — timestamp stored in app.json (lastNightlyUpdateCheck) so the check fires at most once per day rather than on every launch
  • buildUpdateFeedUrl({ channel? }) — extracted helper replacing the duplicated inline URL construction in setupUpdates and pollLinuxUpdates; adds optional channel param support
  • switchToNightlyAndUpdate() — exported from updates.ts; points autoUpdater at ?channel=nightly feed and triggers an immediate check, letting Electron's existing update flow handle download and the restart prompt. On Linux, calls pollLinuxUpdates({ channel: 'nightly' }) directly
  • maybePromptNightlySwitch() — detects signed-in Automatticians on stable builds via /rest/v1.2/read/teams, shows a one-time prompt offering to switch to nightly with a "Don't ask again" checkbox. On accept, calls switchToNightlyAndUpdate() directly — no manual download needed
  • Hourly pollerstartNightlyPromptPoller() re-runs the check every hour to catch users who sign in after launch
CleanShot 2026-05-26 at 18 51 44@2x

Testing Instructions

This PR requires sandboxing against 220097-ghe-Automattic/wpcom for the channel=nightly endpoint support.

To test with the sandbox:

  1. Build a stable Studio build and sign in with an Automattician account
  2. Point the update endpoint to the sandbox host
  3. On launch, the nightly prompt dialog should appear
  4. Accepting should trigger an immediate update to the latest nightly build via the normal Electron update flow (download in background → restart prompt)
  5. Declining with "Don't ask again" checked should suppress the dialog on subsequent launches
  6. Declining without "Don't ask again" should re-prompt on next launch

To test nightly auto-update polling:

  1. Install a nightly (dev) build
  2. Verify update check fires on launch if >24h since last check (lastNightlyUpdateCheck in ~/.studio/app.json)
  3. Verify update check is skipped and scheduled for the remaining time if <24h since last check

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

- Enable automatic update polling for dev/nightly builds (previously disabled)
- Add 24-hour TTL for nightly update checks stored in app.json to avoid
  checking on every launch
- Extract buildUpdateFeedUrl() helper and add channel param support so
  the nightly channel can be requested from the update endpoint
- Add maybePromptNightlySwitch() which detects signed-in Automatticians
  on stable builds and offers a one-time prompt to switch to nightly,
  with a "Don't ask again" option
- On accepting, switchToNightlyAndUpdate() points autoUpdater at the
  nightly channel feed and triggers an immediate update using the
  existing Electron update flow
- Add hourly poller to catch users who sign in after app launch
@wojtekn wojtekn changed the title Add nightly build support for Automatticians Add nightly build support May 26, 2026
@wpmobilebot
Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 32d37b8 vs trunk

app-size

Metric trunk 32d37b8 Diff Change
App Size (Mac) 1340.07 MB 1340.07 MB +0.00 MB ⚪ 0.0%

site-editor

Metric trunk 32d37b8 Diff Change
load 1770 ms 1726 ms 44 ms ⚪ 0.0%

site-startup

Metric trunk 32d37b8 Diff Change
siteCreation 9614 ms 9586 ms 28 ms ⚪ 0.0%
siteStartup 4926 ms 4912 ms 14 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

@wojtekn wojtekn requested review from a team and sejas May 28, 2026 12:36
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.

2 participants