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 #489

Merged
merged 2 commits into from
Jan 8, 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 get errors like the following from our most recent run on main:

[1] "Rate limit reached. Please upload with the Codecov repository upload token to resolve issue. Expected time to availability: 2836s."

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

@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

Repository secrets are not exposed to pull requests from forks, so it doesn't work by default in this case. However, when I updated to the latest test-coverage.yaml, it uses a new action that uses the token by default but then attempts tokenless uploads for pull requests. And surprisingly the tokenless upload appears to have worked. The action is official from Codecov, so maybe it allows tokenless uploads for Pull Requests. Not sure.

https://github.com/Merck/gsDesign2/actions/runs/12057253346/job/33621476108#step:6:53
https://app.codecov.io/github/Merck/gsDesign2/commit/2c2f57ab28d548bfb0bfb9885c948b02f85f0085

@jdblischak
Copy link
Collaborator Author

Ready for review!

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 5837440 into Merck:main Jan 8, 2025
7 checks passed
@jdblischak jdblischak deleted the codecov-token branch January 8, 2025 20:19
@jdblischak
Copy link
Collaborator Author

I monitored the coverage workflow on the merge commit 5837440. The token was recognized (Using token to create a commit for protected branch `{branch}` ) and the report was uploaded

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