Skip to content

Conversation

@merobi-hub
Copy link
Contributor

@merobi-hub merobi-hub commented Jul 21, 2023

In the get_contributor_stats script in dev/stats, the endpoint used to get PRs from the GitHub API, which does not accept dates or date ranges, causes the script to error out with a rate-limit exception before it can finish executing.

With this change, the script will get PRs from the API by first getting commits, which allows for date specification. Together with other changes, this will significantly decrease the number of calls required and allow the script to run to completion.

All-told, the changes here reduce the number of requests by around 50%, cutting well over 1000 requests when executing the script for this month.

Also included:

  • a number of changes to consolidate functions and thereby reduce the number of API calls further.
  • an optional API rate limit parameter and output with requests remaining and the reset time in the system tz.

^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

merobi-hub and others added 17 commits May 25, 2023 09:58
Signed-off-by: Michael Robinson <merobi@gmail.com>
Signed-off-by: Michael Robinson <merobi@gmail.com>
Signed-off-by: Michael Robinson <merobi@gmail.com>
Signed-off-by: Michael Robinson <merobi@gmail.com>
Signed-off-by: Michael Robinson <merobi@gmail.com>
Signed-off-by: Michael Robinson <merobi@gmail.com>
Signed-off-by: Michael Robinson <merobi@gmail.com>
Signed-off-by: Michael Robinson <merobi@gmail.com>
Signed-off-by: Michael Robinson <merobi@gmail.com>
Signed-off-by: Michael Robinson <merobi@gmail.com>
Copy link
Contributor

@mobuchowski mobuchowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just need to add the newline at the end of file :)

merobi-hub and others added 2 commits July 21, 2023 06:26
Signed-off-by: Michael Robinson <merobi@gmail.com>
merobi-hub and others added 5 commits July 21, 2023 06:31
@mobuchowski mobuchowski merged commit 6f75a8a into apache:main Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants