Problem/Motivation

The wikimedia/composer-merge-plugin was deprecated in Drupal 8.8.0. It was also removed from the project templates and the tarball downloads, and presently only exists in the root-level drupal/drupal repository, which is only used for core development. It should be completely removed in Drupal 9.

Support for Composer 2.x in the wikimedia/composer-merge-plugin is in progress. Removing this plugin will simplify Composer 2 support in Drupal 9.

Proposed resolution

Remove wikimedia/composer-merge-plugin from Drupal's composer.json / lock files. Contrib modules that use wikimedia/composer-merge-plugin must already instruct users to re-add it to their site in order to use it.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

The wikimedia/composer-merge-plugin dependency has been removed because it is incompatible with Composer 2. It was deprecated in Drupal 8.8.0, and has not been used in core since that release. Any sites that have a separate requirement for this project should add it as a direct dependency.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

greg.1.anderson created an issue. See original summary.

greg.1.anderson’s picture

Category: Task » Bug report
Issue summary: View changes

Actually, it appears that wikimedia/composer-merge-plugin was effectively removed from Drupal 8.8.0, and exists only in the root-level composer.json file used only for core development. The wikimedia/composer-merge-plugin is not used for core development, so I think it could be considered a bug that it is still named but unused in the sources.

greg.1.anderson’s picture

Issue summary: View changes
greg.1.anderson’s picture

Here's a simple patch that removes wikimedia/composer-merge-plugin. The composer.lock diffs are more lengthy than one might expect necessary due to recent versions of Composer inserting "funding" information into the composer.lock file. I could revert to an older version of Composer to get rid of these, but it might be an uphill battle.

greg.1.anderson’s picture

Status: Active » Needs review

... and run the tests.

Status: Needs review » Needs work

The last submitted patch, 4: 3127013-4.patch, failed testing. View results

greg.1.anderson’s picture

Status: Needs work » Needs review
FileSize
4.28 KB

I downgraded to Composer 1.9.0 and re-generated the lock file. Newer versions of Composer calculate hashes differently, causing the failure in #4. That will have to be fixed somehow in a follow-on issue.

jungle’s picture

+++ b/composer.lock
@@ -693,7 +693,10 @@
+            "description": "Drupal is an open source content management platform powering millions of websites and applications.",
+            "transport-options": {
+                "relative": true
+            }
         },

@@ -723,7 +726,10 @@
+            ],
+            "transport-options": {
+                "relative": true
+            }

@@ -753,7 +759,10 @@
-            ]
+            ],
+            "transport-options": {
...
+            }

@@ -6544,5 +6504,6 @@
-    "platform-dev": []
+    "platform-dev": [],
+    "plugin-api-version": "1.1.0"

Looks like they are unexpected changes, submitting the new one generated while reviewing.

catch’s picture

Priority: Normal » Critical

Bumping priority since this blocks a critical issue.

Status: Needs review » Needs work

The last submitted patch, 8: 3127013.8.patch, failed testing. View results

jungle’s picture

Status: Needs work » Needs review

Remaining direct deprecation notices (2)

2x: Passing an escaped locator to the named selector is deprecated as of 1.7 and will be removed in 2.0. Pass the raw value instead.
2x in DisplayTest::testDisplayPlugin from Drupal\Tests\views\Functional\Plugin

Seems irrelevant

andypost’s picture

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

Nice catch! I bet the branch is valid

catch’s picture

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

This will need to be backported to 9.0.x during the beta I think.

greg.1.anderson’s picture

Issue summary: View changes

The wikimedia/composer-merge-plugin was removed. It was deprecated in Drupal 8.8.0, and has not been used in core since that release.

jungle’s picture

The deprecated message in #8 or #11 is from \Behat\Mink\Selector\NamedSelector::escapeLocator()

 @trigger_error(
                'Passing an escaped locator to the named selector is deprecated as of 1.7 and will be removed in 2.0.'
                .' Pass the raw value instead.',
                E_USER_DEPRECATED
            );

This xpath in \Drupal\Tests\views\Functional\Plugin\DisplayTest::testDisplayPlugin() may be the culprit

$result = $this->xpath('//ul[@id="views-display-menu-tabs"]/li/a/child::text()');

I think this should be fixed in a separate issue.

Mixologic’s picture

The error in #8 looks like a random fail from upstream: https://www.drupal.org/project/drupal/issues/3041318

jungle’s picture

Do a quick test to prove that it's a random fail from upstream with tailored CI.

jungle’s picture

As #17 is green. proved it was!

greg.1.anderson’s picture

Issue summary: View changes

Hrmph, I put #14 in the wrong place.

Mile23’s picture

Status: Needs review » Needs work
Issue tags: +Needs change record

Generally +1. Because we're changing the expectations on the users, we need a CR saying that you'll need to specify the merge plugin after 9.0.0 (or whenever this gets released).

There's still not a patch to review.

Also is there a separate issue for the random fail so we can isolate that out?

greg.1.anderson’s picture

@mile23: #8 is the patch to review.

