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

fix: codecov GitHub action is failing #2544

Closed
braaar opened this issue Oct 17, 2024 · 3 comments · Fixed by #2556
Closed

fix: codecov GitHub action is failing #2544

braaar opened this issue Oct 17, 2024 · 3 comments · Fixed by #2556
Labels
priority: high type: fix Issues describing a broken feature.

Comments

@braaar
Copy link
Member

braaar commented Oct 17, 2024

Description

The codecov github action seems to randomly fail, at least in PRs, even when the change in the PR doesn't affect source code or tests.

Minimal code-snippet showcasing the problem
Make a PR and run the test action.
See example: https://github.com/typestack/class-validator/actions/runs/11377772092/job/31656989112?pr=2542

Expected behavior

Codecov shouldn't start failing when it succeeded during the last push to main.

Actual behavior

Some string that we want to .split appears to be undefined. Here's the full log:

Run codecov -f ./coverage/clover.xml -t  --commit=$GITHUB_SHA --branch=${GITHUB_REF##*/}
  _____          _  
 / ____|        | |  
| |     ___   __| | ___  ___ _____   __  
| |    / _ \ / _` |/ _ \/ __/ _ \ \ / /  
| |___| (_) | (_| |  __/ (_| (_) \ V /  
 \_____\___/ \__,_|\___|\___\___/ \_/  
                                v3.8.2
==> Detecting CI Provider
    GitHub Actions CI Detected
==> Configuration: 
    Endpoint: https://codecov.io
{
  commit: '9d88728636805dd[4](https://github.com/typestack/class-validator/actions/runs/11377772092/job/31656989112?pr=2542#step:7:5)87072da397ef79[5](https://github.com/typestack/class-validator/actions/runs/11377772092/job/31656989112?pr=2542#step:7:6)6be25de2c',
  branch: 'merge',
  package: 'node-v3.8.2'
}
==> Building file structure
==> Generating gcov reports (skip via --disable=gcov)
    $ find /home/runner/work/class-validator/class-validator -type f -name '*.gcno'  -exec gcov  {} +
    Failed to run gcov command.
==> Targeting specific file
    + /home/runner/work/class-validator/class-validator/coverage/clover.xml
==> Uploading reports
(node:2022) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
/opt/hostedtoolcache/node/23.0.0/x[6](https://github.com/typestack/class-validator/actions/runs/11377772092/job/31656989112?pr=2542#step:7:7)4/lib/node_modules/codecov/lib/codecov.js:213
        var codecov_report_url = result.split('\n')[0]
                                        ^

TypeError: result.split is not a function
    at /opt/hostedtoolcache/node/23.0.0/x64/lib/node_modules/codecov/lib/codecov.js:213:41
    at /opt/hostedtoolcache/node/23.0.0/x64/lib/node_modules/codecov/node_modules/teeny-request/build/src/index.js:210:1[7](https://github.com/typestack/class-validator/actions/runs/11377772092/job/31656989112?pr=2542#step:7:8)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

Node.js v23.0.0
Error: Process completed with exit code 1.
@braaar braaar added type: fix Issues describing a broken feature. status: needs triage Issues which needs to be reproduced to be verified report. priority: high and removed status: needs triage Issues which needs to be reproduced to be verified report. labels Oct 17, 2024
@haiweilian
Copy link
Contributor

haiweilian commented Oct 25, 2024

In the PR, secrets.CODECOV_TOKEN is missing, but it is required by codecov.

If using codecov-action@v4: codecov/codecov-action#1431

V4 allows uploads from both forked as well as the base repo. PRs from forked repos don't need tokens for reports to be upload to codecov. PRs from the "upstream" repo, need a token today.

I can't perfectly resolve it unless I ignore PRs from base repo. (e.g.: dependabot[bot])

@braaar
Copy link
Member Author

braaar commented Nov 12, 2024

Thanks for looking into this. I've asked @NoNameProvided if we can have the secret updated.

@braaar braaar mentioned this issue Nov 18, 2024
6 tasks
This was referenced Nov 19, 2024
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority: high type: fix Issues describing a broken feature.
Development

Successfully merging a pull request may close this issue.

2 participants