Reapply "Distribute Linux dev builds to AppsCDN"#3464
Merged
Conversation
This reverts commit a1b4b97.
4 tasks
gavande1
approved these changes
May 13, 2026
Contributor
|
Update: checks passed after merging latest trunk. Disregard my earlier concern. |
2 tasks
ivan-ottinger
added a commit
that referenced
this pull request
May 14, 2026
## Related issues Unblocks [#3464](#3464) (Linux dev build distribution re-apply). ## How AI was used in this PR AI-assisted: ran the `bundle update --conservative` command, drafted this PR body. Author reviewed. ## Proposed Changes Bumps `fastlane-plugin-wpmreleasetoolkit` to v14.6.0 to pick up Linux platform support added upstream in [wordpress-mobile/release-toolkit#720](wordpress-mobile/release-toolkit#720). Without this, the `upload_build_to_apps_cdn` action in Studio's fastlane lanes rejects `'Linux - x64'` and `'Linux - ARM64'` as invalid platform values client-side, which is what failed [build #16073](https://buildkite.com/automattic/studio/builds/16073) and prompted the revert in [#3462](#3462). The lockfile changes are limited to the targeted gem and its required deps (used `bundle update --conservative`): the gem bump itself, removal of `activesupport` and its transitive deps (release-toolkit dropped that dep in 14.3.1), and bumps for `aws-sdk-core`/`kms`/`s3` which release-toolkit's google-cloud-storage requires. `nokogiri` requirement also tightens (14.6.0 raised its minimum). ## Testing Instructions CI passing is the test. Existing macOS/Windows distribution behavior is unchanged — the new gem adds platform values without modifying existing ones. ## Pre-merge Checklist - [ ] Have you checked for TypeScript, React or other console errors? - [ ] CI is green.
2 tasks
ivan-ottinger
added a commit
that referenced
this pull request
May 15, 2026
## Related issues Follow-up to [#3464](#3464) (Linux dev build distribution). ## How AI was used in this PR AI-assisted: spotted the duplicated arch/version in the uploaded filename while verifying the first trunk Distribute Dev Builds run, drafted the fix and PR body. Author reviewed. ## Proposed Changes The Linux DEBs uploaded to AppsCDN by [build #16245](https://buildkite.com/automattic/studio/builds/16245) landed with names like: - `studio_1.9.0dev51_amd64-x64-v1.9.0-dev51.deb` - `studio_1.9.0dev51_arm64-arm64-v1.9.0-dev51.deb` Both arch (`amd64` + `x64`) and version (`1.9.0dev51` + `v1.9.0-dev51`) appear twice. The cause: `electron-installer-debian` produces filenames like `studio_1.9.0~dev51_amd64.deb`, then `create_versioned_file` (in this Fastfile) blindly appends `-<arch>-v<version>` to the base name. For Mac the input is a clean `Studio.app.zip`, so the result is `studio-x64-v1.9.0.zip`; for Linux the input already carries arch+version, so the suffix is duplicated. WordPress's media library then strips the `~`, mashing the version slug. This change renames the Linux DEB to a clean `studio.deb` stem in `linux_deb_path` before returning the path. `create_versioned_file` then produces the Mac-style `studio-<arch>-v<version>.deb` (e.g. `studio-x64-v1.9.0-dev51.deb`). The rename is idempotent — retries pick up the already-renamed file. **Why this is cosmetic-only:** - Version checking goes through the WPCOM `studio-app/updates` endpoint, which compares the `version` field in upload metadata (passed explicitly to `upload_file_to_apps_cdn`), not the filename. - `apt`/`dpkg` install behavior reads the DEB's internal control file, not the filename. - The CDN `media_url` is composed from `platform/version/build_number`, not the filename — only `Content-Disposition` after the 302 changes. User-visible impact: the filename users see in their Downloads folder after clicking the in-app update button (#3465) becomes readable. ## Testing Instructions - After this lands on trunk, watch the next Distribute Dev Builds run. - Open the `cdn-link` annotation on the Distribute Dev Builds job. - Click the **Linux - x64 (DEB)** and **Linux - ARM64 (DEB)** links and confirm the downloaded filenames look like `studio-x64-v<version>.deb` / `studio-arm64-v<version>.deb`. ## Pre-merge Checklist - [ ] Have you checked for TypeScript, React or other console errors? - [ ] CI is green.
ivan-ottinger
added a commit
that referenced
this pull request
May 15, 2026
## Related issues Part of [RSM-1314](https://linear.app/a8c/issue/RSM-1314) — Linux release prep. ## How AI was used in this PR AI-assisted: drafted the Linux branch in `apps/studio/src/updates.ts`, the unit tests, and this PR body. Author reviewed. ## Proposed Changes Adds Linux support to the in-app update flow. Electron's built-in `autoUpdater` is macOS/Windows only, so this PR adds a custom polling branch in `apps/studio/src/updates.ts` that hits the same WPCOM endpoint, parses the agreed Linux response, and shows an OS dialog when an update is available. The dialog has a `Download` button that opens the user's browser to the `.deb` URL via `shellOpenExternalWrapper`; the user installs manually via `sudo apt install`. <img width="1666" height="1238" alt="CleanShot 2026-05-13 at 14 29 43@2x" src="https://github.com/user-attachments/assets/6c7c9342-bcae-45ea-9473-195ad9e24e01" /> ### Response handling | Server response | Client behavior | | --- | --- | | `200 { version, downloadUrl }` | Show dialog with the new version + Download/Later buttons. On Download, validate URL is `http:`/`https:` then open via `shellOpenExternalWrapper`. Reschedule. | | `204` | No update. Silent on auto-poll; "No updates available" dialog on manual check (shared with Mac/Windows). | | `404` | Should not happen. Log to Sentry and treat as no-op. | | Other errors | Log to Sentry. Reschedule. | The server runs `version_compare()` and returns `204` when the client is current, so the client trusts the response without further comparison. ## Out of scope - **Linux dev/release distribution to AppsCDN** — tracked in [#3464](#3464) and [RSM-2587](https://linear.app/a8c/issue/RSM-2587/wire-linux-into-the-release-pipeline). This PR is independent: the WPCOM `studio-app/updates` endpoint is already deployed and serves Linux responses today. - **Automatic install** — `.deb` installation requires root, can't be silent. Flow is intentionally "open browser, user installs." ## Testing Instructions **Automated:** unit tests cover the three main response paths (200, 204, server error). They run in CI; locally: ```bash npx vitest run apps/studio/src/tests/updates.test.ts ``` **Visual verification of the dialog on Linux:** because no Linux release exists in AppsCDN yet, the server returns `204` for any version. To exercise the dialog locally, apply this temporary diff to force-trigger the 200 path, then revert when done. Run on a Linux machine (or VM): ```bash git checkout add-linux-in-app-updater git apply <<'PATCH' diff --git a/apps/studio/src/updates.ts b/apps/studio/src/updates.ts --- a/apps/studio/src/updates.ts +++ b/apps/studio/src/updates.ts @@ -222,6 +222,12 @@ async function showUpdateReadyToInstallNotice() { } function setupLinuxUpdates() { + // TEMP for local testing — REMOVE BEFORE COMMIT + console.log( 'TEMP: bypassing shouldPoll for local Linux updater test' ); + void pollLinuxUpdates(); + return; + // END TEMP + if ( ! shouldPoll ) { console.log( 'Skipping Linux auto-updates', { env: process.env.NODE_ENV, @@ -238,6 +244,22 @@ function setupLinuxUpdates() { async function pollLinuxUpdates() { updaterState = 'checking-for-update'; + // TEMP for local testing — REMOVE BEFORE COMMIT + // Stubs a fake 200 response so the dialog renders without a real WPCOM call. + // Swap to `return;` (in the try) to test the 204 path instead. + console.log( 'TEMP: stubbing fake 200 response' ); + try { + await showLinuxUpdateAvailableNotice( + '1.9.9', + 'https://appscdn.wordpress.com/downloads/wordpress-com-studio/linux-arm64/v1.9.9/update/studio_1.9.9_arm64.deb' + ); + } finally { + showManualCheckDialogs = false; + rescheduleLinuxOrFinish(); + } + return; + // END TEMP + const url = new URL( 'https://public-api.wordpress.com/wpcom/v2/studio-app/updates' ); url.searchParams.append( 'platform', process.platform ); url.searchParams.append( 'studioArch', process.arch ); PATCH npm start ``` Within ~1 second of the main window appearing, the dialog should render. Verify: - Title "New Version Available", message "Studio 1.9.9 is available". - Install command on its own line: `sudo apt install ~/Downloads/studio_1.9.9_arm64.deb`. - Click "Download" → browser opens to the URL (it'll 404 — that's expected; verifying `shellOpenExternalWrapper` fires). - Click "Later" → dialog dismisses. - `Help → Check for Updates` triggers the same dialog. When done, revert: ```bash git checkout apps/studio/src/updates.ts ``` **No regression on Mac/Windows:** `npm start` on Mac or Windows should behave exactly as before this PR (no entry into the Linux branch). ## Pre-merge Checklist - [ ] Have you checked for TypeScript, React or other console errors? - [ ] Unit tests pass (`npx vitest run apps/studio/src/tests/updates.test.ts`). - [ ] Visual smoke test on a Linux machine confirms the dialog renders correctly. - [ ] Mac/Windows update flow is unchanged. --------- Co-authored-by: Rahul Gavande <rahul.gavande@automattic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issues
Re-applies #3363 after it was reverted in #3462. Blocked on the upstream fastlane-plugin gap landing — see RSM-3058 and wordpress-mobile/release-toolkit#720.
How AI was used in this PR
AI-assisted: re-applied the original change as a revert-of-revert commit, drafted this PR body explaining the dependency chain. Author reviewed.
Why this PR exists
The original #3363 wired Linux DEBs into the existing dev-distribution flow (fastlane + Buildkite). On merge it caused trunk's
Distribute Dev Buildsstep to fail because theupload_build_to_apps_cdnfastlane action has a client-side platform allowlist that doesn't include Linux. We reverted in #3462 to restore trunk health.The upstream fix is in flight at wordpress-mobile/release-toolkit#720, which adds
'Linux - x64'and'Linux - ARM64'to the action'sVALID_PLATFORMSconstant. Once that PR merges and a new gem version is released, we can re-apply the original Studio-side change and ship Linux dev distribution.What this PR contains
Pure re-apply of #3363 (revert-of-revert commit). Two files:
.buildkite/pipeline.yml: adds- step: dev-linuxtoDistribute Dev Builds'sdepends_onandbuildkite-agent artifact download "*.deb" .to its command block.fastlane/Fastfile: adds thelinux_deb_pathhelper and therelease_tag.nil?block with the two Linux entries (linux_x64_deb,linux_arm64_deb).No changes to
Gemfile/Gemfile.lockhere — that bump comes as a separate, smaller PR landed before this one (see merge order below).Merge order (important)
Gemfile.lockto the new gem version (viabundle update fastlane-plugin-wpmreleasetoolkit). TheGemfilepessimistic constraint (~> 14.2) already accepts the new minor version, so only the lock file changes.Distribute Dev Buildsshould now succeed for all three platforms.Until step 2 lands, this PR's CI will keep hitting the same plugin-validation error as #3363 did. It stays draft until then.
Out of scope
.buildkite/release-build-and-distribute.ymland lift therelease_tag.nil?gate fromFastfile. Conceptually expands the same Linux distribution work to release-time uploads, but it's a different pipeline file and a meaningfully different blast radius, so it deserves its own PR.Testing Instructions
Once the gem bump PR lands and this is marked ready:
Lint,Unit Tests,E2E Tests,Performance Metricsall stay green.Distribute Dev Buildsstep. Should succeed and the log should contain CDN URLs for both Linux entries (Linux - x64,Linux - ARM64) alongside the existing Mac and Windows uploads.curl -ILone of the returned Linux CDN URLs to confirm it serves the.deb.Pre-merge Checklist
Distribute Dev Buildsstep succeeds end-to-end after this lands and reports CDN URLs for both Linux entries.