Also, wikimedia/composer-merge-plugin has been removed in tarballs and in the project templates since 8.8.0, so removing it from the root composer.json file only affects core development, where it's not used. I did make a basic change record, though; do you think anything in the CR needs to be changed or explained better?

greg.1.anderson’s picture

Related to the intermittent failure, I don't know what caused it. Seems like it might have been recognized by @mixologic. Anyone know if there's an issue for it?

jungle’s picture

Status: Needs work » Needs review
Related issues: +#3041318: Various random fails due to mis-triggered Mink deprecation error
  1. CR added by @greg.1.anderson https://www.drupal.org/node/3127178
  2. #8 is the patch to be reviewed.
  3. #3041318 reported the random fail. It's out of scope to fix it here

So set back to Needs Review.

andrey.troeglazov’s picture

Checked patch from #8 for me it looks good, applies without issues, composer install ran successfully, the local website also looks good.

andrey.troeglazov’s picture

Status: Needs review » Reviewed & tested by the community
catch’s picture

Issue tags: -Needs change record

Saving credit.

  • catch committed cf0b3f4 on 9.1.x
    Issue #3127013 by greg.1.anderson, jungle, andrey.troeglazov, andypost,...

  • catch committed 221ebd2 on 9.0.x
    Issue #3127013 by greg.1.anderson, jungle, andrey.troeglazov, andypost,...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 9.1.x then backported to 9.0.x, thanks!

greg.1.anderson’s picture

Thanks @catch! Are we going to backport to 8.9.x as well? Is Composer 2 support important for 8.9.x, or can that be a 9.0-only feature?

Let me know if you'd like a patch for d8.

catch’s picture

Version: 9.0.x-dev » 8.9.x-dev
Status: Fixed » Needs review
Issue tags: +Needs release manager review

Good point we should at least discuss it.

greg.1.anderson’s picture

My opinion on this patch is that wikimedia/composer-merge-plugin is not in tarball downloads or Composer project templates in 8.8.0, and is not used in core development, so I would think that we could backport this as a bug fix.

Mixologic’s picture

I think the only reason we left it lying around is on the off chance that people had custom modules and were relying on it shipping with core. Its really nbd if it gets removed, as people can always add it back with a composer command, but it hints at that whole "what do we actually consider an api change here"

The original change record here: gives end users instructions on what to do in that situation.
https://www.drupal.org/node/3069730

Im thinking we could probably remove it in 8.9.x as well.

jungle’s picture

BTW. the patch in #33 for 8.9.x does not apply to 8.8.x, Probably, it's just because, #3078671: Pin behat/mink and behat/mink-selenium2-driver to use resolvable release has not been ported to 8.8.x.

greg.1.anderson’s picture

#34: The thing is, though, that it's not lying around any more -- it has been removed from the tarballs. We decided that folks didn't need it if they were installing from the project templates, but it was perhaps not anticipated that later, when the project templates were used to generate the tarballs, that it would disappear there as well. Which is in fact what happened.

#35: I don't think we need to backport this to 8.8.x unless we're planning on supporting Composer 2 in 8.8.x. I don't know if that's a desired goal, but it's probably not necessary.

catch’s picture

Yeah I think we should focus on 8.9.x support here since that's the release that'll be supported until the end of next year, and if there is any disruption, we wouldn't want that in a patch release.

greg.1.anderson’s picture

+1 on #37. In the way of timelines, the Composer 2 release is blocked on composer/semver 2.0.0, which is blocked on composer/semver#79. There may be other blockers for Composer 2. Hard to say when it will be done, but it would be good to be ready in 8.9.x in case it is.

Mixologic’s picture

#36 ah true. So basically its just lying around in the git clone. I think we can safely remove it without any forseeable disruption.

longwave’s picture

Status: Needs review » Reviewed & tested by the community

Patch is identical to #8 except for the lock hash, so this is good to go in 8.9.x.

  • catch committed fa275bd on 8.9.x
    Issue #3127013 by jungle, greg.1.anderson, catch, Mixologic, andrey....
catch’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -Needs release manager review

OK I think it's more important to have 8.9 compatibility with composer 2 than the theoretical disruption via removing the merge plugin from composer.lock.

Committed fa275bd and pushed to 8.9.x. Thanks!

xjm’s picture

Status: Fixed » Closed (fixed)

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

xjm’s picture

Issue summary: View changes

Updated the release note to justify why we're removing a dependency in a minor release and to provide an actionable next step for anyone affected. (What it was before; what it is now; who's affected; what they should do.)

webczarina’s picture

Issue summary: View changes

I'm updating the GitHub link to reflect the most recent progress on this issue.

ressa’s picture

Should the Change Record status be updated to "Published"? It is now in "Draft".

Also, I see a lot of Change Records where the parent issue is fixed, but the Change Record is still in "Draft".

quietone’s picture

@ressa, yes, but before publishing the change record it needs to be reviewed. One can't expect that it is accurate and up to date.

In this case, I have updated the CR and published it.

ressa’s picture

@quietone: I agree 100%, a change record needs to be reviewed before publishing.

But since the change was rolled out more than three years ago, it's high time the Change record was published.

And thanks for going through the big back log of Change records (~100?) and publishing the forgotten ones.