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

Bump codecov/codecov-action from 4 to 5 #56

Merged
merged 1 commit into from
Nov 19, 2024

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Nov 18, 2024

Bumps codecov/codecov-action from 4 to 5.

Release notes

Sourced from codecov/codecov-action's releases.

v5.0.0

v5 Release

v5 of the Codecov GitHub Action will use the Codecov Wrapper to encapsulate the CLI. This will help ensure that the Action gets updates quicker.

Migration Guide

The v5 release also coincides with the opt-out feature for tokens for public repositories. In the Global Upload Token section of the settings page of an organization in codecov.io, you can set the ability for Codecov to receive a coverage reports from any source. This will allow contributors or other members of a repository to upload without needing access to the Codecov token. For more details see how to upload without a token.

[!WARNING]
The following arguments have been changed

  • file (this has been deprecated in favor of files)
  • plugin (this has been deprecated in favor of plugins)

The following arguments have been added:

  • binary
  • gcov_args
  • gcov_executable
  • gcov_ignore
  • gcov_include
  • report_type
  • skip_validation
  • swift_project

You can see their usage in the action.yml file.

What's Changed

... (truncated)

Changelog

Sourced from codecov/codecov-action's changelog.

4.0.0-beta.2

Fixes

  • #1085 not adding -n if empty to do-upload command

4.0.0-beta.1

v4 represents a move from the universal uploader to the Codecov CLI. Although this will unlock new features for our users, the CLI is not yet at feature parity with the universal uploader.

Breaking Changes

  • No current support for aarch64 and alpine architectures.
  • Tokenless uploading is unsuported
  • Various arguments to the Action have been removed

3.1.4

Fixes

  • #967 Fix typo in README.md
  • #971 fix: add back in working dir
  • #969 fix: CLI option names for uploader

Dependencies

  • #970 build(deps-dev): bump @​types/node from 18.15.12 to 18.16.3
  • #979 build(deps-dev): bump @​types/node from 20.1.0 to 20.1.2
  • #981 build(deps-dev): bump @​types/node from 20.1.2 to 20.1.4

3.1.3

Fixes

  • #960 fix: allow for aarch64 build

Dependencies

  • #957 build(deps-dev): bump jest-junit from 15.0.0 to 16.0.0
  • #958 build(deps): bump openpgp from 5.7.0 to 5.8.0
  • #959 build(deps-dev): bump @​types/node from 18.15.10 to 18.15.12

3.1.2

Fixes

  • #718 Update README.md
  • #851 Remove unsupported path_to_write_report argument
  • #898 codeql-analysis.yml
  • #901 Update README to contain correct information - inputs and negate feature
  • #955 fix: add in all the extra arguments for uploader

Dependencies

  • #819 build(deps): bump openpgp from 5.4.0 to 5.5.0
  • #835 build(deps): bump node-fetch from 3.2.4 to 3.2.10
  • #840 build(deps): bump ossf/scorecard-action from 1.1.1 to 2.0.4
  • #841 build(deps): bump @​actions/core from 1.9.1 to 1.10.0
  • #843 build(deps): bump @​actions/github from 5.0.3 to 5.1.1
  • #869 build(deps): bump node-fetch from 3.2.10 to 3.3.0
  • #872 build(deps-dev): bump jest-junit from 13.2.0 to 15.0.0
  • #879 build(deps): bump decode-uri-component from 0.2.0 to 0.2.2

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4 to 5.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](codecov/codecov-action@v4...v5)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Nov 18, 2024
@brynpickering
Copy link
Collaborator

The main issue with this is how it handles tokenless uploads (for public projects). All our uploads are tokenless as we only allow upload to codecov for public projects (we'd need to be on a paid plan to upload internal projects). Their docs suggest it just requires an arup-group GH admin to allow tokenless uploads from public projects in the Codecov admin panel. @mfitz would you be able to do this?

@mfitz
Copy link
Contributor

mfitz commented Nov 18, 2024

The main issue with this is how it handles tokenless uploads (for public projects). All our uploads are tokenless as we only allow upload to codecov for public projects (we'd need to be on a paid plan to upload internal projects).

I've been meaning to look into this for a while @brynpickering. (I think) I see the CodeCov upload failing even on public repos like PAM and GeNet, where tokenless upload should work; plus, I remember seeing a CodeCov token in the secrets on some of our repos.

This is from a GeNet build kicked off by a PR:

Run codecov/codecov-action@v4
eventName: pull_request
baseRef: arup-group:main | headRef: arup-group:bugfix/link-add-multiindexing
==> linux OS detected
https://cli.codecov.io/latest/linux/codecov.SHA256SUM
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 Nov 14 16:03:56 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 (42803b7cc22e28e12a02c84435cd6f6fbde41946fb15038f0791669906508a03  codecov)
==> Running version latest
==> Running version v9.0.4
==> Running git config --global --add safe.directory /home/runner/work/genet/genet
/usr/bin/git config --global --add safe.directory /home/runner/work/genet/genet
==> Running command '/home/runner/work/_actions/codecov/codecov-action/v4/dist/codecov create-commit'
/home/runner/work/_actions/codecov/codecov-action/v4/dist/codecov create-commit --git-service github -C 8175d0803a676254ed5d913c706d67131d527106
info - 2024-11-14 16:13:31,945 -- ci service found: github-actions
warning - 2024-11-14 16:13:31,952 -- No config file could be found. Ignoring config.
info - 2024-11-14 16:13:32,250 -- Process Commit creating complete
error - 2024-11-14 16:13:32,251 -- Commit creating failed: {"message":"Token required because branch is protected"}

==> Running command '/home/runner/work/_actions/codecov/codecov-action/v4/dist/codecov create-report'
/home/runner/work/_actions/codecov/codecov-action/v4/dist/codecov create-report --git-service github -C 8175d0803a676254ed5d913c706d67131d527106
info - 2024-11-14 16:13:32,976 -- ci service found: github-actions
warning - 2024-11-14 16:13:32,984 -- No config file could be found. Ignoring config.
info - 2024-11-14 16:13:33,361 -- Process Report creating complete
error - 2024-11-14 16:13:33,362 -- Report creating failed: {"message":"Token required because branch is protected"}

==> Running command '/home/runner/work/_actions/codecov/codecov-action/v4/dist/codecov do-upload'
/home/runner/work/_actions/codecov/codecov-action/v4/dist/codecov do-upload --git-service github -C 8175d0803a676254ed5d913c706d67131d527106
info - 2024-11-14 16:13:34,074 -- ci service found: github-actions
warning - 2024-11-14 16:13:34,081 -- No config file could be found. Ignoring config.
warning - 2024-11-14 16:13:34,083 -- xcrun is not installed or can't be found.
warning - 2024-11-14 16:13:34,088 -- No gcov data found.
warning - 2024-11-14 16:13:34,088 -- coverage.py is not installed or can't be found.
info - 2024-11-14 16:13:34,101 -- Found 1 coverage files to report
info - 2024-11-14 16:13:34,101 -- > /home/runner/work/genet/genet/reports/coverage/coverage.xml
info - 2024-11-14 16:13:34,470 -- Process Upload complete
error - 2024-11-14 16:13:34,470 -- Upload failed: {"message":"Token required because branch is protected"}

Every command the action attempts seems to fail because of a token/branch protection problem, so presumably the upload to CodeCov is falling? And yet the action looks like it succeeded.

Where should the coverage reports be uploaded to? How do I check them from that side?

Their docs suggest it just requires an arup-group GH admin to allow tokenless uploads from public projects in the Codecov admin panel. @mfitz would you be able to do this?

I'm an admin on the organisation, so I should be able to do that. Let me check.

@mfitz
Copy link
Contributor

mfitz commented Nov 18, 2024

I've changed the global setting on the arup-group organisation @brynpickering:

Screenshot 2024-11-18 at 15 31 59

@brynpickering
Copy link
Collaborator

brynpickering commented Nov 18, 2024

I've been meaning to look into this for a while @brynpickering. (I think) I see the CodeCov upload failing even on public repos like PAM and GeNet, where tokenless upload should work; plus, I remember seeing a CodeCov token in the secrets on some of our repos.

Yeah, tokenless uploads have been a pain in <v5 as it was technically possible but would often fail (this is why I added the codecov token where possible). I also hadn't realised they'd added this "if not protected" rule. If you checking this box is sufficient for them all to work in v5 then we can update the action to fail when codecov fails.

@mfitz
Copy link
Contributor

mfitz commented Nov 18, 2024

That looks to have done the trick, @brynpickering. I manually re-ran a GeNet build that had previously failed to upload to CodeCov, and it's pushed the report (see here).

==> Running command '/home/runner/work/_actions/codecov/codecov-action/v4/dist/codecov do-upload'
/home/runner/work/_actions/codecov/codecov-action/v4/dist/codecov do-upload --git-service github
info - 2024-11-18 16:14:55,709 -- ci service found: github-actions
warning - 2024-11-18 16:14:55,717 -- No config file could be found. Ignoring config.
warning - 2024-11-18 16:14:55,718 -- xcrun is not installed or can't be found.
warning - 2024-11-18 16:14:55,723 -- No gcov data found.
warning - 2024-11-18 16:14:55,724 -- coverage.py is not installed or can't be found.
info - 2024-11-18 16:14:55,738 -- Found 1 coverage files to report
info - 2024-11-18 16:14:55,739 -- > /home/runner/work/genet/genet/reports/coverage/coverage.xml
info - 2024-11-18 16:14:56,060 -- Your upload is now processing. When finished, results will be available at: https://app.codecov.io/github/arup-group/genet/commit/32703b[46](https://github.com/arup-group/genet/actions/runs/11856457897/job/33148084742#step:8:47)217a58e158cd330bca3fd5f08b0c7833
info - 2024-11-18 16:14:56,239 -- Process Upload complete

So we're now okay to merge this PR?

@mfitz
Copy link
Contributor

mfitz commented Nov 18, 2024

I'm wondering if the CodeCov token is being passed to the codecov action from repos like GeNet where it is configured as a secret, @brynpickering. It doesn't look like it is.

I think we would need to include a secrets section in the definition of the step that triggers code coverage, in the same way we do for the AWS upload, for example:

aws-upload:
    needs: test
    if: needs.test.result == 'success'
    uses: arup-group/actions-city-modelling-lab/.github/workflows/aws-upload.yml@main
    secrets:
      AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
      AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
      AWS_S3_CODE_BUCKET: ${{ secrets.AWS_S3_CODE_BUCKET }}

I don't see the CODECOV_TOKEN secret being propagated in the same way in workflow steps like this one.

Of course, this is no longer important if we stick with the no-token uploads approach across the board, but if we do need to use a token in places, we need to bear it in mind.

Copy link
Contributor

@mfitz mfitz left a comment

Choose a reason for hiding this comment

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

I've now set tokenless uploads at the global level for the arup-group organisation, so this version bump should be safe.

@mfitz mfitz merged commit f4c57cf into main Nov 19, 2024
1 check passed
@dependabot dependabot bot deleted the dependabot/github_actions/codecov/codecov-action-5 branch November 19, 2024 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants