Skip to content

Replace Fetch with Utopia Client - #2

Merged
TorstenDittmann merged 2 commits into
mainfrom
agent/use-utopia-client
Aug 11, 2026
Merged

Replace Fetch with Utopia Client#2
TorstenDittmann merged 2 commits into
mainfrom
agent/use-utopia-client

Conversation

@TorstenDittmann

@TorstenDittmann TorstenDittmann commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

What changed

  • replace utopia-php/fetch with the PSR-18 utopia-php/client
  • use the Utopia client directly in each Cloudflare and Fastly integration
  • accept Psr\Http\Client\ClientInterface for testability and interoperability
  • build PSR-7 requests and parse responses within each provider or adapter
  • update tests to use Utopia PSR-7 responses
  • move the supported PHP and CI runtime to PHP 8.5 and install protobuf in CI

Why

utopia-php/fetch is being replaced by the newer Utopia PSR-18 client. This aligns CDN HTTP integrations with the current Utopia client and standard PSR interfaces without introducing an additional HTTP abstraction.

Impact

Consumers now need PHP 8.5. HTTP client injection uses ClientInterface, while default requests continue to use the Utopia cURL adapter.

Validation

  • composer validate --strict --no-check-publish
  • composer test (25 tests, 48 assertions)
  • composer lint
  • composer analyse
  • git diff --check

@TorstenDittmann
TorstenDittmann marked this pull request as ready for review August 11, 2026 14:33
Comment thread src/Cdn/HttpClient.php Outdated
@greptile-apps

greptile-apps Bot commented Aug 11, 2026

Copy link
Copy Markdown

Greptile Summary

The PR replaces the Fetch integration with a PSR-18 Utopia Client while preserving injectable HTTP clients and moving supported execution to PHP 8.5.

  • Migrates Cloudflare and Fastly cache and certificate requests to PSR-7 request/response handling.
  • Updates test doubles and provider tests for the PSR interfaces.
  • Updates Composer dependencies and CI runtimes, including protobuf setup.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
composer.json Replaces utopia-php/fetch with utopia-php/client and raises the minimum and configured PHP runtime to 8.5.
src/Cdn/Cache/Adapter/Cloudflare.php Migrates purge requests to an injectable PSR-18 client with PSR-7 JSON requests and explicit response decoding.
src/Cdn/Cache/Adapter/Fastly.php Migrates Fastly cache operations to PSR-18 while preserving authentication and soft-purge request headers.
src/Cdn/Certificates/Provider/Cloudflare.php Migrates custom-hostname certificate operations to PSR-18 requests and PSR-7 responses.
src/Cdn/Certificates/Provider/FastlyTls.php Migrates Fastly TLS subscription operations to the shared PSR-compatible HTTP stack.
tests/Cdn/TestClient.php Replaces the Fetch-derived test client with a PSR-18 ClientInterface implementation that captures outgoing requests.

Reviews (2): Last reviewed commit: "Use Utopia Client directly" | Re-trigger Greptile

@TorstenDittmann
TorstenDittmann merged commit 1f7070f into main Aug 11, 2026
4 checks passed
@TorstenDittmann
TorstenDittmann deleted the agent/use-utopia-client branch August 11, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants