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

GitHub Commit API throttling prevents successful completion #32

Open
pelikhan opened this issue Dec 3, 2019 · 4 comments
Open

GitHub Commit API throttling prevents successful completion #32

pelikhan opened this issue Dec 3, 2019 · 4 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@pelikhan
Copy link

pelikhan commented Dec 3, 2019

First thank you for this great action; it's very useful!

I am facing an issue in trying to enable this action in a project with a large set of existing images (1000+). The first PR using the action generates a lot of GitHub API calls which hits API throttling limits (the error is silently swallowed btw).

https://github.com/microsoft/pxt-microbit/commit/89983dafb205dfbf627bbc9f066b58436196fa6c/checks?check_suite_id=321921856#step:4:918

Is there a way to run the image optimization locally to "bootstrap" an existing repository?

@pelikhan
Copy link
Author

pelikhan commented Dec 3, 2019

Update: it went through on a subsequent build.

@benschwarz
Copy link
Member

benschwarz commented Dec 3, 2019

Hey @pelikhan, thanks for logging this.

This has come up before and it wasn't really addressed other than a general 🤷‍♂️ from me. That's mostly because GitHub actions was undergoing changes and we were waiting for it to settle down.

Here are some steps that we could take to improve the situation:

  • Catch the error, log it better
  • Explore other ways of committing changes (using the git client directly?)
  • PR action.yml compliance #29 aims to add support for actions.yml. I know that @chabad360 is using that as a means to prepare image-actions to be run in other CI setups. Maybe we can come up with an 'offline' workflow that allows you to run it manually?

@benschwarz benschwarz added bug Something isn't working help wanted Extra attention is needed labels Dec 3, 2019
@pelikhan
Copy link
Author

pelikhan commented Dec 4, 2019

Supposedly, you could query https://developer.github.com/v3/rate_limit/ and wait till you are not rate limited.

Or have a configurable maxImagesPerCommit to simply cap the number fixed images.

Feels like local exec of GitHub actions is something GitHub should fix.

@benschwarz benschwarz changed the title Running action locally / API throttling issues GitHub Commit API throttling prevents successful completion Sep 14, 2020
@DeLongShot
Copy link

For those who come here later, I have also observed this when trying to compress a lot of images.

In my case, I needed to compress a large group of images to start. As a workaround, I used a combination of ignorePaths and multiple PRs to break the large group of images into smaller groups to compress. For each PR, I would only compress a small group of images at a time. Then, I just opened multiple PRs until I had compressed every image.

Note: This was for a private repo for myself, so opening multiple PRs might not work well for a repo with multiple contributors.

Breaking it into smaller groups did the trick and I didn't have any errors after that. Not ideal, but worked out fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Development

No branches or pull requests

3 participants