KnpLabs / packagist-api

PHP API for Packagist
MIT License
182 stars 46 forks source link

getComposer is broken in 2.x-dev #76

Closed stof closed 2 years ago

stof commented 2 years ago

72 is using the /p2/<package>~dev.json file for the getComposer method and adds a getComposerLite method for /p2/<package>.json. But this is not equivalent to the behavior of the 1.x version, due to a misunderstanding of the way those files look like.

The ~dev.json file contains only versions for branches while the .json file contains the tags (this is done to improve caching, as the tag file is invalidated only when a release is done while the branch file is invalidated on each push, and composer does not need to dev versions by default).

To reproduce the 1.x behavior, the SDK would need to load both files and then merge the version lists for each package name. And lite is a bad description. getComposerReleases would be a better name.

robbieaverill commented 2 years ago

cc @JellyBellyDev, how does this sound to you?

I'm happy to make the changes.

JellyBellyDev commented 2 years ago

Hi! Sorry for my late.
@stof thanks for reporting!
The documentation really fooled me and now I notice that the docs it has been updated to prevent others from making the same mistake. The mistake is "mine", "I" fix it! ;)

@robbieaverill WDYT if in the getComposer method we fetch both endpoints and I rename getComposerLite with getComposerReleases and I add new method getComposerBranches or you prefer getComposerDev?

Thanks!

robbieaverill commented 2 years ago

Hi @stof, this change is now available in v2.0.0-rc1. Please let me know if you have any problems with this version.

Thanks to @JellyBellyDev for contributing the changes and following up on adjustments to them!