-
Notifications
You must be signed in to change notification settings - Fork 247
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
Draft: Add pr-check for forked project #334
base: main
Are you sure you want to change the base?
Draft: Add pr-check for forked project #334
Conversation
Currently GitHub API is fully public. There is an hour limit for specific IP address. Integrate authorization token into pipeline could increase the limit as well Here are some information on GitHub API rate limit: https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting |
Add some more details per discussed. The pipeline should fail when I explicitly committed a change with project being a forked one: https://github.com/TestingResearchIllinois/idoft/runs/4378193026?check_suite_focus=true. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes! Minor suggestions to improve.
@@ -14,7 +15,7 @@ | |||
|
|||
# Contains regexes for columns that are commmon to pr-data and tic-fic-data | |||
common_data = { | |||
"Project URL": re.compile(r"(https:\/\/github.com)(\/(\w|\.|-)+){2}"), | |||
"Project URL": re.compile(r"(https:\/\/github.com\/([\w|\.|-]+)\/([\w|\.|-]+))"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was the unchanged line giving you some issues?
log_esp_error(filename, log, f"{author}/{repo} is a forked repo") | ||
except requests.exceptions.RequestException as e: | ||
# handle(e) | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of simply passing here, it would be good to warn that the check for fork failed along with outputting the exception
@@ -123,6 +146,9 @@ def run_checks(file, data_dict, log, commit_range, checks): | |||
if check_rule.__name__ == check_row_length.__name__: | |||
check_rule(len(header), *params) | |||
continue | |||
if check_rule.__name__ == check_repo_sanity.__name__: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of running this check_rule for every changed line in the CSV file, we could just run this check when a new Project URL is added that does not already exist. i.e., get (1) the Project URLs that are already in the unchanged file and (2) the Project URLs in the new changes, and only run this check for Project URLs that are in (2) but not in (1).
This improvement need not be done immediately but would help avoid the Github limit.
Add some checks for forked project. Please let me know if there is any issue