Skip to content

CLI: Source WordPress zip from a local cache file before looking for it online#1523

Closed
adamziel wants to merge 2 commits into
trunkfrom
playground-cli-offline
Closed

CLI: Source WordPress zip from a local cache file before looking for it online#1523
adamziel wants to merge 2 commits into
trunkfrom
playground-cli-offline

Conversation

@adamziel
Copy link
Copy Markdown
Collaborator

Motivation for the change, related issues

I couldn't use Playground CLI on the plane because resolveWPRelease() is always called and it requires an active network connection to fetch()-request the WordPress.org API. This PR adds an offline-first WordPress zip resolution that tries to find a WordPress zip file in the local cache without any network lookups. It will only do a network lookup if it doesn't find anything locally.

Implementation details

Ships a resolveWordPressZip() function that tries finding the right WordPress versions among the zip files cached in a local directory. It looks for files matching the pattern prebuilt-wp-*.zip and return one when it's found.

Remaining work

  • A way of downloading a fresh WordPress release. Currently, when this PR is applied, a nightly or beta or 6.4.1 WordPress release, once cached, will continue to be used afterwards.

Testing Instructions (or ideally a Blueprint)

🚧 TBD 🚧

@bgrgicak bgrgicak mentioned this pull request Jun 19, 2024
@adamziel adamziel force-pushed the trunk branch 2 times, most recently from 680cd19 to 2e376d2 Compare October 4, 2024 09:24
@adamziel
Copy link
Copy Markdown
Collaborator Author

adamziel commented Oct 7, 2024

Oh wow this is the same problem as #1822 and #1849. I wonder whether reusing the same caching logic would make sense here.

@adamziel adamziel added Blocked and removed Blocked labels Oct 7, 2024
@adamziel
Copy link
Copy Markdown
Collaborator Author

Superseded by Blueprints v2 that maintain their own http cache

@adamziel adamziel closed this Jun 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant