flex icon indicating copy to clipboard operation
flex copied to clipboard

What happens when Github API rate limit is reached while updating recipes?

Open mtancoigne opened this issue 3 years ago • 5 comments
trafficstars

Hello,

I have a few questions about the composer recipes:update command. Let me know if i'm on the wrong repo for these questions, I hesitated with symfony/recipes.

What happens to the recipe when running composer update:recipe user/project and Github API rate limit is reached?

I see some changes in the repo, so I guess at least part of the recipe is applied, but I have no clue if the recipe is totally applied and the only part failing is about changelog and issues so I can still continue to work?

Also, why does using --quiet still fails if the calls are only related to changelogs and general information?

Last time I hit the limit was while calculating a recipe's changelog.

mtancoigne avatar May 04 '22 13:05 mtancoigne

You need to use composer with an auth token to have a reasonably high hit limit. For the update command, we use a not-rate-limited endpoint to access the JSONs for public recipes. Of course, that doesn't fully answer your question. I just don't have the answer because I never hit it. Note that computing the changelog consumes way more rate limiting tokens. I'm closing because this is not actionable. But please let us know if you manage to answer your question. Eg maybe start with hitting the limit by calculating a recipe's changelog, then run the update command in the same row?

nicolas-grekas avatar Jun 06 '22 08:06 nicolas-grekas

Well, the limit was reached during an upgrade process: update dependencies then apply new recipes, multiple time (I was in the process of upgrading from Symfony 3.x to 4.4). The limit was reached even with a valid token.

When applying recipes, it states that the recipe was successfully applied before the token issue, so I guess the API calls are mainly to fetch changelogs. This answers to the question about the recipe being applied or not.

As the limit is clearly annoying, there still may be something to do when running with the --quiet flag.

mtancoigne avatar Jun 06 '22 12:06 mtancoigne

Would you be able to investigate this for a fix?

nicolas-grekas avatar Jun 06 '22 12:06 nicolas-grekas

Sadly, no. That being said, I'll dig a bit in the code in the next days.

mtancoigne avatar Jun 06 '22 12:06 mtancoigne

This happens when you're doing a BIG recipe update. But, it's harmless: the CHANGELOG fails to render, but the recipe IS successfully applied.

Unfortunately, iirc, I couldn't find a hook in Composer that would allow me to "catch" the final error and tell the user that it's ok. I'm open to suggestions - e.g. we could print out a:

Recipe successfully applied

message before we generate the CHANGELOG.

weaverryan avatar Aug 03 '22 18:08 weaverryan

Well, it's been two months now and I still don't have time to check for the changes being pulled with --quiet flag... Thanks for the explanations, I'm closing this.

mtancoigne avatar Sep 15 '22 09:09 mtancoigne