Bug: Generate and use a token for codecov.io uploads
Opened this issue · 0 comments
stacker version
Describe the bug
We saw code-coverage failures in #557 (which should not have caused any code coverage changes, and certainly not almost complete loss of coverage). I attempted to fix that in #558, and @rchincha attempted and landed a change under #559 .
I looked into this further as ordering of an upload did not seem like it should cause coverage to break. As far as I can tell, the reason for failure of #557's report of code coverage is described in codecov.com forum here .
The solution:
What should I do about it?
Although there is no 100% way of guaranteeing success, we recommend two ways of dramatically increasing successful uploads:
- Add in the Codecov upload token 278 even if your project is public. It is recommended to add it as an environment secret as opposed to hard-coding.
- Re-trying the upload step in CI/CD.
Basically... it appears that codecov.io will always have some transient failures in upload (:disappointed: ) but using a token is reported to dramatically improve things.
You can see failures to upload in the action logs here.
- Pick a build or coverage run on the left
- expand the 'Upload code coverage' output
- search for 'error' (or 'error uploading')
For this particular ci-run, each of build/priv, build/unpriv, coverage/priv failed with message below. Only coverage/unpriv succeeded in uploading.
[2023-11-20T23:02:17.814Z] ['error'] There was an error running the uploader: Error uploading to https://codecov.io: Error: There was an error fetching the storage URL during POST: 404 - {'detail': ErrorDetail(string='Unable to locate build via Github Actions API. Please upload with the Codecov repository upload token to resolve issue.', code='not_found')}
To reproduce
- Configuration
- Client tool used
- Seen error
Expected behavior
No response
Screenshots
No response
Additional context
No response