Skip to content
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 CODECOV_TOKEN to fix code coverage uploads #298

Merged
merged 2 commits into from
Jan 7, 2025

Conversation

jdblischak
Copy link
Collaborator

Our code coverage results have not been uploaded for months because we aren't using a Codecov token. We were recently provided a single repository upload token for the gsDesign2 repository by the Merck open source team. Once it is added as a repository secret named CODECOV_TOKEN, our workflow will start uploading coverage results again.

xref: r-lib/actions#834, Merck/gsDesign2#489

@jdblischak jdblischak self-assigned this Nov 14, 2024
@nanxstats
Copy link
Collaborator

@jdblischak Should we just run usethis::use_github_action("test-coverage") to update to the latest test-coverage workflow from r-lib/actions? There seems to be some accumulated changes compared to the old workflow we are using.

@jdblischak
Copy link
Collaborator Author

@jdblischak
Copy link
Collaborator Author

I think using CODECOV_TOKEN may no longer be required. Looking at the workflow, since this is a PR without access to repository secrets, it used a tokenless upload that succeeded:

https://github.com/Merck/simtrial/actions/runs/12057397402/job/33621935217?pr=298#step:6:18

baseRef: Merck:main | headRef: jdblischak:codecov-token
==> Fork detected, tokenless uploading used

And when I go to the coverage report for this PR, https://app.codecov.io/gh/Merck/simtrial/pull/298, I see the banner message "Your org no longer requires upload tokens. You can upload without a token. Contact your admins to manage the global upload token settings."

image

This is super frustrating. We went months without producing coverage reports, we finally properly fixed it by registering an upload token, and then they decided to roll back this requirement. And I can't find any recent blog post or documentation to accompany the banner announcement.

Anyways, we already went through the effort to add CODECOV_TOKEN, so I'd argue we should still merge this PR. Worst case it is unnecessary, and best case if they decide to change their mind once again, we'll already have a token registered.

@jdblischak
Copy link
Collaborator Author

I think using CODECOV_TOKEN may no longer be required.

Or maybe not! Despite the banner message saying a token is no longer required, on my other PR #303, the coverage had previously been uploaded (https://app.codecov.io/gh/Merck/simtrial/pull/303), but then today I got the expected rate limiting message.

So yes, let's definitely merge this PR.

Copy link
Collaborator

@LittleBeannie LittleBeannie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @jdblischak !

@LittleBeannie LittleBeannie merged commit e29c87c into Merck:main Jan 7, 2025
9 checks passed
@jdblischak jdblischak deleted the codecov-token branch January 7, 2025 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants