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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packagist version numbers slow to update #2435

Open
1 of 3 tasks
danmcadams opened this issue Nov 30, 2018 · 7 comments
Open
1 of 3 tasks

Packagist version numbers slow to update #2435

danmcadams opened this issue Nov 30, 2018 · 7 comments
Labels
service-badge Accepted and actionable changes, features, and bugs

Comments

@danmcadams
Copy link

Are you experiencing an issue with...

馃 Description
The version number on my packagist shield is not being updated, it is however the most recent version when you go to the page on packagist. I checked the other issues here and they don't seem to line up with my issue. My versions are tagged exactly the same, and I have no version listed in composer.

Current version is v0.1.0 and my shield shows v0.0.1

The repository in question is here: https://github.com/The-Road-Bunch/command-menu

馃敆 Link to the badge
https://img.shields.io/packagist/v/theroadbunch/command-menu.svg

馃挕 Possible Solution

@paulmelnikow
Copy link
Member

Hi! Thanks for the report.

Confirmed. It looks like there is some lag. The new version is not reflected in the endpoint we're hitting:

https://packagist.org/packages/theroadbunch/command-menu.json

Based on the doc here https://packagist.org/apidoc#get-package-data it's cached for 12 hours, which explains the issue.

Maybe the version badge could be modified to use the "always up to date" endpoint those docs mention, instead:

http://repo.packagist.org/p/theroadbunch/command-menu.json

@danmcadams
Copy link
Author

Interesting stuff, thanks for the quick response. I thought it may be a caching issue so I went to my package on packagist and the correct version was shown. Oh well, at least now I know.

Thanks again

@paulmelnikow
Copy link
Member

@chris48s Do you know any reason (other than historical) that we might be using the dynamic endpoint for the version?

@chris48s
Copy link
Member

chris48s commented Dec 1, 2018

No. Some of the packagist badges use /p and some use /packages but I don't think there is any solid reason for that (although note that the format of those 2 endpoints is slightly different so we'd need to modify the parsing code a little bit to change).

@paulmelnikow paulmelnikow reopened this Dec 1, 2018
@paulmelnikow paulmelnikow added the service-badge Accepted and actionable changes, features, and bugs label Dec 1, 2018
@paulmelnikow paulmelnikow changed the title Packagists Version numbers not being updated Packagist version numbers not being updated Jan 28, 2019
@paulmelnikow paulmelnikow changed the title Packagist version numbers not being updated Packagist version numbers slow to update Jan 28, 2019
@platan
Copy link
Member

platan commented Oct 14, 2019

I think we can switch to "Composer metadata" (https://packagist.org/apidoc#get-package-data). It will be beneficial for Shields and for Packagist. About Composer metadata:

This is the preferred way to access the data as it is always up to date, and dumped to static files so it is very efficient on our end.

@calebcartwright
Copy link
Member

Sounds like a win-win

@piekar294
Copy link
Contributor

HI, i would like to work on this today :)

piekar294 added a commit to piekar294/shields that referenced this issue Oct 24, 2019
piekar294 added a commit to piekar294/shields that referenced this issue Oct 24, 2019
piekar294 added a commit to piekar294/shields that referenced this issue Oct 24, 2019
piekar294 added a commit to piekar294/shields that referenced this issue Oct 24, 2019
piekar294 added a commit to piekar294/shields that referenced this issue Oct 24, 2019
piekar294 added a commit to piekar294/shields that referenced this issue Oct 24, 2019
piekar294 added a commit to piekar294/shields that referenced this issue Oct 24, 2019
piekar294 added a commit to piekar294/shields that referenced this issue Oct 24, 2019
piekar294 added a commit to piekar294/shields that referenced this issue Oct 24, 2019
piekar294 added a commit to piekar294/shields that referenced this issue Oct 24, 2019
piekar294 added a commit to piekar294/shields that referenced this issue Oct 24, 2019
piekar294 added a commit to piekar294/shields that referenced this issue Oct 24, 2019
piekar294 added a commit to piekar294/shields that referenced this issue Oct 28, 2019
piekar294 added a commit to piekar294/shields that referenced this issue Oct 29, 2019
piekar294 added a commit to piekar294/shields that referenced this issue Oct 29, 2019
calebcartwright pushed a commit that referenced this issue Oct 30, 2019
* #2435 | packagist-license uses 'Composer metadata' API

* #2435 | packagist-php-version uses 'Composer metadata' API

* #2435 | packagist-version uses 'Composer metadata' API

* #2435 | packagist-downloads uses JSON API

* #2435 | small refactor

* #2435 | extract package name creation to method

* #2435 | document base fetch method

* #2435 | added documentation about cached data

* #2435 | fix packagist license badge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service-badge Accepted and actionable changes, features, and bugs
Projects
None yet
Development

No branches or pull requests

6 participants