Backport: Compose Metadata Analyzer: Use v2 URL #4485
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Use Composer Repository V2 url for metadata as v1 is deprecated and becoming readonly soon. V1 endpoint will be removed from packagist later this year. This PR removes V1 metadata handling from DT.
Addressed Issue
Fixes #2337
Backports #4470
Additional Details
The metadata being returned for V2 has the same format as V1, except that the releases for a package are returned as an Array instead of a JSONObject.
One thing that changed is how non-existing (or no longer existing) packages are being handled:
I added a new unit test for the 404 scenario. I also removed the V1 unit test because I don't have a real world example of this happening in V2. Or should that unit test remain in place with some dummy package just to make sure we don't regress on this code path in the future?
Checklist