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

Packagist badge cannot handle composer v2-only packages #7020

Closed
SteveDesmond-ca opened this issue Sep 14, 2021 · 4 comments · Fixed by #7681
Closed

Packagist badge cannot handle composer v2-only packages #7020

SteveDesmond-ca opened this issue Sep 14, 2021 · 4 comments · Fixed by #7681
Labels
bug Bugs in badges and the frontend service-badge Accepted and actionable changes, features, and bugs

Comments

@SteveDesmond-ca
Copy link

Are you experiencing an issue with...

shields.io

🐞 Description

Packagist (the PHP dependency management SaaS) deprecated their v1 API some time ago, so new packages are only being added to their v2 API.

The shields site uses v1 of the API, so it is not able to retrieve version numbers for newer packages.

🔗 Link to the badge

New package, not working: ecoapm/libyear

Old package, works fine: symfony/symfony

💡 Possible Solution

There are a couple possible options:

  1. update BasePackagistService.fetch() to use the new API and modify transform() accordingly
  2. update PackagistVersion.handle() to fallback to the JSON API

I would think the first would be preferrable, from a future maintenance perspective, so I'll get a PR ready for that tomorrow.

@SteveDesmond-ca SteveDesmond-ca added the question Support questions, usage questions, unconfirmed bugs, discussions, ideas label Sep 14, 2021
@SteveDesmond-ca
Copy link
Author

I started diving in already, it looks like the v2 API has some pretty gnarly breaking changes so maybe holding off to have a discussion on the best way forward is better...

@chris48s
Copy link
Member

chris48s commented Sep 14, 2021

If you're interested in working on this, have a look over #6508

Nobody has done anything on it for a while and but from memory there was not too much work left to do after the last round of comments to get it landed. Unfortunately the original author stopped responding (tbh it is one of those PRs that seemed simple but turned into a bit of a can of worms).

What's there is probably a pretty decent starting point if you wanted to try and get it over the line.

@chris48s chris48s added bug Bugs in badges and the frontend service-badge Accepted and actionable changes, features, and bugs and removed question Support questions, usage questions, unconfirmed bugs, discussions, ideas labels Sep 14, 2021
@SteveDesmond-ca
Copy link
Author

Logging in this morning, the deprecation warning has been removed from my package and it now shows up via the v1 API (and therefore shields.io badge, see OP) so from an end-user perspective, if newly-created packages just need to wait until the next day to show up, I don't think that's a huge deal, but I can see from a technical perspective why we wouldn't want to be using a deprecated endpoint.

@kdambekalns
Copy link

As explained on https://blog.packagist.com/deprecating-composer-1-support/

This means new packages and old unused packages will only be visible to Composer 2 until someone installs them, at which point they will become visible to Composer 1 as well (within 24h as this process happens on a nightly basis).

So, yeah, not that urgent. Just a bit confusing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs in badges and the frontend service-badge Accepted and actionable changes, features, and bugs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants