Skip to content

Expose rate limits on the logs #1029

Description

@thisisnacho

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.

Activity

  1. self-assigned this
    on Jun 9, 2023
  2. dsame commented on Jun 9, 2023

    @dsame
    Contributor

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

  3. thisisnacho commented on Jun 12, 2023

    @thisisnacho
    Author

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

  4. dsame commented on Jun 13, 2023

    @dsame
    Contributor

    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

  5. thisisnacho commented on Jun 13, 2023

    @thisisnacho
    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...!

  6. dsame commented on Jun 13, 2023

    @dsame
    Contributor

    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

  7. thisisnacho commented on Jun 13, 2023

    @thisisnacho
    Author

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

  8. linked a pull request that will close this issueAdd RateLimit #1032on Jul 13, 2023
  9. dsame commented on Jul 14, 2023

    @dsame
    Contributor

    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

Metadata

Metadata

Assignees

Labels

feature requestNew feature or request to improve the current logic

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions