-
Notifications
You must be signed in to change notification settings - Fork 34
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
feat: support new tokenless protocol #447
Changes from all commits
65c71e8
a5321d2
1646b06
c5eefc3
fe78f54
1689c95
61fa8ed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,9 +8,8 @@ | |
from codecov_cli import __version__ as codecov_cli_version | ||
from codecov_cli.helpers.config import CODECOV_API_URL | ||
from codecov_cli.helpers.encoder import encode_slug | ||
from codecov_cli.helpers.git import get_pull, is_fork_pr | ||
from codecov_cli.helpers.request import ( | ||
get_token_header_or_fail, | ||
get_token_header, | ||
send_post_request, | ||
send_put_request, | ||
) | ||
|
@@ -53,19 +52,7 @@ def send_upload_data( | |
"version": codecov_cli_version, | ||
"ci_service": ci_service, | ||
} | ||
|
||
# Data to upload to Codecov | ||
pull_dict = ( | ||
get_pull(git_service, slug, pull_request_number) if not token else None | ||
) | ||
|
||
if is_fork_pr(pull_dict): | ||
headers = { | ||
"X-Tokenless": pull_dict["head"]["slug"], | ||
"X-Tokenless-PR": pull_request_number, | ||
} | ||
else: | ||
headers = get_token_header_or_fail(token) | ||
headers = get_token_header(token) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are some commands using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ahh that makes sense, worth leaving another comment here? 😅 |
||
encoded_slug = encode_slug(slug) | ||
upload_url = enterprise_url or CODECOV_API_URL | ||
url, data = self.get_url_and_possibly_update_data( | ||
|
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.
What's this?
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.
gonna leave a comment explaining this but this is how the CLI receives the username of the user to whom the fork belongs to and the branch name from the action
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.
that makes sense, a comment here would be pretty helpful thanks