Update ProcessOutputCallback to fail on Composer deprecations, to get early notifications of Composer changes

Created on 20 March 2023, over 1 year ago
Updated 5 July 2023, over 1 year ago

Problem/Motivation

Tweak package_manager/src/ProcessOutputCallback.php in a test context, because in a test context we may want Composer deprecations to cause test failures, so we are notified of upstream changes and can update our implementation to track upstream.

https://git.drupalcode.org/project/automatic_updates/-/merge_requests/71...

Steps to reproduce

N/A

Proposed resolution

Bring back what @omkar.podey's earlier MR716 for 📌 Allow JsonProcessOutputCallback and other Composer runner callbacks to gracefully handle deprecated command options Fixed did previously:

    if ($error !== '' && !str_contains($error, 'deprecated') && !str_contains($error, 'deprecation')) {
      throw new \Exception($error);
    }

… but only in a test context.

We already have prior art for detecting whether we're inside a test or not: \Drupal\package_manager\Validator\PhpExtensionsValidator::insideTest() (which is private static and can be copied in its entirety).

Remaining tasks

  1. Write a test that simulates composer showing a deprecation error in its output; this test should expect an exception.
  2. Make the test pass by ensuring that this exception is thrown when appropriate.

User interface changes

None.

API changes

None.

Data model changes

None.

📌 Task
Status

Postponed

Version

3.0

Component

Code

Created by

🇮🇳India omkar.podey

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

Comments & Activities

Production build 0.71.5 2024