ZedThree / clang-tidy-review

Create a pull request review based on clang-tidy warnings
MIT License
88 stars 44 forks source link

Use PyGithub to reuse auth headers to do requests #113

Closed bwrsandman closed 8 months ago

bwrsandman commented 8 months ago

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

bwrsandman commented 8 months ago

@ZedThree this is probably the last set of large PRs for my needs

bwrsandman commented 8 months ago

Worth noting that you need specific permissions for an app installation

bwrsandman commented 8 months ago

I tried getting the pr diff with pull_request.diff_url which is https://github.com/<ORG>/<REPO>/pull/<PR_NUMBER>.diff but the response is empty. It could be due to the redirection done with githubusercontent.com or something else.

ZedThree commented 8 months ago

I tried getting the pr diff with pull_request.diff_url which is https://github.com/<ORG>/<REPO>/pull/<PR_NUMBER>.diff but the response is empty. It could be due to the redirection done with githubusercontent.com or something else.

Is this something that still needs looking at, or is the PR ready as is?

bwrsandman commented 8 months ago

Is this something that still needs looking at, or is the PR ready as is?

It's very minor. I wanted to reduce the custom API stuff but looks like it's needed here.

I am going to put the PR in draft just so I can test it but I will put it back to ready today and you can merge/tag. Done!

bwrsandman commented 8 months ago

@ZedThree is there anything left to do ?