[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
872d93c to
df424e3
Compare
12ca704 to
586fa5c
Compare
df424e3 to
d842bf0
Compare
586fa5c to
4a0b594
Compare
d842bf0 to
ccbd37d
Compare
4a0b594 to
b77b10a
Compare
ccbd37d to
20df324
Compare
b77b10a to
82d91f3
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
20df324 to
ea99e33
Compare
82d91f3 to
51b10b0
Compare
aslonnie
left a comment
There was a problem hiding this comment.
could you also help also add a small unit test for this get_contributors.py code? this is a small script that is used in the release process.
Use GitHubClient.get_repo().get_pull() instead of the PyGithub Github/repo.get_pull() calls. Topic: remove-pygithub-ci Relative: remove-pygithub-release Signed-off-by: andrew <andrew@anyscale.com>
ea99e33 to
b33299e
Compare
51b10b0 to
1e1c741
Compare
1e1c741 to
602e1f6
Compare
b33299e to
04f5106
Compare
602e1f6 to
1772209
Compare
|
Added a test script! |
04f5106 to
8417641
Compare
1772209 to
4dfdcd3
Compare
8417641 to
5d5cae6
Compare
4dfdcd3 to
1775a02
Compare

Use GitHubClient.get_repo().get_pull() instead of the PyGithub
Github/repo.get_pull() calls.
Topic: remove-pygithub-ci
Relative: remove-pygithub-release
Signed-off-by: andrew andrew@anyscale.com