[3.x] Use gateway API routes#167
Merged
Merged
Conversation
00bca42 to
e1d06fb
Compare
e1d06fb to
3b1ab04
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates Craft Cloud’s static cache purge mechanism to use the gateway worker’s dedicated API route (via a configured gateway base URL) instead of legacy purge-through-headers behavior, and adds unit coverage for the new gateway client construction.
Changes:
- Switch static cache purge requests to
POST cache/purgewith a JSON payload (tags/prefixes) via a gateway API client. - Introduce
gatewayBaseUrlconfig (defaulting tohttps://gateway.craft.cloud) and document it. - Add unit tests for the gateway API client base URI and auth header behavior, and keep the legacy helper method signature stable.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
tests/unit/HelperTest.php |
Adds unit tests validating gateway client base URI construction and auth header configuration. |
src/StaticCache.php |
Routes tag/prefix purge operations through the gateway API endpoint using JSON request bodies. |
src/Helper.php |
Replaces legacy signing approach with a gateway API client builder and deprecates the old request helper. |
src/Config.php |
Adds the gatewayBaseUrl configuration option with a default value. |
README.md |
Documents the new gatewayBaseUrl configuration option. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Routes Cloud cache purge requests through the dedicated gateway API endpoint introduced by the gateway worker.