Page MenuHomePhabricator

composer-merge-plugin support for composer 2.0
Closed, ResolvedPublic

Description

On Sat, Mar 28, 2020 at 2:35 PM Jordi Boggiano <j.boggiano@seld.be> wrote:

Hey,

I am emailing you because you are the maintainer on packagist.org of a
popular Composer plugin. If this falls in the wrong inbox please
ignore.

As we are getting Composer 2.0 closer and closer to a stable release,
and would like to get more people involved with testing it, it is
quite important to get the most common plugins to support our 2.0
branch. Otherwise many users will not be able to try the latest
Composer snapshots when we switch them to 2.0.

If you'd like to help, here is how:

  • Get composer's 2.0 branch easily using this phar file

https://seld.be/composer2.phar (sha256sum is
b7863783a37cea776d4eeab7843f4e968021456ce6df01358ce9c2cc85f3247a)

  • Set up a trial project requiring your plugin from a local path repo

so you can easily work on it and iterate, e.g.

    "repositories": [
        {"type":"path", "url": "../../my-plugin"}
    ],

  • Change your plugin's composer.json to require composer-plugin-api

"^1.0 || ^2.0" (to begin with)

  • Update your main plugin entry point class to implement the new

PluginInterface methods, see e.g.
https://github.com/composer/installers/commit/d2a98321ab66945396ef147387f93eee4c05089f#diff-e236c450b11f27e4bb81a5069bc619bc

  • Run php composer2.phar update in that trial project to play with

your plugin using Composer 2, and fix any issues you run into.

  • If at all possible, releasing a version which supports both

composer-plugin-api ^1.0 and ^2.0 is the best option really as that
will allow people to use whichever composer version within a project,
and makes the transition smoother. I am sure the more involved plugins
will not be able to do this but I think for most it should be
possible.

  • Finally, report issues to us at

https://github.com/composer/composer/issues if anything is broken or
unclear, we'll try to help out ASAP. There is no changelog nor
migration guide yet sorry about that, but I think most plugins don't
really integrate so tightly with Composer that they will need it.

Thanks for your attention and help getting the Composer v2 ecosystem
up to speed!

Best,
Jordi

Event Timeline

Reedy renamed this task from Test composer-merge-plugin against Composer 2.0 pre-release to composer-merge-plugin support for composer 2.0.Oct 26 2020, 12:05 AM
Reedy added a project: Composer.

Possible PR to fix up remaining issues at https://github.com/wikimedia/composer-merge-plugin/pull/189

@AMooney This PR that @Reedy linked here is the code that CPT should review, test, and merge to move things forward. I don't know which of the CTP boards to tag this ticket to for y'all to get it into your planning.

I just spotted https://github.com/wikimedia/composer-merge-plugin/pull/189 was merged but this ticket hasn't been updated so adding a note (I had been following the ticket & not the gitlab issue which was unfortunate as I didn't realise there was a fix merged)

It's great to see that the code has been updated at github!

Can somebody now update the packagist listing at https://packagist.org/packages/wikimedia/composer-merge-plugin so we can upgrade without going to dev-master? Or is more testing needed before that step?

The maintainers of the listing are the packagist usernames 'mediawiki' and 'wikimedia'.

It's great to see that the code has been updated at github!

Can somebody now update the packagist listing at https://packagist.org/packages/wikimedia/composer-merge-plugin so we can upgrade without going to dev-master? Or is more testing needed before that step?

That's done automagically when a release is tagged. One hasn't yet ;)

There's another issue been identified (before it was merged)

https://github.com/wikimedia/composer-merge-plugin/pull/189#issuecomment-776006358 an https://github.com/wikimedia/composer-merge-plugin/pull/189#issuecomment-778646839

Probably needs fixing before we do a release

Tim has released 2.0.1