Skip to content

Introduce --version=beta argument for updating to latest WordPress beta/RC#315

Closed
Copilot wants to merge 2 commits intomainfrom
copilot/add-version-beta-argument
Closed

Introduce --version=beta argument for updating to latest WordPress beta/RC#315
Copilot wants to merge 2 commits intomainfrom
copilot/add-version-beta-argument

Conversation

Copy link
Contributor

Copilot AI commented Mar 11, 2026

wp core update --version=beta and wp core download --version=beta had no proper implementation — passing --version=beta either showed a misleading "older than current version" message or attempted to fetch a non-existent wordpress-beta.zip.

Queries the WordPress.org API with channel=beta to retrieve the current beta or RC offer, then uses the real versioned package URLs.

Changes

  • get_beta_download_offer() — new private helper that calls https://api.wordpress.org/core/version-check/1.7/?channel=beta&locale=... and returns the offer array (version, download URL, packages)
  • update() — adds 'beta' to the version-dispatch condition; when matched, fetches the API offer and builds the update object with actual version/locale/package data (uses no_content package when available)
  • download() — when --version=beta, resolves to the real versioned URL from the API (e.g. wordpress-7.0-beta4.tar.gz); cached normally since the URL is versioned, unlike nightly
  • Docblocks updated for --version on both commands to mention beta
  • Behat tests added for both commands

Example

$ wp core update --version=beta
Updating to version 7.0-beta4 (en_US)...
Downloading update from https://downloads.wordpress.org/release/wordpress-7.0-beta4-no-content.zip...
Success: WordPress updated successfully.

$ wp core download --version=beta
Downloading WordPress 7.0-beta4 (en_US)...
Success: WordPress downloaded.
Original prompt

This section details on the original issue you should resolve

<issue_title>Introduce --version=beta argument for updating to latest WordPress beta</issue_title>
<issue_description>Running wp core update --version=nightly now updates to 4.9 alpha, since core branched 4.8 a few days ago and trunk is now 4.9 alpha.

If the WordPress Beta Tester plugin is used and is set to Bleeding edge nightlies it sticks to 4.8-RC2-40868. It appears to do this by appending a _beta_tester=true flag on the update request (source).

It would be great if WP-CLI supported a version flag such as wp core update --version=beta which stuck to the current beta/RC in the same way that the beta tester plugins appears to.

Might be worth pinging Westi or Dion for clarification.</issue_description>

Comments on the Issue (you are @copilot in this section)

@danielbachhuber > It would be great if WP-CLI supported a version flag such as `wp core update --version=beta` which stuck to the current beta/RC in the same way that the beta tester plugins appears to.

👍 </comment_new>
<comment_new>@danielbachhuber
@johnbillion How should we handle release candidates? If you use --version=beta, would you expect to get a release candidate?</comment_new>
<comment_new>@danielbachhuber
Agh, I cannot, for the life of me, figure out the proper URL to get a beta download offer. Any tips?

https://api.wordpress.org/core/version-check/1.7/?version=4.8.3-wp-beta-tester&php=7.0.22&locale=en_US&mysql=5.5.5&local_package=&blogs=1&users=1&multisite_enabled=0&initial_db_version=38590

This request only appears to include the nightly that we already have.</comment_new>
<comment_new>@danielbachhuber

The API doesn't return beta/rc packages, only the nightlies.

@ocean90 Oh. Is there any way to pragmatically fetch beta/rc packages (other than scraping HTML)?</comment_new>
<comment_new>@danielbachhuber
Opened a meta ticket: https://meta.trac.wordpress.org/ticket/3245</comment_new>
<comment_new>@danielbachhuber
Closing as maybelater if this is ever added to the WP.org API</comment_new>
<comment_new>@danielbachhuber
Open to pull requests if anyone would like to open one!</comment_new>


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Copilot AI changed the title [WIP] Introduce --version=beta argument for WordPress update Introduce --version=beta argument for updating to latest WordPress beta/RC Mar 11, 2026
@github-actions github-actions bot added command:core-update Related to 'core update' command scope:distribution Related to distribution labels Mar 11, 2026
@codecov
Copy link

codecov bot commented Mar 11, 2026

Codecov Report

❌ Patch coverage is 95.38462% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/Core_Command.php 95.38% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@swissspidy
Copy link
Member

a version-check API request that includes channel=beta|rc only responds with a beta or RC if we're currently within the beta or RC window., so this is kind blocked still

@swissspidy swissspidy closed this Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

command:core-update Related to 'core update' command scope:distribution Related to distribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Introduce --version=beta argument for updating to latest WordPress beta

2 participants