Skip to content

Conversation

@brandonpayton
Copy link
Member

@brandonpayton brandonpayton commented Nov 12, 2025

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

@zaerl
Copy link
Collaborator

zaerl commented Nov 12, 2025

Great work. Will remove the fix from #2886

@mho22
Copy link
Collaborator

mho22 commented Nov 13, 2025

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

@zaerl
Copy link
Collaborator

zaerl commented Nov 13, 2025

@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
Copy link
Collaborator

mho22 commented Nov 13, 2025

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
Copy link
Collaborator

zaerl commented Nov 13, 2025

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.

@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
Copy link
Member Author

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
Copy link
Member Author

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
Copy link
Member Author

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

@brandonpayton
Copy link
Member Author

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
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