-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to Guzzle 6+ #1146
Comments
I tried bumping the version while working on #547 but as I recall it didn't work so we kept it at 5.x for now. |
This issue was originally raised related to #41 due to conflicts when installing the plugin via Composer directly using We can however keep this issue as an upgrade to do in the future, although there's really no urgency to do so. Moving to stalled. |
@aaemnnosttv Is there any reason why we are not upgrading to v7? The reason is we'll still have some compatibility issues with v6 and PHP 8.1, so why not use v7? 🤔 |
@asvinb yes, v7 requires PHP 7.2+ https://packagist.org/packages/guzzlehttp/guzzle#7.0.0 Can you elaborate on what the specific issues would be with v6? |
@aaemnnosttv I thought with the minimum WP version we support being bumped to 5.2, we could use Guzzle 7 but turns out that the minimum supported version is |
@asvinb yes, our minimum supported version of PHP isn't changing at the same time as WP. I didn't quite follow your conclusion though – is it not possible to upgrade to v6 for now? |
@aaemnnosttv Apologies for the confusion. All good to upgrade to the latest v6 👍 Guess I was confused with another ticket I was working on. |
@asvinb great! Were you going to write the IB or is someone else best suited for that? |
IB ✔️ |
QA Update ✅
Require QA :Eng review as per QAB. |
Took a bit of work to QA the requests since it seems like our requests aren't sent through macOS's networking stack such that apps like Proxyman can pick them up, but got through it in the end 😅 QA ✅ |
Just as another QA note: @aaemnnosttv reminded me how to configure the WordPress proxy and it worked fine: 👍🏻 |
Feature Description
As mentioned a few times, most recently again in #223.
Perhaps it could just be bumped?
google/apiclient
supports it, so there shouldn't be a conflict in that regard.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 v6 version (but not v7)Client_Factory::create_client
)Implementation Brief
FakeHttpClient
with Guzzle'sMockHandler
Client
is designed to be immutable, so in order to make changes, a new instance must be set/returned. Because of this, an alternate client instance is lost as soon as such a modification is needed, and since this happens within the Google API client as part of every request when providing theaccess_token
, it's no longer a viable strategy.MockHandler
for overriding requests in tests will persist acrossClient
instances via thehandler
request option.FakeHttpClient
with aMockHandler
via the Guzzle client'shandler
configuration. See https://docs.guzzlephp.org/en/6.5/testing.html for detailsMockHandler
serves requests in order from a given queue whereasFakeHttpClient
has full control over the response returned so we may want to look into extending theMockHandler
to allow for conditional responses rather than a simple queue (a quick search yielded a package that provides something similar so it should at least be possible, or we can maybe even just use this one)Google_Client->getHttpClient()->getConfig()
)handler
Client
using the new/modified config arrayClient
back in the Google API client (Google_Client->setHttpClient(newClientInstance)
)FakeHttpClient
QA Brief
QA:Eng
Changelog entry
guzzlehttp/guzzle
updated to v6.5.8.The text was updated successfully, but these errors were encountered: