-
-
Notifications
You must be signed in to change notification settings - Fork 583
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
Compose Metadata Analyzer: Use v2 URL #4470
base: master
Are you sure you want to change the base?
Compose Metadata Analyzer: Use v2 URL #4470
Conversation
72be736
to
22b55f7
Compare
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesCodacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more |
The current code only works with repositories that use the default url pattern for package metadata:
More extensive changes are needed to support repositories that use a different url pattern, or provide the package metadata inline. Those changes should go into a different PR so we can keep this PR here simple. Hopefully that helpts to get this PR merged/released before Composer V1 stops providing new metadata (February 1st 2025) |
So this really could (should!) go out in the 4.12.3 bugfix release then. Even if we get 4.13 out before Feb, not everyone will upgrade non-bugfix releases immediately. So better play it safe and get it out sooner. |
Signed-off-by: Valentijn Scholten <valentijnscholten@gmail.com>
ab8a30d
to
eb80260
Compare
Even better. Didn't know if you'd want it in a bugfix release, but it's not too big of a change. |
Looks like some third party repositories still expose their (meta)data in V1 format. Example https://packages.shopware.com. |
After a good nights sleep I realized we should just look at https://github.com/composer/composer/blob/main/src/Composer/Repository/ComposerRepository.php and mimic what is done there. The approach in #4435 may work for the short term, but it will result in lots of failing (404) requests for V2 meatada to repositories that are still V1. |
Signed-off-by: Valentijn Scholten <valentijnscholten@gmail.com>
Signed-off-by: Valentijn Scholten <valentijnscholten@gmail.com>
Turns out that do it right, we need to retrieve the Some talking points:
Valentijn |
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesCodacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more |
Signed-off-by: Valentijn Scholten <valentijnscholten@gmail.com>
Signed-off-by: Valentijn Scholten <valentijnscholten@gmail.com>
Signed-off-by: Valentijn Scholten <valentijnscholten@gmail.com>
Signed-off-by: Valentijn Scholten <valentijnscholten@gmail.com>
Signed-off-by: Valentijn Scholten <valentijnscholten@gmail.com>
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
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