Only use Composer 2 in Drupal 7 pipelines
Problem/Motivation
Since the start of October, support for Composer version 1 has been withdrawn from packages.drupal.org and this affects Drupal 7 contrib pipelines for projects that have a composer.json file.
Original issue summary for reference
Drupal 7 pipelines are failing with:
Composer version 1.10.27 2023-09-29 10:50:23
$ composer config repositories.0 composer https://packages.drupal.org/7
$ composer require --dev drupal/coder:^8.2@stable phpunit/phpunit symfony/filesystem drush/drush:^8.3.3
Warning from https://packages.drupal.org/7: Drupal.org packages ARE NO LONGER AVAILABLE FOR COMPOSER 1!!! Composer 1 is NOT supported. You should upgrade to Composer 2 now! See https://www.drupal.org/drupalorg/blog/ending-packagesdrupalorg-support-for-composer-1
PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in phar:///usr/local/bin/composer/src/Composer/Repository/ComposerRepository.php:622
Is this caused by the _TARGET_PHP variable being updated from 8.1 to 8.3, which is also used as the source for PHP_VERSION in the D7 pipeline?
Steps to reproduce
See this weekly pipeline on 5th October which passed,
and this one on 12th October which failed.
Related issue: Issue #3463894
Edited by drupalbot