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

CLI not respecting .. in coverage file search #1379

Closed
williamfgc opened this issue Apr 20, 2024 · 7 comments · Fixed by codecov/codecov-cli#432
Closed

CLI not respecting .. in coverage file search #1379

williamfgc opened this issue Apr 20, 2024 · 7 comments · Fixed by codecov/codecov-cli#432
Assignees
Labels
bug Something isn't working

Comments

@williamfgc
Copy link

williamfgc commented Apr 20, 2024

Our code coverage is broken when trying v4 + token requirement. Nothing has changed in our coverage generation flow: codecov.yaml, gcov step.

  1. Working 2 weeks ago with v3
  2. Broken status with CODECOV_TOKEN and v4

Errors:

  1. Original file with coverage info now shows as not found
  2. Finds two erroneous files and codecov coverage now shows zero
  3. Despite Linux being found, xcrun seems to be a requirement

We tried finding related v4 existing issues, but nothing similar to what we are seeing. Any help is appreciated as it seems v3 -> v4 is a major change.

@hellwolf
Copy link

This is really irritating:

/home/runner/work/_actions/codecov/codecov-action/v4.3.0/dist/codecov create-commit --git-service github -C 05ea5ad13355fc04175b193d57664c0c28d3aeeb -Z
gpg: directory '/home/runner/.gnupg' created
gpg: keybox '/home/runner/.gnupg/pubring.kbx' created
gpg: /home/runner/.gnupg/trustdb.gpg: trustdb created
gpg: key 806BB28AED779869: public key "Codecov Uploader (Codecov Uploader Verification Key) <security@codecov.io>" imported
gpg: Total number processed: 1
gpg:               imported: 1

gpg: Signature made Thu Apr 18 [16](https://github.com/superfluid-finance/protocol-monorepo/actions/runs/8763647373/job/24053493575?pr=1929#step:4:17):30:38 2024 UTC
gpg:                using RSA key 27034E7FDB850E0BBC2C62FF806BB28AED779869
gpg: Good signature from "Codecov Uploader (Codecov Uploader Verification Key) <security@codecov.io>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 2703 4E7F DB85 0E0B BC2C  62FF 806B B28A ED77 9869

==> Uploader SHASUM verified (e70beb7c9e3d894678e7d4d0fcb94e59133212dbda5ca7406b625a0167ce4ca8  codecov)
info - [20](https://github.com/superfluid-finance/protocol-monorepo/actions/runs/8763647373/job/24053493575?pr=1929#step:4:21)24-04-20 09:07:36,881 -- ci service found: github-actions
Error: Codecov token not found. Please provide Codecov token with -t flag.

And we are using v4.3.0:

      - name: Upload ethereum-contracts-coverage to codecov
        uses: codecov/codecov-action@v4.3.0
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          files: packages/ethereum-contracts/coverage/lcov.info
          name: ethereum-contracts-coverage
          flags: ethereum-contracts
          fail_ci_if_error: true

Fwiw:

    runs-on: ubuntu-latest

@thomasrockhu-codecov thomasrockhu-codecov added the bug Something isn't working label Apr 23, 2024
@kongdd
Copy link

kongdd commented Apr 26, 2024

I have the same issue

@andypearson
Copy link

I don't know if this is best practice but I've change my uses to lock the version to the newly released 4.3.1 and my codecov uploads seem to be working again:

- uses: codecov/codecov-action@v4.3.1

@andypearson
Copy link

Actually, scratch that, some of the builds on 4.3.1 have failed again with the same error:

Run codecov/codecov-action@v4.3.1
==> linux OS detected
https://cli.codecov.io/latest/linux/codecov.SHA256SUM
==> Running version latest
==> Running version v0.5.2
==> Running git config --global --add safe.directory /home/runner/work/project/projectd
/usr/bin/git config --global --add safe.directory /home/runner/work/project/project
==> Running command '/home/runner/work/_actions/codecov/codecov-action/v4.3.1/dist/codecov create-commit'
/home/runner/work/_actions/codecov/codecov-action/v4.3.1/dist/codecov create-commit --git-service github -Z
gpg: directory '/home/runner/.gnupg' created
gpg: keybox '/home/runner/.gnupg/pubring.kbx' created
gpg: /home/runner/.gnupg/trustdb.gpg: trustdb created
gpg: key REDACTED: public key "Codecov Uploader (Codecov Uploader Verification Key) <security@codecov.io>" imported
gpg: Total number processed: 1
gpg:               imported: 1

gpg: Signature made Thu Apr 18 16:30:38 2024 UTC
gpg:                using RSA key REDACTED
gpg: Good signature from "Codecov Uploader (Codecov Uploader Verification Key) <security@codecov.io>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: REDACTED

==> Uploader SHASUM verified (REDACTED  codecov)
info - 2024-05-03 20:33:02,929 -- ci service found: github-actions
Error: Codecov token not found. Please provide Codecov token with -t flag.
Error: Codecov: Failed to properly create commit: The process '/home/runner/work/_actions/codecov/codecov-action/v4.3.1/dist/codecov' failed with exit code 1

The relevant bits of my GitHub actions config:

env:
  CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
  
# ...

      - uses: codecov/codecov-action@v4.3.1
        with:
          fail_ci_if_error: true
          flags: ruby

@thomasrockhu-codecov
Copy link
Contributor

@hellwolf can you double-check that you are setting the CODECOV_TOKEN in your secrets? The logs you displayed make it seem as though it's still blank or that your workflow doesn't have permissions to secrets.

@kongdd can you open a new issue with some more details?

@andypearson I would suggest the same as above. Please check that the workflow actually has permissions to the secret and that it is filled in.

@williamfgc

  1. This looks like a bug in the new CLI, we aren't traversing ... I'll work on a fix for this
  2. This is probably a result of not finding the above formentioned file
  3. This is not a requirement, just a log statement

@thomasrockhu-codecov thomasrockhu-codecov changed the title codecov-action-v4 broken for uploading coverage reports CLI not respecting .. in coverage file search May 5, 2024
@kongdd
Copy link

kongdd commented May 7, 2024

In v3, we needn't set CODECOV_TOKEN. Why we have to set the value of CODECOV_TOKEN manually now?
It is very inconvenient.

@kongdd
Copy link

kongdd commented May 7, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants