Add static cache purge commands#190
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new CLI entrypoint to explicitly purge the static cache (origin, CDN, or both), ensuring invocations without an explicit selector fail fast instead of becoming a no-op. This fits into the existing Cloud CLI controller set and complements the existing purge-prefixes and purge-tags actions.
Changes:
- Added
cloud/static-cache/purgewith--all,--origin, and--cdnoptions and validation that at least one is provided. - Implemented purge dispatching to
StaticCache::purgeOrigin(),purgeCdn(), orpurgeAll()depending on selected options. - Added unit tests covering option registration, dispatch behavior, and missing-selector failure.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/cli/controllers/StaticCacheController.php |
Adds the new purge action and registers the new CLI options for selecting which cache(s) to purge. |
tests/unit/StaticCacheControllerTest.php |
Adds unit coverage for the new purge command’s options, behavior, and required-selector validation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7babb95 to
3c8c359
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3c8c3591b0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
3c8c359 to
f1c9d49
Compare
Adds explicit
cloud/static-cache/purge-all,cloud/static-cache/purge-cdn, andcloud/static-cache/purge-origincommands. Purges run synchronously so failed gateway requests fail the command.