[ci] Replace PyGithub with GitHubClient in get_contributors.py#61711
[ci] Replace PyGithub with GitHubClient in get_contributors.py#61711andrew-anyscale wants to merge 1 commit intoandrew/revup/master/remove-pygithub-releasefrom
Conversation
|
Reviews in this chain: |
|
There was a problem hiding this comment.
Code Review
This pull request replaces the PyGithub dependency with a local GitHubClient in the get_contributors.py script. The changes are correct and achieve the goal of this refactoring. I've added a couple of comments to get_contributors.py to improve readability and make the error handling more specific and robust following the client change.
| g = Github(access_token) | ||
| ray_repo = g.get_repo("ray-project/ray") | ||
| # Use Github API to fetch PR authors | ||
| ray_repo = GitHubClient(access_token).get_repo("ray-project/ray") |
There was a problem hiding this comment.
With the switch to GitHubClient, ray_repo.get_pull() will now raise GitHubException on API errors. The exception handling in the loop on lines 102-105 should be updated to catch this specific exception instead of the broad Exception. This will make the error handling more robust and prevent masking other potential issues.
| g = Github(access_token) | ||
| ray_repo = g.get_repo("ray-project/ray") | ||
| # Use Github API to fetch PR authors | ||
| ray_repo = GitHubClient(access_token).get_repo("ray-project/ray") |
There was a problem hiding this comment.
For better readability and to follow common practice, it's recommended to first instantiate the GitHubClient into a variable and then use it. This makes the code easier to understand and debug.
| ray_repo = GitHubClient(access_token).get_repo("ray-project/ray") | |
| client = GitHubClient(access_token) | |
| ray_repo = client.get_repo("ray-project/ray") |
8f7ea69 to
beeb882
Compare
24aa485 to
6e6f154
Compare
beeb882 to
ea5c3da
Compare
2218a9c to
872d93c
Compare
ea5c3da to
12ca704
Compare
Use GitHubClient.get_repo().get_pull() instead of the PyGithub Github/repo.get_pull() calls. Topic: remove-pygithub-ci Relative: remove-pygithub-release Labels: draft Signed-off-by: andrew <andrew@anyscale.com>
872d93c to
df424e3
Compare
12ca704 to
586fa5c
Compare
df424e3 to
d842bf0
Compare
586fa5c to
4a0b594
Compare
Use GitHubClient.get_repo().get_pull() instead of the PyGithub
Github/repo.get_pull() calls.
Topic: remove-pygithub-ci
Relative: remove-pygithub-release
Labels: draft
Signed-off-by: andrew andrew@anyscale.com