[Tasks] Fix error handling for deleted repositories in GitHub move detection
Description
- This PR fixes error handling for deleted repositories (404 errors) in the GitHub repository move detection system.
- Previously, when a repository returned a 404 (deleted), the system would mark it as IGNORE but still raise an exception, causing Celery tasks to fail.
- Now deleted repositories are handled gracefully without causing task failures.
Changes Made
- Fixed 404 error handling in
ping_github_for_repo_move()to return gracefully instead of raising exceptions - Added comprehensive task-level error handling with try-catch blocks
- Enhanced API call retry logic with better error handling and validation
- Added validation for repository URL parsing and API responses
- Improved logging throughout the process for better monitoring
- Deleted repositories are now properly marked as IGNORE in the database
Testing
- The fix addresses the specific error case where repositories like
https://github.com/anaconda-platform/transformers-feedstockreturn 404 errors - Error handling now prevents Celery task failures for deleted repositories
- System continues processing other repositories even when encountering deleted ones
This PR fixes #3166
Notes for Reviewers
- The changes are backward compatible and don't affect existing functionality
- Enhanced logging makes it easier to monitor repository status changes
- Error handling follows existing patterns in the codebase
Signed commits
- [x] Yes, I signed my commits.
@saksham23467 : This looks promising.
@saksham23467 : This looks promising.
Thanks for reviewing! If everything looks good, could you approve the PR so we can move it forward?
@IsaacMilarky / @Ulincsys : Could you review this?
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...
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
Closing. I dont see a path to these specific changes getting merged in this specific PR. Discussion should happen in other issues/PRs addressing the repo move detection, such as #3391