-
Notifications
You must be signed in to change notification settings - Fork 44
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
check if the PR is a fork PR #328
Conversation
Codecov Report
@@ Coverage Diff @@
## main #328 +/- ##
==========================================
+ Coverage 95.39% 95.46% +0.06%
==========================================
Files 78 80 +2
Lines 2673 2713 +40
==========================================
+ Hits 2550 2590 +40
Misses 123 123
Flags with carried forward coverage won't be shown. Click here to find out more.
|
9ddc2dd
to
6802c70
Compare
6802c70
to
34dea1e
Compare
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.
lgtm, approving to spare you timezone hell but pls read the comments and decide how to address them
codecov_cli/helpers/git.py
Outdated
git_service = get_git_service(service) | ||
if git_service: | ||
pull_dict = git_service.get_pull_request(decoded_slug, pr_num) | ||
if pull_dict and pull_dict["head"]["slug"] != decoded_slug: |
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.
do we need to decode the slug? if the PR API request gives us both the head and the base, we can just see if they're different?
if pull_dict and pull_dict["head"]["slug"] != pull_dict["base"]["slug"]:
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.
you're right we ca do it both ways, but we need to decode it since we need it in the API request to get the pull request
b5d0e5d
to
0dfd717
Compare
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 adding the test! other changes also look good
This is the first PR for tokenless upload and branch conflation bug fix where we check if the PR is a fork PR.
I'm not using any auth tokens as forked PRs are public for open source repos. And a forked repo made from a public upstream cannot change its visibility to private.
This PR implements getting PR info from github only, other providers are needed still, but pushing my code to get initial review
We'll need to add the fork PR check in each command we want to support tokenless for. For uploads we'll need to add it to create_commit, create_report and do_upload commands logic. But, create_report does not have reference to the PR number, which means we'll need to add it there.
codecov/engineering-team#733