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

Expose rate limits on the logs #1029

Closed
IOrlandoni opened this issue Jun 8, 2023 · 7 comments · Fixed by #1032
Closed

Expose rate limits on the logs #1029

IOrlandoni opened this issue Jun 8, 2023 · 7 comments · Fixed by #1032
Assignees
Labels
feature request New feature or request to improve the current logic

Comments

@IOrlandoni
Copy link

Description:
It would be nice to get an idea of the rate limit information before or after the run, to understand the context on which the action is running. The information should already be included in the headers of the responses from Github, it's just a matter of displaying it.

Justification:
Understanding if we can raise the operations per run, if we're close to hitting the rate limit, etc.

Are you willing to submit a PR?
Happy to, if someone confirms this is a good thing for the action.

@IOrlandoni IOrlandoni added feature request New feature or request to improve the current logic needs triage labels Jun 8, 2023
@dsame dsame self-assigned this Jun 9, 2023
@dsame dsame removed the needs triage label Jun 9, 2023
@dsame
Copy link
Contributor

dsame commented Jun 9, 2023

Hello @IOrlandoni , thank you for you suggestion. I looks very useful and will be implemented asap

@IOrlandoni
Copy link
Author

Hey @dsame, just wanted to confirm if you're working on it. If you are, I wont :)

@dsame
Copy link
Contributor

dsame commented Jun 13, 2023

Hi @IOrlandoni , i am already close to providing the solution, but i'd like to see you approach because this statement "The information should already be included in the headers of the responses from Github" is not clear for me. According to the docs the response does not include api usage info: see response schema

@IOrlandoni
Copy link
Author

Hey @dsame. You should not see it in the response schema because it exists on the headers, as per the docs here. I have no idea if you have access to the headers through Octokit though.

Given your knowledge of the action, I doubt I'll be able to provide a better solution than yours...!

@dsame dsame mentioned this issue Jun 13, 2023
2 tasks
@dsame
Copy link
Contributor

dsame commented Jun 13, 2023

Hi @IOrlandoni,
Ok, i preferred to follow the common pattern and call the rate limit API directly in this PR
Please take a look at the sample build output to make sure it is that you expected:

debug status before the processing: https://github.com/akv-demo/test-stale/actions/runs/5257429320/jobs/9500195867#step:2:40

debug status after the processing: https://github.com/akv-demo/test-stale/actions/runs/5257429320/jobs/9500195867#step:2:208

and summary of the usage logged on info level:
https://github.com/akv-demo/test-stale/actions/runs/5257429320/jobs/9500195867#step:2:209

@IOrlandoni
Copy link
Author

@dsame LGTM. Can't complain! Thank you!

@dsame dsame linked a pull request Jul 13, 2023 that will close this issue
2 tasks
@dsame
Copy link
Contributor

dsame commented Jul 14, 2023

Hello @IOrlandoni , the related PR is merged and will be available in the next release.

Meanwhile you can test and review the change by switching to the main branch

- uses: actions/stale@main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request to improve the current logic
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants