-
Notifications
You must be signed in to change notification settings - Fork 924
[Tasks] Fix error handling for deleted repositories in GitHub move detection #3248
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
base: main
Are you sure you want to change the base?
Conversation
40596f8 to
bb6d2a0
Compare
|
@saksham23467 : This looks promising. |
Thanks for reviewing! If everything looks good, could you approve the PR so we can move it forward? |
|
@IsaacMilarky / |
Ulincsys
left a comment
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.
There are extra changes in this PR that should not be included
| return results | ||
|
|
||
| @register_metric() | ||
| def clones(repo_group_id, repo_id=None, begin_date=None, end_date=None): |
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.
It looks like the Clones metric API you implemented for #3247 got included in this PR.
Feature implementations and bugfixes for existing infrastructure should be made into separate PRs. Please rebase and update the PR to only include the error handling changes.
| try: | ||
| owner, name = get_owner_repo(repo.repo_git) | ||
| url = f"https://api.github.com/repos/{owner}/{name}" | ||
| except Exception as e: |
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.
Where possible and appropriate, please try to catch a specific exception class instead of a bare Exception.
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.
@saksham23467 ; I am not sure I see anything other than adding the try/catch ... and I think we want to be more specific about what we do.
There is a function call to update_repos_with_dict that is suppose to update the repo URL in the repo table if its changed .. this is the part we aren't sure is happening.
I think we still need to handle the 404's more robustly than we are ...
|
ignoring the cross-pollination with the other PR, I dont see a fundamental change to the code in this PR except wrapping everything in try-catch statements... |
sgoggins
left a comment
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.
Not quite sure.
| try: | ||
| owner, name = get_owner_repo(repo.repo_git) | ||
| url = f"https://api.github.com/repos/{owner}/{name}" | ||
| except Exception as e: |
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.
@saksham23467 ; I am not sure I see anything other than adding the try/catch ... and I think we want to be more specific about what we do.
There is a function call to update_repos_with_dict that is suppose to update the repo URL in the repo table if its changed .. this is the part we aren't sure is happening.
I think we still need to handle the 404's more robustly than we are ...
bb6d2a0 to
16b943a
Compare
…etection - Fix 404 error handling to gracefully handle deleted repositories instead of raising exceptions - Add proper task-level error handling with try-catch blocks - Enhance API call retry logic with better error handling - Add validation for repository URL parsing and API responses - Improve logging throughout the process for better monitoring - Mark deleted repositories as IGNORE in database instead of failing tasks Signed-off-by: saksham23467 <[email protected]>
16b943a to
a70d4dd
Compare
|
I have force pushed and rebased this PR to both a) only include the relevant commit, and b) be based on current main. I agree with sean about the technical merits of this PR though, I suspect theres an additional component to the problem thats not being addressed |
Description
Changes Made
ping_github_for_repo_move()to return gracefully instead of raising exceptionsTesting
https://github.com/anaconda-platform/transformers-feedstockreturn 404 errorsThis PR fixes #3166
Notes for Reviewers
Signed commits