Skip to content
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

return None in case of a github exception for get_active_date #83

Merged
merged 4 commits into from
Feb 5, 2024

Conversation

anovadox
Copy link
Contributor

@anovadox anovadox commented Feb 5, 2024

Pull Request

Occasionally repo.get_branch can raise an exception: github3.exceptions.NotFoundError: 404 Branch not found
Even when called on the repo's default branch!

This error handling is a bit overzealous, but I think we want the action to keep trucking along in the event of one repo having an issue.

Proposed Changes

Catch any exeption or error raised by the github3 while trying to get_active_date() and return None for that repo. It's not elegant, but it'll do.

Readiness Checklist

Author/Contributor

  • If documentation is needed for this change, has that been included in this pull request
  • run make lint and fix any issues that you have introduced
  • run make test and ensure you have test coverage for the lines you are introducing

Reviewer

  • Label as either bug, documentation, enhancement, infrastructure, or breaking

occasionally repo.get_branch can raise an exception:
github3.exceptions.NotFoundError: 404 Branch not found
even will called on the repos default branch
@zkoppert zkoppert added the bug Something isn't working label Feb 5, 2024
Copy link
Member

@zkoppert zkoppert left a comment

Choose a reason for hiding this comment

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

Thanks for adding this catch! We definitely don't want this to stop running on an organization for a single repo that we can't determine the activity date for. Appreciate you taking the time to fix and upstream. 🚀

Signed-off-by: Zack Koppert <[email protected]>
@zkoppert zkoppert merged commit f002d1e into github:main Feb 5, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants