Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ComposerRepository::getProviderNames has different behavior in case providers are provided as partial packages #8526

Closed
boesing opened this issue Jan 13, 2020 · 5 comments
Labels
Bug
Milestone

Comments

@boesing
Copy link
Contributor

@boesing boesing commented Jan 13, 2020

Hey there,

I am actually migrating some projects using private packages to laminas.
Laminas is using the laminas/laminas-dependency-plugin to manipulate installation operations (they change the package inside the operation to avoid installing one of the old packages).

In laminas/laminas-dependency-plugin#6 I've reported a bug, that our projects do not properly migrate due to the {"packagist.org": false} entry in our repositories property.

After some debugging with composer, I found out, that the provider names are not properly returned for lazy packages. Private packagist creates a packages.json with packages and providers-lazy-url which packagist.org does not have.

I've created a possible fix in #8516

Would love to get any feedback in the PR.

@Seldaek

This comment has been minimized.

Copy link
Member

@Seldaek Seldaek commented Jan 13, 2020

Do you have the laminas packages present in your private packagist instance or not? If yes I assume the plugin should work correctly, but I am not 100% sure I understand the implications of the hackery they are doing here tbh.

In any case your patch seems harmless enough that I am fine merging it, but I don't really understand why it fixes things, nor what the problem is exactly that you experienced.

@Seldaek Seldaek added this to the 1.9 milestone Jan 13, 2020
@Seldaek Seldaek added the Bug label Jan 13, 2020
@boesing

This comment has been minimized.

Copy link
Contributor Author

@boesing boesing commented Jan 13, 2020

Yes, they are present in my private packagist.

TL;DR
The zendframework packages (actually no package at all are found by "findPackage") are not being returned in case that packagist.org is disabled as a repository plus a private packagist provides its package.json
Satis does not provide "partial providers" informations and therefore no issue here.

Long Story
The thing is, that "getProviderNames" returns different Informations if the packages.json tells composer that it is splitted into partials.
Ive tested around with our private packagist which returns the information that it has partial informations about the providers but still has a full list of packages it provides.
Thus, I am not sure why there is a handling for "hasPartialProviders" in the first place.

Probably some legacy stuff? I found a work around without creating a new assumption of having "packages" available in the package.json

@Seldaek Seldaek closed this in 3791a57 Jan 14, 2020
@Seldaek

This comment has been minimized.

Copy link
Member

@Seldaek Seldaek commented Jan 14, 2020

Ok merging then

@Seldaek

This comment has been minimized.

Copy link
Member

@Seldaek Seldaek commented Jan 14, 2020

thanks for the patch, I hope you can confirm it works with the latest composer.phar snapshot

@boesing

This comment has been minimized.

Copy link
Contributor Author

@boesing boesing commented Jan 14, 2020

Confirming that this patch solved the dependency resolution issue with laminas migration tool.
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.