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

Fetching list of tracked files from GitHub fails with error "API rate limit exceeded for installation ID" #68

Closed
lhotari opened this issue Mar 5, 2021 · 4 comments · Fixed by #69
Labels
bug Something isn't working

Comments

@lhotari
Copy link

lhotari commented Mar 5, 2021

Problem

I'm working on refactoring the existing Apache Pulsar (apache/pulsar) build in my fork lhotari/pulsar.

This is the way how I'm using test-reporter:
https://github.com/lhotari/pulsar/blob/4c13ef2909aeb1de1b0354c07710fe8257a3ccb1/.github/workflows/pulsar-ci-test-report.yaml#L20-L39

However this fails with this type of errors

Action was triggered by workflow_run: using SHA and RUN_ID from triggering workflow
Check runs will be created with SHA=ef23acb30548a37de648cc89965f854668975e95
Fetching list of tracked files from GitHub
Error: API rate limit exceeded for installation ID 6407194.

failed workflow run.

Full logs
2021-03-05T09:11:25.6157659Z ##[section]Starting: Request a runner to run this job
2021-03-05T09:11:25.9270299Z Can't find any online and idle self-hosted runner in current repository that matches the required labels: 'ubuntu-20.04'
2021-03-05T09:11:25.9270420Z Can't find any online and idle self-hosted runner in current repository's account/organization that matches the required labels: 'ubuntu-20.04'
2021-03-05T09:11:25.9270817Z Found online and idle hosted runner in current repository's account/organization that matches the required labels: 'ubuntu-20.04'
2021-03-05T09:11:26.1074475Z ##[section]Finishing: Request a runner to run this job
2021-03-05T09:11:32.0681059Z Current runner version: '2.277.1'
2021-03-05T09:11:32.0716620Z ##[group]Operating System
2021-03-05T09:11:32.0717668Z Ubuntu
2021-03-05T09:11:32.0718135Z 20.04.2
2021-03-05T09:11:32.0718585Z LTS
2021-03-05T09:11:32.0719158Z ##[endgroup]
2021-03-05T09:11:32.0719747Z ##[group]Virtual Environment
2021-03-05T09:11:32.0720491Z Environment: ubuntu-20.04
2021-03-05T09:11:32.0721098Z Version: 20210302.0
2021-03-05T09:11:32.0722229Z Included Software: https://github.com/actions/virtual-environments/blob/ubuntu20/20210302.0/images/linux/Ubuntu2004-README.md
2021-03-05T09:11:32.0723689Z Image Release: https://github.com/actions/virtual-environments/releases/tag/ubuntu20%2F
2021-03-05T09:11:32.0724686Z ##[endgroup]
2021-03-05T09:11:32.0726938Z ##[group]GITHUB_TOKEN Permissions
2021-03-05T09:11:32.0728255Z Actions: write
2021-03-05T09:11:32.0728785Z Checks: write
2021-03-05T09:11:32.0729399Z Contents: write
2021-03-05T09:11:32.0729971Z Deployments: write
2021-03-05T09:11:32.0730682Z Issues: write
2021-03-05T09:11:32.0731282Z Metadata: read
2021-03-05T09:11:32.0731999Z OrganizationPackages: write
2021-03-05T09:11:32.0732756Z Packages: write
2021-03-05T09:11:32.0733340Z PullRequests: write
2021-03-05T09:11:32.0734077Z RepositoryProjects: write
2021-03-05T09:11:32.0734765Z SecurityEvents: write
2021-03-05T09:11:32.0735356Z Statuses: write
2021-03-05T09:11:32.0736036Z ##[endgroup]
2021-03-05T09:11:32.0739249Z Prepare workflow directory
2021-03-05T09:11:32.1436660Z Prepare all required actions
2021-03-05T09:11:32.1450497Z Getting action download info
2021-03-05T09:11:32.5381111Z Download action repository 'dorny/test-reporter@v1'
2021-03-05T09:11:34.2772567Z ##[group]Run dorny/test-reporter@v1
2021-03-05T09:11:34.2773285Z with:
2021-03-05T09:11:34.2773817Z   artifact: /(.*)-test-report/
2021-03-05T09:11:34.2774344Z   name: $1 Tests
2021-03-05T09:11:34.2774808Z   path: *.xml
2021-03-05T09:11:34.2775370Z   reporter: jest-junit
2021-03-05T09:11:34.2775923Z   max-annotations: 50
2021-03-05T09:11:34.2776932Z   token: ***
2021-03-05T09:11:34.2777442Z   list-suites: all
2021-03-05T09:11:34.2777970Z   list-tests: all
2021-03-05T09:11:34.2778501Z   fail-on-error: true
2021-03-05T09:11:34.2779040Z ##[endgroup]
2021-03-05T09:11:35.6311663Z Action was triggered by workflow_run: using SHA and RUN_ID from triggering workflow
2021-03-05T09:11:35.6412819Z Check runs will be created with SHA=ef23acb30548a37de648cc89965f854668975e95
2021-03-05T09:11:35.6413983Z Fetching list of tracked files from GitHub
2021-03-05T09:11:35.6420550Z ##[error]API rate limit exceeded for installation ID 6407194.
2021-03-05T09:11:35.6470414Z Cleaning up orphan processes

It seems that test-reporter exceeds the GitHub API rate limits when using a large repository like apache/pulsar.

Expected behavior

test-reporter would use GitHub API in a way that it doesn't exceed the rate limiting.

Is there any workaround for this problem?

Other

I have reported a similar issue about paths-filter, dorny/paths-filter#73

@dorny
Copy link
Owner

dorny commented Mar 6, 2021

Hello,

Thanks for reporting the issue. This action needs to know which files are tracked by git. When action is triggered by workflow_run event it uses GitHub trees API to get it.

I didn't set recursive parameter so it makes separate query for every folder which exits in repository. Also we need to know which files are tracked by git only for creation of code annotation when some test is failed so I can make it lazy loaded.

I will work on it ASAP.

@dorny
Copy link
Owner

dorny commented Mar 7, 2021

@lhotari:
You shouldn't see the "API rate limit" error anymore.
However test report still won't work for your (yet).
You are using JavaScript jest-junit reporter for test results from java.
I have to do some small adjustments to support java. There are some subtle differences in the format. I will notify you when it's ready.

@lhotari
Copy link
Author

lhotari commented Mar 7, 2021

Amazing work @dorny , Thank you . I believe this action will become very popular among OSS projects.

@sk-
Copy link

sk- commented Mar 1, 2022

I first wanted to say the action is great, so thanks a lot for the great work.

We are seeing this issue recently, due to some dependabot PRs. The logs are:

Run dorny/paths-filter@v2
  with:
    filters: xxx:
    - 'xxx/**'
    - '.github/**'
  
    token: ***
    list-files: none
    initial-fetch-depth: 100
Fetching list of changed files for PR#142 from Github API
  Invoking listFiles(pull_number: 142, page: 1, per_page: 100)
Error: API rate limit exceeded for installation ID 1481229.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants