Problem/Motivation

Drupal 10 will require Guzzle 7.

Goutte has a conflict with Guzzle7, but has already been deprecated as a core dependency in #3176655: Deprecate GoutteDriver use in core and use Behat\Mink\Driver\BrowserKitDriver directly instead and will be removed in #3187315: Remove mink-goutte-driver as a core dependency.

Proposed resolution

Update to Guzzle 7.

Remaining tasks

Steps to recreate this MR (which is easier than rebasing it) follow. Use the latest branch of the Goutte issue.

  1. git remote add drupal-3187315 git@git.drupal.org:issue/drupal-3187315.git
  2. git fetch drupal-3187315
  3. git checkout -b '3187315-9.3-goutte' --track drupal-3187315/'3187315-9.3-goutte'
  4. git checkout -b 3104353-9.3-guzzle
  5. rm -rf vendor
  6. composer install
  7. Increase the constraint for Guzzle in core/composer.json to the latest stable version.
  8. COMPOSER_ROOT_VERSION=9.3.x-dev composer update drupal/core guzzlehttp/guzzle
  9. git commit -am "COMPOSER_ROOT_VERSION=9.3.x-dev composer update drupal/core guzzlehttp/guzzle."
  10. git push --set-upstream drupal-9.3-3104353 HEAD

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

Guzzle has been updated to Guzzle 7.3.0. It requires psr/http-client 1.0.1, which has also been added as a dependency.

Issue fork drupal-3104353

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

xjm created an issue. See original summary.

xjm’s picture

Issue tags: +Drupal 9
TravisCarden’s picture

Status: Active » Needs review
FileSize
471 bytes

Patch attached. Let's see what happens.

Berdir’s picture

Status: Needs review » Needs work

You also need to update the lock file.

TravisCarden’s picture

Thanks, @Berdir. I just realized that. But doing that yields unexpected results. Here's my exact process beginning with the current 9.0.x branch (with select output):

git pull
git show-ref HEAD
# 47f71d29d702a808d59df2ad914b2acfd9218c50 refs/remotes/upstream/HEAD
git checkout -b guzzle-3104353
rm -rf vendor core/vendor
git -C core clean -fd

curl https://www.drupal.org/files/issues/2020-01-06/3104353-3.patch | git apply
composer -dcore install
composer -dcore info guzzlehttp/guzzle | grep versions # Expected version installed in core/:
# versions : * 7.0.0-beta.1
git status -s # No unexpected file changes:
#  M core/composer.json
# ?? core/composer.lock

# SO FAR SO GOOD.

composer update --lock
composer info guzzlehttp/guzzle | grep versions
# versions : * 6.5.2 # Unexpected version installed in root.
git status -s | head -10 # Lots of unexpected file changes:
# M composer.lock
# M composer/Metapackage/CoreRecommended/composer.json
# M core/MAINTAINERS.txt
# M core/assets/vendor/jquery-once/jquery.once.js
# M core/assets/vendor/jquery-once/jquery.once.min.js
# M core/assets/vendor/jquery-once/jquery.once.min.js.map
# M core/assets/vendor/jquery.ui/ui/data-min.js
# D core/assets/vendor/jquery.ui/ui/data.js
# M core/assets/vendor/jquery.ui/ui/disable-selection-min.js
# D core/assets/vendor/jquery.ui/ui/disable-selection.js
git status -s | wc -l # I mean LOTS:
     253

So to summarize:

  1. The CORRECT version of guzzlehttp/guzzle gets installed in core/ withOUT unexpected side effects.
  2. The WRONG version of guzzlehttp/guzzle gets installed in the root directory WITH unexpected side effects.

There's nothing in the composer update --lock output that mentions jquery-once, as an example of the unexpected file changes. There's clearly something going on here that I'm not familiar with--perhaps in the Composer plugins. Can someone enlighten me?

longwave’s picture

Composer gets confused about versions in this case and you need to set COMPOSER_ROOT_VERSION when updating. See https://www.drupal.org/node/3089540 for more info.

However it looks like we can't upgrade yet anyway because of another dependency which is locked to Guzzle 6:

fabpot/goutte  v3.2.3     requires  guzzlehttp/guzzle (^6.0)  

Goutte 4 looks like it drops the Guzzle requirement and uses Symfony HttpClient instead, but in turn behat/mink-goutte-driver will have to support Goutte 4.

TravisCarden’s picture

Thanks for explaining my Composer issue, @longwave!

TravisCarden’s picture

Status: Needs work » Needs review
FileSize
7.98 KB

So as @longwave says, upgrading for real is blocked by fabpot/goutte:3.x. Digging a little deeper, fabpot/goutte:4.x removes the Guzzle requirement altogether (and, in fact, does nothing other than that), so if we could upgrade to that, it would unblock us. Unfortunately, we only get fabpot/goutte as a requirement of behat/mink-goutte-driver, which pins to fabpot/goutte:3.x in the latest release. I've submitted a pull request to update its constraint, which would unblock us longterm. I'll report back here with any updates.

In the meantime, I'd like to see what the testbot says if we trick Composer into installing Guzzle 7.0.0-beta1. This patch is not committable.

TravisCarden’s picture

I confirmed that the testbot installed the correct version of Guzzle:

15:06:58 - Updating guzzlehttp/guzzle (6.5.2 => 7.0.0-beta.1): Downloading (100%) (See full log.)

And the tests pass. If this issue is purely exploratory, I guess we can close it--in which case, I assume we'll create a separate issue to actually commit a fix once Guzzle has a stable 7.x release and we're unblocked upstream.

xjm’s picture

Title: Test Guzzle 7.0.0-beta1 » [TESTING PATCH ONLY, DO NOT COMMIT] Test Guzzle 7.0.0-beta1
tedbow’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
216.38 KB

I look at the build artifacts https://dispatcher.drupalci.org/job/drupal_patches/28337/artifact/jenkin...
and confirmed it install guzzle 7.0.0-beta1 .

Uploading the composer-installed.json to show this

I also applied the patch and did

rm -rf vendor
composer install

I then confirmed that guzzle 7.0.0-beta1 was also installed locally.

Since this patch is not going to be committed I don't know if I should close it or mark it RTBC. Marking it as RTBC since we have proven that 7.0.0-beta1 which is the latest release will not break any of our tests.

TravisCarden’s picture

Issue summary: View changes
xjm’s picture

What would the next steps be for Guzzle 7 compatibility? Are there other deprendcies we should consider updating? If do they should make have their own issues.

longwave’s picture

As #8 says, we are blocked by our dependency on behat/mink-goutte-driver which depends on fabpot/goutte:3.x which in turn depends on guzzlehttp/guzzle:6.x.

https://github.com/minkphp/MinkGoutteDriver/pull/80 should resolve this, but upstream need help in getting the tests to run (let alone pass) before this can be merged.

Another option would be convince @fabpot to release a new version of fabpot/goutte:3.x which works with both Guzzle 6 and 7.

xjm’s picture

Version: 9.0.x-dev » 9.1.x-dev
Status: Reviewed & tested by the community » Postponed
Issue tags: +rc deadline, +beta target

Thanks for working on this issue. Still no new beta/RC/release from Guzzle. (The patch also no longer applies.) Therefore, I think postponed is the most accurate status. We were hoping we'd get Guzzle 7 before our RC, but looks like that's not happening.

So, I'm moving to 9.1.x. We can't/shouldn't actually bump the Guzzle requirement from 6 to 7 in a minor, but we can test it once stable and ensure we're forward-compatible for it for D10.

xjm’s picture

Title: [TESTING PATCH ONLY, DO NOT COMMIT] Test Guzzle 7.0.0-beta1 » [TESTING PATCH ONLY, DO NOT COMMIT] Test Guzzle 7.0.0
Status: Postponed » Needs work

Guzzle 7.0.0 has been released, so we should create a new patch and test against the stable release.

andypost’s picture

Status: Needs work » Needs review
FileSize
7.1 KB

Guess it will allow testing COMPOSER_ROOT_VERSION=9.1.x-dev composer require guzzlehttp/guzzle '7.0.0 as 6.5.5'

andypost’s picture

There's even 7.0.1

The last submitted patch, 17: 3104353-17.patch, failed testing. View results

andypost’s picture

2 failed, something wrong with checksum in tests of composer

Status: Needs review » Needs work

The last submitted patch, 18: 3104353-18.patch, failed testing. View results

xjm’s picture

+++ b/composer.json
@@ -12,7 +12,8 @@
+        "guzzlehttp/guzzle": "7.0.1 as 6.5.5"

+++ b/composer.lock
@@ -7177,7 +7240,14 @@
+    "aliases": [
+        {
+            "alias": "6.5.5",
+            "alias_normalized": "6.5.5.0",
+            "version": "7.0.1.0",
+            "package": "guzzlehttp/guzzle"
+        }
+    ],

Uh. Wut? Why the aliasing?

andypost’s picture

Because when I used to set ^6.5.5 || ^7.0 it failed because other constraints and I went with alias as previous patch

Will check it tomorrow deeper, idea was to make sure that everything pass on 7.x

longwave’s picture

#14 still stands, our dependencies don't yet support Guzzle 7.

catch’s picture

#14 seems to be the reason for the test failure, but otherwise that looks like a green run which is very encouraging.

longwave’s picture

The build test doesn't understand version aliasing, there is also what looks like an exception change but hopefully that is straightforward to update, so yes it's looking promising except for the upstream dependency issue!

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

xjm’s picture

Cleaning up leftover beta targets from 9.0.x. We still need this testing issue for D10.

KapilV’s picture

Assigned: Unassigned » KapilV
KapilV’s picture

Assigned: KapilV » Unassigned
xjm’s picture

Status: Needs work » Needs review
FileSize
14.81 KB

According to @Gábor Hojtsy we are deprecating the Goutte driver in #3176655: Deprecate GoutteDriver use in core and use Behat\Mink\Driver\BrowserKitDriver directly instead. That removes the blocker.

Steps to create this patch:

  1. diff --git a/composer.json b/composer.json
    index 12508828a1..d984b596ce 100644
    --- a/composer.json
    +++ b/composer.json
    @@ -17,7 +17,6 @@
         "require-dev": {
             "behat/mink": "^1.8",
             "behat/mink-browserkit-driver": "^1.3",
    -        "behat/mink-goutte-driver": "^1.2",
             "behat/mink-selenium2-driver": "^1.4",
             "composer/composer": "^2.0.2",
             "drupal/coder": "^8.3.7",
    diff --git a/core/composer.json b/core/composer.json
    index 46542ac447..7cbc411da2 100644
    --- a/core/composer.json
    +++ b/core/composer.json
    @@ -34,7 +34,7 @@
             "twig/twig": "^2.12.0",
             "doctrine/reflection": "^1.1",
             "doctrine/annotations": "^1.4",
    -        "guzzlehttp/guzzle": "^6.5.2",
    +        "guzzlehttp/guzzle": "^7.2.0",
             "symfony-cmf/routing": "^2.1",
             "laminas/laminas-feed": "^2.12",
  2. rm -rf vendor
  3. composer install
  4. composer remove behat/mink-goutte-driver
  5. COMPOSER_ROOT_VERSION=9.2.x-dev composer update drupal/core guzzlehttp/guzzle

Status: Needs review » Needs work

The last submitted patch, 31: guzzle-3104353-31.patch, failed testing. View results

xjm’s picture

Aight, looks like we've some compatibility issues to resolve:

  1. Media.Drupal\Tests\media\Functional\ProviderRepositoryTest
    ✗	
    Drupal\Tests\media\Functional\ProviderRepositoryTest
    fail: [Other] Line 0 of sites/default/files/simpletest/phpunit-731.xml:
    PHPUnit Test failed to complete; Error: PHPUnit 8.5.8 by Sebastian Bergmann and contributors.
    
    Testing Drupal\Tests\media\Functional\ProviderRepositoryTest
    ..F.                                                                4 / 4 (100%)
    
    Time: 53.25 seconds, Memory: 6.00 MB
    
    There was 1 failure:
    
    1) Drupal\Tests\media\Functional\ProviderRepositoryTest::testNonExistingProviderDatabase with data set #0 ('http://oembed1.com/providers.json', 'Could not retrieve the oEmbed...s.json')
    Failed asserting that exception of type "GuzzleHttp\Exception\ConnectException" matches expected exception "Drupal\media\OEmbed\ProviderException". Message was: "cURL error 6: Could not resolve host: oembed1.com (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://oembed1.com/providers.json" at
    /var/www/html/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:210
  2. Test.Drupal\Tests\Core\Test\BrowserTestBaseTest
    ✗	
    Drupal\Tests\Core\Test\BrowserTestBaseTest
    fail: [Other] Line 0 of sites/default/files/simpletest/phpunit-621.xml:
    PHPUnit Test failed to complete; Error: PHPUnit 8.5.8 by Sebastian Bergmann and contributors.
    
    Testing Drupal\Tests\Core\Test\BrowserTestBaseTest
    .W..                                                                4 / 4 (100%)
    
    Time: 288 ms, Memory: 6.00 MB
    
    There was 1 warning:
    
    1) Drupal\Tests\Core\Test\BrowserTestBaseTest::testGetHttpClientGoutte
    Class "Goutte\Client" does not exist.
  3. Also aggregator issue; although we might deprecate the module in core, the contrib version will still need to resolve:
    Aggregator.Drupal\Tests\aggregator\Functional\FeedParserTest
    ✗	
    Drupal\Tests\aggregator\Functional\FeedParserTest
    exception: [Other] Line 0 of sites/default/files/simpletest/phpunit-19.xml:
    PHPUnit Test failed to complete; Error: PHPUnit 8.5.8 by Sebastian Bergmann and contributors.
    
    Testing Drupal\Tests\aggregator\Functional\FeedParserTest
    ....E                                                               5 / 5 (100%)
    
    Time: 1.05 minutes, Memory: 6.00 MB
    
    There was 1 error:
    
    1) Drupal\Tests\aggregator\Functional\FeedParserTest::testInvalidFeed
    Behat\Mink\Exception\ExpectationException: The string "The feed from aSJTH0oJ seems to be broken because of error" was not found anywhere in the HTML response of the current page.
    
  4. Plus a test that just needs an update for the change:

    Drupal\Tests\ComposerIntegrationTest
    fail: [Other] Line 0 of sites/default/files/simpletest/phpunit-111.xml:
    PHPUnit Test failed to complete; Error: PHPUnit 8.5.8 by Sebastian Bergmann and contributors.
    
    Testing Drupal\Tests\ComposerIntegrationTest
    .............S.............................................FF     61 / 61 (100%)
    
    Time: 822 ms, Memory: 6.00 MB
    
    There were 2 failures:
    
    1) Drupal\Tests\ComposerIntegrationTest::testVendorCleanup with data set #0 ('Drupal\Core\Composer\Composer', 'packageToCleanup')
    Failed asserting that an array contains 'behat/mink-goutte-driver'.
xjm’s picture

Status: Needs work » Needs review
FileSize
15.7 KB
915 bytes

I think this will resolve #33.4; points 1-3 still need fixing.

longwave’s picture

#33.2 just needs the legacy testGetHttpClientGoutte test deleting entirely, as the driver has been removed in this patch.

The other two look like Guzzle has rearranged the exception tree and so we need to change what we catch.

xjm’s picture

Ah yep, first bit of #35 makes sense as simply part of the dep removal. Attached should address that as well, leaving #33.1 and .3.

The last submitted patch, 34: guzzle-3104353-34.patch, failed testing. View results

Status: Needs review » Needs work

The last submitted patch, 36: guzzle-3104353-36.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

xjm’s picture

Oh, we need to remove the whole test, not just the one method:

	Browsertestbase.Drupal\FunctionalTests\GoutteDriverTest
✗	
Drupal\FunctionalTests\GoutteDriverTest
exception: [Other] Line 0 of sites/default/files/simpletest/phpunit-82.xml:
PHPUnit Test failed to complete; Error: PHPUnit 8.5.8 by Sebastian Bergmann and contributors.

Testing Drupal\FunctionalTests\GoutteDriverTest
E                                                                   1 / 1 (100%)

Time: 4.99 seconds, Memory: 4.00 MB

There was 1 error:

1) Drupal\FunctionalTests\GoutteDriverTest::testGoTo
Error: Class 'Behat\Mink\Driver\GoutteDriver' not found

/var/www/html/core/tests/Drupal/Tests/BrowserTestBase.php:320
/var/www/html/core/tests/Drupal/Tests/BrowserTestBase.php:221
/var/www/html/core/tests/Drupal/Tests/BrowserTestBase.php:370
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:691

ERRORS!
Tests: 1, Assertions: 1, Errors: 1.
xjm’s picture

Moved the Goutte removal into its own issue and fixing it up there: #3187315: Remove mink-goutte-driver as a core dependency

xjm’s picture

OK, let's see if I can make an MR on top of the other issue work nicely...

xjm’s picture

OK, here we go. This is branched from #3187315: Remove mink-goutte-driver as a core dependency and can be rebased against that issue's branch until it lands, whereupon we rebase against HEAD and git magically resolves everything. 🤞

To keep this up to date:

  1. Ensure #3187315: Remove mink-goutte-driver as a core dependency is up to date with a rebase against 9.2.x and passing tests.
  2. git revert d9f6ffe (or whatever the latest commit is to update the constraint).
  3. git remote add drupal-3104353 git@git.drupal.org:issue/drupal-3104353.git
  4. git fetch drupal-3104353
  5. git checkout -b '3187315-goutte' --track drupal-3187315/'3187315-goutte'
  6. git checkout 3104353-guzzle
  7. git rebase 3187315-goutte (and resolve any conflicts).
  8. rm -rf vendor
  9. composer install
  10. COMPOSER_ROOT_VERSION=9.2.x-dev composer update drupal/core guzzlehttp/guzzle
  11. git commit -am "Update lockfile and metapackages."
  12. git push --set-upstream drupal-3104353 HEAD
xjm’s picture

Status: Needs work » Needs review

Note that the commit I just pushed might get the Media test passing, but there are other places in HEAD that could be affected and just might be lacking test coverage:

[ayrton:drupal | Wed 14:46:56] $ grep -rl "use GuzzleHttp\\\Exception\\\RequestException" * | grep -v "vendor"
core/tests/Drupal/Tests/DrupalTestBrowser.php
core/includes/install.core.inc
core/modules/locale/locale.batch.inc
core/modules/update/src/UpdateFetcher.php
core/modules/aggregator/src/Form/OpmlFeedAdd.php
core/modules/aggregator/src/Plugin/aggregator/fetcher/DefaultFetcher.php
core/modules/system/system.module
core/modules/media/src/OEmbed/ProviderRepository.php
core/modules/media/src/OEmbed/ResourceFetcher.php
core/modules/media/src/OEmbed/UrlResolver.php
core/modules/media/src/Plugin/media/Source/OEmbed.php
xjm’s picture

So that's green, but it's possible the following other places also might need to be changed and just lack test coverage, since they also catch the same exception:

  1. core/tests/Drupal/Tests/DrupalTestBrowser.php
  2. install_retrieve_file() and install_check_localization_server()
  3. locale_translation_http_check()
  4. core/modules/update/src/UpdateFetcher.php
  5. core/modules/aggregator/src/Form/OpmlFeedAdd.php
  6. system_retrieve_file()
  7. core/modules/media/src/OEmbed/ResourceFetcher.php
  8. core/modules/media/src/OEmbed/UrlResolver.php
  9. core/modules/media/src/Plugin/media/Source/OEmbed.php

Both Guzzle\Exception\RequestException and Guzzle\Exception\ConnectException exist in both Guzzle 6 and 7. However, in Guzzle 6, ConnectException extends RequestException, whereas in Guzzle 7 they are siblings (both extending TransferException directly) that implement different interfaces. This means that it's also probably safe to backport the simple fixes I made above to D9; it'd just be slightly redundant.

So whether we catch both or not might differ on a case-by-case basis. My guess is that in most cases we'll want to catch both because usually all we care about is that the request didn't work and we want to log, handle, or re-throw that. In other cases where something depends on the response, ConnectException might not be appropriate. At least one of the cases above (forget which) checked for a null response within the catch, so it's possible that spot should actually be refactored a little.

Edit: We could also potentially simplify it even more and just catch TransferException (the parent) in most cases.

xjm’s picture

Status: Needs review » Needs work

Going to make that change.

xjm’s picture

Status: Needs work » Needs review

I have not changed DrupalTestBrowser to use TransferException, because it re-throws the exception if the response is NULL, and that's always the case for ConnectException. I also added an additional catch block to locale_translation_http_check() since the logic of the existing catch relies on methods that ConnectException no longer has.

longwave’s picture

This is looking pretty good, I wonder even if we can commit some of the exception changes now to 9.2.x? It looks like we can go up to TransferException in Guzzle 6 and it would be just as applicable in most if not all cases.

xjm’s picture

@longwave Yep, my next step if that was green was to make a separate issue to exactly that. And green it is, so doing that now. :)

xjm’s picture

xjm’s picture

Ugh, please ignore the two branches I pushed by accident there.

xjm’s picture

Title: [TESTING PATCH ONLY, DO NOT COMMIT] Test Guzzle 7.0.0 » Upgrade to Guzzle 7
Status: Needs review » Postponed

Retitling and postponing this now that we have an actual path forward for D10.

xjm’s picture

xjm’s picture

Gábor Hojtsy’s picture

xjm’s picture

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

xjm’s picture

Issue summary: View changes

Updating outdated IS.

xjm’s picture

Issue summary: View changes
xjm’s picture

Issue summary: View changes
xjm’s picture

Closed the old MR and rebuilt the new one atop the new branch of #3187315: Remove mink-goutte-driver as a core dependency which was itself rebuilt atop 9.3.x.

catch’s picture

Title: Upgrade to Guzzle 7 » [PP-1] Upgrade to Guzzle 7

So #3224421: [PHP 8.1] Add a shim to Guzzle 6 for PHP 8.1 compatibility is working around Guzzle 6 not wanting to make any non-security commits. That workaround is OK as a stop-gap, but I think it would be better if we enabled installing Guzzle 7 in Drupal 9.

This is still blocked on #3187315: Remove mink-goutte-driver as a core dependency, but going to unpostpone that one and suggest we do it in Drupal 9.

kim.pepper’s picture

Title: [PP-1] Upgrade to Guzzle 7 » Upgrade to Guzzle 7
Status: Postponed » Active
Murz’s picture

Guzzle 7 is required for https://github.com/open-telemetry/opentelemetry-php library to gain modern tracing in Drupal, so with Guzzle 6.x we can't install OpenTelemetry php library. So will be great to have this solved in 9.x branch!

Taran2L made their first commit to this issue’s fork.

longwave’s picture

Status: Active » Needs review

Good news that the tests are passing in the MR.

Are we going to allow both Guzzle 6 and 7 here, but stay pinned to Guzzle 6 in core-recommended so users can choose not to get the major version bump?

Murz’s picture

Can anybody describe how can I apply that MR to my Drupal instance?

If I apply it as patch, using "cweagans/composer-patches", composer still don't allow me to install guzzle 7, becase seems it checks dependencies in composer.json before patches are applied.

If I try to download composer package from forked git repo https://git.drupalcode.org/issue/drupal-3104353/-/tree/3104353-9.3-guzzle - it can't download the drupal/core package (only drupal/drupal can be installed from git), because that is monorepo, and drupal/core is located in ./core subfolder.

So, I have no other ideas how can I switch my Drupal installation to that forked version of Drupal core via composer. Maybe anybody can suggest any working method?

xjm’s picture

Title: Upgrade to Guzzle 7 » [TESTING ISSUE ONLY, DO NOT COMMIT] Upgrade to Guzzle 7

@longwave Yes, as per my comment on #3224421-8: [PHP 8.1] Add a shim to Guzzle 6 for PHP 8.1 compatibility we can change our constraint to "guzzlehttp/guzzle": "^6.5.2 || ^7.3.0", so that sites can use it, but keep core-recommended pinned to Guzzle 6.

@Murz Note that Drupal 9 itself will not be updated to use Guzzle 7 as in this issue, because that would be a major version break and violate semver. This is a Drupal 10 readiness issue and onl filed against 9.3.x because 10.0.x is currently only a stub. For help using Composer to override/alias dependencies and such, I would suggest asking in the #composer channel in the Drupal Slack.

@Taran2L, I do not believe the merge you made was necessary. This branch is periodically rebuilt, but the previous MR was still passing. I'm removing issue credit for this pending an explanation. But thanks for your interest in this issue!

xjm’s picture

Title: [TESTING ISSUE ONLY, DO NOT COMMIT] Upgrade to Guzzle 7 » [10.0.x ISSUE ONLY, DO NOT COMMIT] Upgrade to Guzzle 7

I think a separate issue should be filed for allowing Guzzle 7 in our constraint in D9. This issue is for D10. Thanks!

Taran2L’s picture

@xjm, your MR was not mergeable anymore due to goutte being removed in 9.3.x. I had to do a force push in order to save time doing rebases. Sorry if that is confusing

xjm’s picture

Thanks @Taran2L! For these dependency update issues, it is better to simply merge the non-composer-command commits and then re-run the composer command. I'll try to put instructions in the IS about this. Adding back credit -- thanks for the explanation.

xjm’s picture

Status: Needs review » Reviewed & tested by the community

Let's put this in the RTBC queue as a support request like #3044175: [DO NOT COMMIT] Vendor minimum testing issue to get retesting on it. That way we can keep an eye on our Guzzle 7 compatibility.

xjm’s picture

Category: Task » Support request

(For now.)

xjm’s picture

Priority: Major » Critical

Unrelatedly, since Guzzle 6 is now security-only, upgrading to Guzzle 7 is now a beta blocker for D10.

catch’s picture

Title: [10.0.x ISSUE ONLY, DO NOT COMMIT] Upgrade to Guzzle 7 » [DO NOT COMMIT] [10.0.x ISSUE ONLY] Upgrade to Guzzle 7

Just adjusting the title for easier RTBC queue scanning.

catch’s picture

Title: [DO NOT COMMIT] [10.0.x ISSUE ONLY] Upgrade to Guzzle 7 » Upgrade to Guzzle 7
Version: 9.3.x-dev » 10.0.x-dev
Category: Support request » Task
Gábor Hojtsy’s picture

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

The MR needs to be updated to be from 10.0.x and the composer conflicts need to be resolved.

longwave’s picture

Status: Needs work » Needs review
FileSize
9.42 KB

Patch for 10.0.x.

alexpott’s picture

Status: Needs review » Needs work

This issue can remove the guzzle shim and some skipped deprecations too

andypost’s picture

kim.pepper’s picture

Status: Needs work » Needs review
FileSize
13.67 KB
4.84 KB

#83 Removes shim and ignored deprecations.

Spokje’s picture

In the last testrun all chromedriver tests failed (Couldn't connect to chromedriver-jenkins-drupal-patches-105182).
Seems highly unlikely that this is related to this MR, so ordered a retest.

Spokje’s picture

Status: Needs review » Reviewed & tested by the community

- TestBot turned green
- guzzlehttp/guzzle Is updated from 6.5.5 to 7.4.0 (^6.5.2 => ^7.3.0)
- Shim is removed
- Ignored deprecations removed

RTBC for me.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 0ac9613 and pushed to 10.0.x. Thanks!

  • alexpott committed 0ac9613 on 10.0.x
    Issue #3104353 by xjm, TravisCarden, andypost, kim.pepper, longwave,...
alexpott’s picture

Issue tags: +10.0.0 release notes

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.