-
Notifications
You must be signed in to change notification settings - Fork 45
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
Use PyGithub to reuse auth headers to do requests #113
Conversation
367a47d
to
a2c3d14
Compare
@ZedThree this is probably the last set of large PRs for my needs |
Worth noting that you need specific permissions for an app installation
|
I tried getting the pr diff with |
f"WARNING: Couldn't automatically download artifacts for workflow '{workflow_id}', response was: {r}: {r.reason}" | ||
) | ||
return None, None | ||
_, data = pull.repo._requester.requestJsonAndCheck( |
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.
Might be nice to retain the more specific error message if this fails?
unposted_comments = set(map(lambda c: HashableComment(**c), review["comments"])) | ||
posted_comments = set( | ||
map(lambda c: HashableComment(**c), pull_request.get_pr_comments()) | ||
) | ||
|
||
review["comments"] = [ | ||
c.__dict__ for c in sorted(unposted_comments - posted_comments) | ||
] |
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.
This is a lot clearer, thanks!
Is this something that still needs looking at, or is the PR ready as is? |
a2c3d14
to
baadf42
Compare
It's very minor. I wanted to reduce the custom API stuff but looks like it's needed here.
|
@ZedThree is there anything left to do ? |
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.
Thanks for your work on this @bwrsandman !
Clean-up custom url creation and use PyGithub objects for that.
Use PyGithub checker function to catch 400+ codes.
This fixes app authenticated sessions losing the authentication for requests when downloading diffs and posting reviews.
This fixes
~/.netrc
authentication hijacking the authentication through the requests library.Re-use the hashable comment class to filter already posted comments