Skip to content

Clean up Linux DEB filename for AppsCDN uploads#3501

Merged
ivan-ottinger merged 2 commits into
trunkfrom
clean-up-linux-deb-upload-filename
May 15, 2026
Merged

Clean up Linux DEB filename for AppsCDN uploads#3501
ivan-ottinger merged 2 commits into
trunkfrom
clean-up-linux-deb-upload-filename

Conversation

@ivan-ottinger
Copy link
Copy Markdown
Contributor

Related issues

Follow-up to #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 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 ivan-ottinger marked this pull request as ready for review May 15, 2026 10:57
@ivan-ottinger ivan-ottinger requested a review from Copilot May 15, 2026 10:57
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

Cleans up the Linux DEB filename uploaded to AppsCDN. Previously, electron-installer-debian produced filenames already containing arch+version, then create_versioned_file appended its own -<arch>-v<version> suffix, producing duplicated/mangled names like studio_1.9.0dev51_amd64-x64-v1.9.0-dev51.deb. This PR renames the DEB to a clean studio.deb stem before returning the path so the final uploaded filename matches the Mac convention (studio-x64-v<version>.deb).

Changes:

  • Rename the resolved Linux DEB to studio.deb in linux_deb_path so create_versioned_file produces a clean Mac-style suffix.
  • Make the rename idempotent by short-circuiting when studio.deb already exists (for retries).
  • Update the surrounding comment to explain the new behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ivan-ottinger ivan-ottinger requested review from a team and gavande1 May 15, 2026 11:01
@ivan-ottinger ivan-ottinger merged commit 373dc83 into trunk May 15, 2026
10 checks passed
@ivan-ottinger ivan-ottinger deleted the clean-up-linux-deb-upload-filename branch May 15, 2026 12:13
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