πŸ’₯ TRENDING: WordPress/wordpress playground/pull/ - Collection

Skip to content

Conversation

@brandonpayton

Motivation for the change, related issues

Today, while there is an active WP 6.9 release candidate, Playground CLI is using the release candidate as "latest". As a user, I would expect "latest" to remain the latest production release. This PR makes that change.

In addition, when passing null as a CLI wp argument, Playground CLI attempts to download https://wordpress.org/wordpress-null.zip. In that case, WordPress.org outputs a "Release not found" generic text file that is cached as if it is a good release. This PR addresses that case as well.

Implementation details

This PR adjusts the version selection logic to skip release candidates and treat the latest production release as "latest". It also updates the tests to include this scenario.

This PR addresses the null version issue by:

  1. Resolving null versions to latest
  2. Output additional information in the unzip function

Testing Instructions (or ideally a Blueprint)

  • CI

@brandonpayton brandonpayton requested a review from a team November 12, 2025 19:18
@brandonpayton brandonpayton self-assigned this Nov 12, 2025
@brandonpayton brandonpayton added [Type] Bug An existing feature does not function as intended [Package][@wp-playground] CLI labels Nov 12, 2025
@brandonpayton brandonpayton mentioned this pull request Nov 12, 2025
@zaerl

Great work. Will remove the fix from #2886

@mho22

@zaerl I think @brandonpayton should also add the correction around the Exception too then right ?

@zaerl zaerl mentioned this pull request Nov 13, 2025
@zaerl

@zaerl I think @brandonpayton should also add the correction around the Exception too then right ?

Missing some context here. Do you mean the check performed here?

We can move all the fixes in this PR. The null one and the .zip as well. Even if the second one is not 100% related to this.

@mho22

Sorry @zaerl, I meant the Exception from the packages/playground/common/src/index.ts file on line 69 :

} else {
-    throw new Exception("Could not unzip file: " . $zip->getStatusString());
+    $fileSize = file_exists($zipPath) ? filesize($zipPath) : 'unknown';
+    throw new Exception("Could not unzip file. Error code: " . $res . ". File size: " . $fileSize . " bytes.");
}

@zaerl

Sorry @zaerl, I meant the Exception from the packages/playground/common/src/index.ts file on line 69 :

} else {
-    throw new Exception("Could not unzip file: " . $zip->getStatusString());
+    $fileSize = file_exists($zipPath) ? filesize($zipPath) : 'unknown';
+    throw new Exception("Could not unzip file. Error code: " . $res . ". File size: " . $fileSize . " bytes.");
}

Yes, I think that merging the two PRs is the best choice here.

wojtekn
@brandonpayton brandonpayton changed the title [CLI] Stop considering a WP release candidate to be "latest" [CLI] Fix null and "latest" WP version resolution and improve unzip error message Nov 13, 2025
@brandonpayton

Unfortunately, some of the test runs have been running into Wasm-related errors. One was out of memory and another was an "unreachable" exception. I just merged the latest from trunk to retry, but I doubt any meaningful changes are there. We probably just have those issues that occur every so often. It would be good to look into.

@brandonpayton

Thank you, @zaerl! I hadn't noticed that we were making overlapping fixes. I merged your changes into this PR. The changes look good, and all tests are passing. Let's merge.

@brandonpayton

Actually, the description for this PR needs to be updated first so both it and the commit are accurate.

@brandonpayton

We should probably also avoid caching a zip that is not a good zip file, but let's address that in a follow-up PR.

@brandonpayton brandonpayton merged commit 88d4afb into trunk Nov 13, 2025
29 checks passed
@brandonpayton brandonpayton deleted the wordpress-stop-treating-rc-as-latest branch November 13, 2025 18:12
This was referenced Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package][@wp-playground] CLI [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants