Skip to content

Distribute Linux dev builds to AppsCDN#3363

Merged
ivan-ottinger merged 7 commits into
trunkfrom
add-linux-dev-build-distribution
May 13, 2026
Merged

Distribute Linux dev builds to AppsCDN#3363
ivan-ottinger merged 7 commits into
trunkfrom
add-linux-dev-build-distribution

Conversation

@ivan-ottinger
Copy link
Copy Markdown
Contributor

@ivan-ottinger ivan-ottinger commented May 6, 2026

Related issues

Part of RSM-1314 — Linux release prep.
Coordinated with WPCOM PR #214878 (Linux platform allowlist + studio-app/updates endpoint Linux response). Both should land together.

How AI was used in this PR

AI-assisted: identified the required changes (artifact download in the Distribute step + new entries in distribute_builds), drafted the implementation, and drafted this PR body. Author reviewed.

Proposed Changes

Wires Linux dev builds into the existing Distribute Dev Builds flow.

  • .buildkite/pipeline.yml: Distribute Dev Builds now depends on dev-linux and downloads *.deb artifacts before invoking fastlane.
  • fastlane/Fastfile: adds linux_x64_deb and linux_arm64_deb entries to update_builds in distribute_builds. A new helper, linux_deb_path(arch), resolves the version-embedded .deb filename (e.g. studio_1.8.2~dev16_amd64.deb) via glob, with a clear error if zero or multiple matches are found.

Linux uses install_type: 'Update' to match the URL convention the WPCOM updates endpoint emits for the polling path. On Linux the .deb is the only artifact — it serves as both the update payload and the full installer — so a single entry in update_builds is sufficient (uploaded for dev builds via the existing release_tag.nil? branch, and again for release builds via the combined hash).

Testing Instructions

This PR cannot be exercised end-to-end until WPCOM #214878 merges. Until then, fastlane uploads with platform: 'Linux - x64' / 'Linux - ARM64' will be 422-rejected by AppsCDN.

After both PRs merge:

  1. The next trunk merge runs Distribute Dev Builds, depends on dev-linux, downloads the .deb artifacts, and uploads them via fastlane.
  2. Confirm the Buildkite log shows a CDN URL for both Linux entries (Linux - x64, Linux - ARM64).
  3. Confirm the URLs are reachable and serve a .deb of the expected architecture (dpkg-deb -I on the downloaded file).

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
  • WPCOM PR #214878 is merged or being merged in coordination.
  • First post-merge trunk build's Distribute Dev Builds step completes successfully and reports CDN URLs for both Linux entries.

@ivan-ottinger ivan-ottinger self-assigned this May 6, 2026
@ivan-ottinger ivan-ottinger force-pushed the add-linux-dev-build-distribution branch from a08e2ef to 66cd908 Compare May 6, 2026 15:47
@ivan-ottinger ivan-ottinger requested a review from Copilot May 6, 2026 15:52
@ivan-ottinger ivan-ottinger marked this pull request as ready for review May 6, 2026 15:52
@ivan-ottinger ivan-ottinger requested review from a team and hannahtinkler May 6, 2026 15:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread fastlane/Fastfile Outdated
Comment thread fastlane/Fastfile Outdated
@ivan-ottinger ivan-ottinger requested a review from gavande1 May 12, 2026 08:29
@ivan-ottinger ivan-ottinger merged commit 4dd82c8 into trunk May 13, 2026
11 checks passed
@ivan-ottinger ivan-ottinger deleted the add-linux-dev-build-distribution branch May 13, 2026 08:46
ivan-ottinger added a commit that referenced this pull request May 13, 2026
## Related issues

Reverts #3363. Restoring this once the upstream fix lands in the
[`wordpress-mobile/release-toolkit`](https://github.com/wordpress-mobile/release-toolkit)
plugin.

## How AI was used in this PR

AI-assisted: diagnosed the post-merge failure from the Buildkite log,
identified the gap in the fastlane plugin's platform allowlist, and
drafted this revert. Author reviewed.

## Why we're reverting

After #3363 merged, the next trunk build's `Distribute Dev Builds` step
([Buildkite
#16073](https://buildkite.com/automattic/studio/builds/16073)) failed
with:

```
Error setting value 'Linux - x64' for option 'platform'
You passed invalid parameters to 'upload_build_to_apps_cdn'.
Platform must be one of: Android, iOS, Mac - Silicon, Mac - Intel, Mac - Any,
Windows - x86, Windows - x64, Windows - ARM64,
Microsoft Store - x86, Microsoft Store - x64, Microsoft Store - ARM64
```

The `upload_build_to_apps_cdn` fastlane action (from the
[`wordpress-mobile/release-toolkit`](https://github.com/wordpress-mobile/release-toolkit)
gem, pinned at `~> 14.2`) has a **client-side** allowlist baked into its
`VALID_PLATFORMS` constant
(`lib/fastlane/plugin/wpmreleasetoolkit/actions/common/upload_build_to_apps_cdn.rb:31-43`).
That list doesn't include `'Linux - x64'` or `'Linux - ARM64'`, so the
action rejects our call before it ever reaches WPCOM.

The WPCOM-side allowlist updates (the enum + extension MIME types) are
landed and correct — they handle the *server-side* validation. But the
*client-side* validation in the fastlane plugin is a separate codebase
that also needs to be updated. We missed that gap before merging.

Impact while #3363 was on trunk:
- Mac and Windows dev builds **did** upload to AppsCDN (they iterate
first in the loop).
- Linux upload raised, terminating the loop before the
`buildkite_annotate` summary fired.
- The `Distribute Dev Builds` step shows red despite Mac/Windows being
in CDN — confusing for anyone watching trunk.
- Every subsequent trunk merge would hit the same failure, blocking the
visible distribution annotation indefinitely.

Reverting restores the clean Mac/Windows distribution flow until the
plugin gap is fixed upstream.

## Proposed Changes

Reverts the two-file change from #3363:
- `.buildkite/pipeline.yml`: drops `dev-linux` from `Distribute Dev
Builds`'s `depends_on` and removes the `*.deb` artifact download.
- `fastlane/Fastfile`: removes the `linux_deb_path` helper, the
`release_tag.nil?` block adding Linux entries to `update_builds`, and
the related comment.

## Next steps after this lands

1. Open a PR against
[`wordpress-mobile/release-toolkit`](https://github.com/wordpress-mobile/release-toolkit)
adding `'Linux - x64'` and `'Linux - ARM64'` to `VALID_PLATFORMS` in
`upload_build_to_apps_cdn.rb`. Precedent: their PR #672 added
`'Microsoft Store - x64'` and `'Windows - x64'` to the same array.
2. Wait for the plugin's next gem release.
3. Bump the `Gemfile` to that version.
4. Re-apply #3363's changes (cherry-pick or fresh PR).
5. Re-verify on the next trunk distribute.

## Testing Instructions

1. Open the next trunk build after this merges.
2. Confirm `Distribute Dev Builds` step succeeds and the
`buildkite_annotate` summary lists Mac and Windows (and only those) in
the "🔗 Build available for ..." message.

## Pre-merge Checklist

- [ ] Have you checked for TypeScript, React or other console errors?
- [x] Trunk's `Distribute Dev Builds` step succeeds again after this
lands.
ivan-ottinger added a commit that referenced this pull request May 15, 2026
## Related issues

Re-applies #3363 after it was reverted in #3462. Blocked on the upstream
fastlane-plugin gap landing — see
[RSM-3058](https://linear.app/a8c/issue/RSM-3058/add-linux-to-upload-build-to-apps-cdn-platform-allowlist-in-release)
and
[wordpress-mobile/release-toolkit#720](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
Builds` step to fail because the `upload_build_to_apps_cdn` fastlane
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](wordpress-mobile/release-toolkit#720),
which adds `'Linux - x64'` and `'Linux - ARM64'` to the action's
`VALID_PLATFORMS` constant. 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-linux` to `Distribute Dev
Builds`'s `depends_on` and `buildkite-agent artifact download "*.deb" .`
to its command block.
- `fastlane/Fastfile`: adds the `linux_deb_path` helper and the
`release_tag.nil?` block with the two Linux entries (`linux_x64_deb`,
`linux_arm64_deb`).

No changes to `Gemfile` / `Gemfile.lock` here — that bump comes as a
separate, smaller PR landed **before** this one (see merge order below).

## Merge order (important)

1.
[wordpress-mobile/release-toolkit#720](wordpress-mobile/release-toolkit#720)
merges → release-toolkit team cuts a new gem release.
2. **Separate small PR** bumps Studio's `Gemfile.lock` to the new gem
version (via `bundle update fastlane-plugin-wpmreleasetoolkit`). The
`Gemfile` pessimistic constraint (`~> 14.2`) already accepts the new
minor version, so only the lock file changes.
3. This PR is marked ready for review, CI runs against the bumped gem,
reviewed, merged.
4. Next trunk build's `Distribute Dev Builds` should 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

- **Release pipeline Linux integration
([RSM-2587](https://linear.app/a8c/issue/RSM-2587/wire-linux-into-the-release-pipeline)).**
A separate PR will wire Linux into
`.buildkite/release-build-and-distribute.yml` and lift the
`release_tag.nil?` gate from `Fastfile`. 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:

1. Push a commit (or let CI re-run on the existing commit) and confirm
`Lint`, `Unit Tests`, `E2E Tests`, `Performance Metrics` all stay green.
2. After merge, watch the first trunk build's `Distribute Dev Builds`
step. Should succeed and the log should contain CDN URLs for both Linux
entries (`Linux - x64`, `Linux - ARM64`) alongside the existing Mac and
Windows uploads.
3. Optionally `curl -IL` one of the returned Linux CDN URLs to confirm
it serves the `.deb`.

## Pre-merge Checklist

- [ ] Have you checked for TypeScript, React or other console errors?
- [ ] Gemfile.lock bump PR is merged.
- [ ] Trunk's `Distribute Dev Builds` step succeeds end-to-end after
this lands and reports CDN URLs for both Linux entries.

Co-authored-by: Rahul Gavande <rahul.gavande@automattic.com>
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.

3 participants