Skip to content

Upgrade to Guzzle v7 #10302

@aaemnnosttv

Description

@aaemnnosttv

Feature Description

Guzzle is one of Site Kit's core dependencies as the HTTP client used by google/apiclient.

Now that Site Kit's minimum PHP version requirement is 7.4, we're no longer blocked from upgrading to Guzzle 7 and even able to use the latest stable version: 7.9.2!

This should be smoother than the upgrade from Guzzle 5 -> 6 (done in #1146), and is important to unblock upgrades of other dependencies.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • guzzlehttp/guzzle should be upgraded to the latest v7 version
    • All existing Guzzle client customizations must continue to work (see Client_Factory::create_client)

Implementation Brief

  • Update guzzlehttp/guzzle to the 7.9.2
    • Updating this library will fail due to it's dependency guzzlehttp/psr7 which needs to be 2.7.0. It is locked to the google api library which is locaked at 1.9.1. So it should be updated together with it's dependencies
    • So far it doesn't seem to break anything, I did a quick exploration and dashboard data is working correctly with no notice/error in the error log. The only thing needing some updates is tests. They fail for same reason, the middleware expects promise as return, but in our fakehttp handler we return new Response, so it will take updating this in all tests that return new Response to return a wrapper around response new FulfilledPromise( new Response(...))
    • There is a quick PoC branch that can be checked for example
  • Do an ad-hoc test if everything is working as expected

Test Coverage

  • Fix failing tests

QA Brief

  • This update updates the package that makes all requests to the Google API. All requests for reports from various Google services should still function.
  • Perform a smoke test of the core reports on the dashboard for various Site Kit modules (Search Console, Analytics, etc.) and test across different supported PHP and WordPress versions.

Changelog entry

  • Update Guzzle to v7.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Medium priorityPHPQA: EngRequires specialized QA by an engineerTeam SIssues for Squad 1Type: InfrastructureEngineering infrastructure & tooling

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions