Problem/Motivation

  • Drupal 10.0 used psr/http-message 1.x. Drupal 10.1 supports either 1.x or 2.x and composer.lock uses 2.x, which means drupal/core-recommended pins to 2.x. Therefore, if sites have other dependencies that haven't yet been made compatible with psr/http-message 2.x, they can't upgrade from 10.0 to 10.1 without switching off of drupal/core-recommended.
  • psr/http-messages does not contain any code other than interfaces, so I don't think there's much safety value created by drupal/core-recommended pinning to a major/minor version.
  • 10.1's drupal/core-recommended also increases the major version of doctrine/lexer and egulias/email-validator, so those might also present upgrade problems from 10.0 to 10.1, but those packages have implementation code in them so their presence in drupal/core-recommended has value. Therefore, this issue is scoped to only psr/http-message.

Steps to reproduce

Proposed resolution

Remove psr/http-message from drupal/core-recommended. This means sites using drupal/core-recommended will potentially get new minor versions of psr/http-message, including versions not tested on DrupalCI, when they come out, but this seems low risk considering that package only defines interfaces and does not have any implementation code.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#2 unpin-http-message.patch1.55 KBeffulgentsia

Comments

effulgentsia created an issue. See original summary.

effulgentsia’s picture

Status: Active » Needs review
StatusFileSize
new1.55 KB
effulgentsia’s picture

Issue summary: View changes
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Timing couldn't be more perfect. Was updating to D10.1 and hit #3360754: Upgrade dependencies for Drupal 10.1 compatibility, use zipstream-php 3.0

Going to mark as I assume tests will pass. (none have failed from. checking console output).

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

catch’s picture

Version: 11.x-dev » 10.1.x-dev
Status: Reviewed & tested by the community » Fixed

Good plan. Committed/pushed to 11.x and 10.1x., thanks!

  • catch committed 6ec3889f on 10.1.x
    Issue #3361983 by effulgentsia, smustgrave: Remove psr/http-message from...

  • catch committed 0afc3485 on 11.x
    Issue #3361983 by effulgentsia, smustgrave: Remove psr/http-message from...
wim leers’s picture

This introduced test failures for build tests of https://www.drupal.org/project/automatic_updates.

A freshly queued test run against 10.1.x suddenly fails, with zero changes having been committed to that module since the last test run: https://www.drupal.org/pift-ci-job/2673631

1) Drupal\Tests\automatic_updates\Build\CoreUpdateTest::testApi
Failed asserting that 'Error: Interface "Psr\Http\Message\UriInterface" not found in include() (line 17 of /tmp/build_workspace_e1dc4f9c9db3e326a986c427d8d30cd1a0xXzJ/project/vendor/guzzlehttp/psr7/src/Uri.php).\n
' contains "Username:".

/var/www/html/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:122
/var/www/html/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:55
/var/www/html/core/tests/Drupal/BuildTests/Framework/BuildTestBase.php:292
/var/www/html/core/tests/Drupal/BuildTests/QuickStart/QuickStartTestBase.php:39
/var/www/html/modules/contrib/automatic_updates/package_manager/tests/src/Build/TemplateProjectTestBase.php:105
/var/www/html/modules/contrib/automatic_updates/package_manager/tests/src/Build/TemplateProjectTestBase.php:288
/var/www/html/modules/contrib/automatic_updates/tests/src/Build/UpdateTestBase.php:21
/var/www/html/modules/contrib/automatic_updates/tests/src/Build/CoreUpdateTest.php:71
/var/www/html/modules/contrib/automatic_updates/tests/src/Build/CoreUpdateTest.php:99
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestSuite.php:684
/var/www/html/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:651
/var/www/html/vendor/phpunit/phpunit/src/TextUI/Command.php:144
/var/www/html/vendor/phpunit/phpunit/src/TextUI/Command.php:97

which is triggered by \Drupal\BuildTests\QuickStart\QuickStartTestBase::installQuickStart():

  public function installQuickStart($profile, $working_dir = NULL) {
    $php_finder = new PhpExecutableFinder();
    $install_process = $this->executeCommand($php_finder->find() . ' ./core/scripts/drupal install ' . $profile, $working_dir);
    $this->assertCommandOutputContains('Username:');
…

But core's build tests are not failing! 🤔

I bet this is due to the special copying stuff with specific attention for vendor packages in \Drupal\Tests\package_manager\Build\TemplateProjectTestBase::createTestProject()… maybe because it's now only an indirect dependency that test is now failing? 🤔

Created #3362110: Since #3361983 was committed to Drupal core, psr/http-message needed to be explicitly required for build tests for investigating on the contrib module side.

kevinquillen’s picture

This was committed, but I still get a test failure here:

https://www.drupal.org/pift-ci-job/2675934

Do I need to change anything? AFAIK this error stems from the original issue.

effulgentsia’s picture

This issue is about drupal/core-recommended, whereas I think #10 is unrelated to drupal/core-recommended, but is a good question about DrupalCI. I opened #3362781: How to allow DrupalCI to downgrade packages from core's composer.lock versions when installing the contrib project under test? for that.

Status: Fixed » Closed (fixed)

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