-
Notifications
You must be signed in to change notification settings - Fork 906
[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
Signed-off-by: saksham23467 <142910439+saksham23467@users.noreply.github.com>
…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 <142910439+saksham23467@users.noreply.github.com>
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 / |
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.
Description
Changes Made
ping_github_for_repo_move()
to return gracefully instead of raising exceptionsTesting
https://github.com/anaconda-platform/transformers-feedstock
return 404 errorsThis PR fixes #3166
Notes for Reviewers
Signed commits