Determine why recent versions of Composer fail to resolve self.version strings for Merge Requests

Created on 13 January 2023, almost 2 years ago
Updated 16 February 2023, almost 2 years ago

Problem/Motivation

Sometime on or around January 9th, after πŸ“Œ Update PHP 8 containers with latest security release Fixed , DrupalCI testing for Merge Requests began failing with a Composer Error:

00:00:51.277 > Drupal\Composer\Composer::ensureComposerVersion
00:00:51.277 Installing dependencies from lock file (including require-dev)
00:00:51.277 Verifying lock file contents can be installed on current platform.
00:00:51.277 - Required package "drupal/core" is in the lock file as "10.1.x-dev" but that does not satisfy your constraint "self.version".
00:00:51.277 - Required package "drupal/core-project-message" is in the lock file as "10.1.x-dev" but that does not satisfy your constraint "self.version".
00:00:51.277 - Required package "drupal/core-vendor-hardening" is in the lock file as "10.1.x-dev" but that does not satisfy your constraint "self.version".
00:00:51.277 This usually happens when composer files are incorrectly merged or the composer.json file is manually edited.

Most likely, when we updated the PHP containers for the recent security release, the Composer version updated and Composer's 'Guesser' logic must have changed.

Example failures

https://www.drupal.org/project/drupal/issues/3322743 πŸ“Œ Fix PHPStan L2 errors "Parameter $foo of method Foo::bar() has invalid type Foo\Baz." and "Method Foo::bar() has invalid return type Foo\Baz. " Fixed
https://dispatcher.drupalci.org/job/drupal_patches/161235/console
https://www.drupal.org/i/3313342 β†’

Proposed resolution

For now:

  1. Roll back/pin a version to get current MRs working
  2. Open a new issue to investigate 'what changed between Composer 2.4.4 and (whatever current version is) to result in bad self.version guessing
  3. Resolve that, then unpin version again
  • Alternately - once we are pinned on a known working version, seeing if MR testing directly with GitLabCI in those later environments has that problem or not - if not - another reason to keep moving to GitLabCI

Remaining tasks

  1. : https://git.drupalcode.org/project/drupalci_testbot/-/commit/4275bd2f9af...
  2. Separately run some testing on new versions of Composer
  3. Figure out how to fix the testing incompatibility, if we can from our side
  4. If necessary, open upstream bug with Composer team
πŸ› Bug report
Status

Fixed

Component

PHP Containers

Created by

πŸ‡ΊπŸ‡ΈUnited States hestenet Portland, OR πŸ‡ΊπŸ‡Έ

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024