-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[packagist] api v2 support #7681
[packagist] api v2 support #7681
Conversation
Packagist deprecated the original `packagist.org/p/username/package` endpoint in favor of v2 `packagist.org/p2/username/package` endpoint. Because of this, new packages aren't being found using v1. This PR updates the Packagist service to use the new endpoint.
Some packages don't return the same data structure as others with the new api endpoints. This changes the validation schema to account for the potential differences.
Address issues raised by @chris48s in badges#6508, which this PR is base on. Includes: * Remove getDefaultBranch() from base class for it is no longer used. * Change try-catch statement syntax to align code style. * Rename findRelease() to findLatestRelease() for clarity.
* Change BasePackagistService.decompressResponse to static method BasePackagistService.expandPackageVersions. * Fix expandPackageVersions implementation. * Add unit test for the function.
* extend BasePackagistService.findLatestRelease to also handle PackagistVersion. * remove PackagistVersion.transform.
* Update findLatestRelease to throw NotFound itself. * Update PackagistLicense and PackagistVersion and remove the NotFound throwing logics.
* The test was on a false assumption that '__unset' might appear inside an array leaf while the composer's MetadataMinifier::minify never does thing recursively. The '__unset' should be value of the top level key.
Yeah will give it a quick pass after work today |
Yeah no worries. Just to clarify, these commits take us up to the point in the previous PR where you left the comments
and
last time. |
Closes #7020.
As discussed in #7575 (comment) , lets merge this bit and use it as a baseline for further work
@calebcartwright - are you good to give this one a quick 👍 ?