-
Notifications
You must be signed in to change notification settings - Fork 6
remove constraint for True Tokenless #181
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
Conversation
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.
The overall changes made in the diff seem to create a looser check for an 'uploadToken'. It is removing an additional condition of 'branch' breakdown. However, without context, it's not sure why this change is needed. In particular, the presence or absence of 'uploadToken' does not seem to be correlated with the 'gitService'. If there's a correlation, the 'gitService' should not be set if 'uploadToken' is set, or vice versa.
| * See: https://github.com/codecov/codecov-api/pull/741 | ||
| */ | ||
| if (!uploadToken && serviceParams.branch?.includes(":")) { | ||
| if (!uploadToken) { |
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 check now only verifies the existence of an 'uploadToken'. It will enter the if block even if there is no ':' in the 'branch'. Consider rechecking the requirements for 'uploadToken' and 'branch'.
| */ | ||
| if (!uploadToken && serviceParams.branch?.includes(":")) { | ||
| if (!uploadToken) { | ||
| if (gitService) { |
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.
Here you are setting 'gitService' if 'uploadToken' is not available. The control flow suggests that these two fields are somehow interchangeable or correlated. However, there might not be any correlation between 'uploadToken' and 'gitService', consider segregating the conditions or explain the logical correlation between them.
❌ 11 Tests Failed:
View the top 3 failed tests by shortest run time
To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard |
❌ 11 Tests Failed:
View the top 3 failed tests by shortest run time
To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard |
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.
CodecovAI submitted a new review for 0a89a12
| * proper tokenless upload. | ||
| * See: https://github.com/codecov/codecov-api/pull/741 | ||
| */ | ||
| if (!uploadToken && serviceParams.branch?.includes(":")) { |
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.
Removing this condition means the format of the branch is no longer checked. Has the branch check been moved elsewhere, or is it no longer needed? If not necessary anymore, kindly disregard the comment.
| const foundGitService = findGitService(); | ||
| if (!foundGitService || foundGitService === "") { | ||
|
|
||
| if (gitService) { |
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 gitService check is used to set the requestBody.git_service. However, what happens when the gitService isn't provided or found? Ensure fallback or error handling measures are in place.
| if (gitService) { | ||
| requestBody.git_service = gitService; | ||
| } else { | ||
| const foundGitService = findGitService(); |
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.
The findGitService function is called here if gitService is not provided. This is good since it provides a fallback for gitService.
| requestBody.git_service = gitService; | ||
| } else { | ||
| const foundGitService = findGitService(); | ||
| if (!foundGitService || foundGitService === "" && !uploadToken) { |
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 condition checks again if gitService exists. However, aren't we already in a code block where we know gitService doesn't exist? This check seems redundant and may lead to unnecessary computational costs.
| } | ||
| } else if (oidc?.useGitHubOIDC && Core) { | ||
| } | ||
| if (oidc?.useGitHubOIDC && Core) { |
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.
The condition 'oidc?.useGitHubOIDC && Core' is left unchanged but with updated indentation level. This alteration shows good git practice. However, its purpose isn't clear without context, make sure 'Core' is defined somewhere above the code block. If 'Core' is not defined elsewhere, there will be a reference error at runtime.
|
@nora-codecov is this PR still active or are we good to close in favour of #189 ? |
Description
True Tokenless is coming. For it to work, it needs
git_service. Removing this conditional allowsgit_serviceto be included on more uploads so they will be eligible for TT.