feedback icon indicating copy to clipboard operation
feedback copied to clipboard

Feedback about setting up your repo

Open codecovdesign opened this issue 3 years ago • 79 comments

Thanks for dropping by! 👋

We've been working on improving the repo configuration and set up..

  • How was your experience setting up your repo?
  • Did you experience any challenges?
  • What did you think about the documentation?
  • What would improve the set up process?
  • Any general thoughts you'd like to share!

We greatly appreciate your time and thoughts - looking forward to hearing from you ❤

Codecov team

This issue is intended to share and collect feedback about the tool. If you have support needs or questions, please see our support page.

codecovdesign avatar Mar 14 '22 13:03 codecovdesign

The repo setup page includes this note:

*Not required if your repo is using GitHub Actions, Travic CI, CIrcle CI, AppVeyor, or Azure Pipelines.

The codecov-action says this though:

If you have a private repository, this Action also requires you to [provide an upload token](https://docs.codecov.io/docs/frequently-asked-questions#section-where-is-the-repository-upload-token-found-) from [codecov.io](https://www.codecov.io/) (

I tried it without the token and it did not work, so I'm going to follow the instructions under the codecov-action instead of the setup repo instructions.

chrisxaustin avatar Oct 08 '22 14:10 chrisxaustin

The setup for multi-module maven projects with jacoco isn't as intuitive as I'd like, so some more documentation would reduce friction when adding new projects. The basic upload works well, but I'd also like to capture cross-module coverage for cases where module A uses module B heavily in the tests. The current behaviour seems to only consider same-module coverage in the final report, which is often appropriate, but is misleading in my case.

chrisxaustin avatar Oct 23 '22 19:10 chrisxaustin

too hard i dont need Ci bruh

eepyeunomia avatar Jan 20 '23 22:01 eepyeunomia

Some repo is deleted and never upload. It always display on my Dashboard. I want delete it in settings, but always route to /new.

suiyun39 avatar Feb 12 '23 16:02 suiyun39

Spelling mistake: Once you've committed your changes in step 2 and ran your CI/CD pipeline. In tour pull request, you should see two status checks:

I assume "Tour" is "Your"

As for Documentation. Its quite vague and unclear on expectations on how for example you want the users to publish their code coverage along side Codecov. May I suggest you take the time to publish some example simple "Actions.yml" / examples for people to view and make use of.

mossyblog avatar Feb 14 '23 12:02 mossyblog

Worked great.

SpotlightForBugs avatar Mar 03 '23 05:03 SpotlightForBugs

omg. that is the worst setup experience.

  1. The 'GitHub public repos' link to sign up requires full access to all repos, and lists all the private repos;
  2. Disjointed documentation & steps to hook up GitHub to CodeCov.

cloudshiftchris avatar Mar 05 '23 20:03 cloudshiftchris

"Step 3: add Codecov to your GitHub Actions workflow" okay, how?

dogederp avatar Mar 31 '23 10:03 dogederp

"Step 3: add Codecov to your GitHub Actions workflow" okay, how?

It would be good to know where in the workflow this should be added, or does it not matter?

albanh avatar Mar 31 '23 11:03 albanh

@dogederp @albanh thank you for the feedback. We investigated this and realized the anchor of "GitHub Actions" was going to the wrong page (it's been fixed). Further, based on you're feedback we'll plan to add more subtext for where/how to add to actions. Thank you again 🙏

codecovdesign avatar Apr 11 '23 14:04 codecovdesign

The documentation refers to "pull request" in step 4

What pull request? I've just created repo and pushed stuff directly to the trunk, there are no pull requests. Do there need to be? How do I tell if coverage was generated for a repo?

I've completed all the steps in the GitHub actions successfully I think, but the repo list still says "not yet enabled". How do I debug this?

Step 4 says "Once you've committed your changes in Step 2". I don't think anything is committed is it? You just setup and enable the app . Does something need to be committed in the repo?

This page https://docs.codecov.com/docs/quick-start specifically shows something different for step 3:

- name: Upload coverage reports to Codecov
  uses: codecov/codecov-action@v3

vs

- name: Upload coverage reports to Codecov
      run: |
        # Replace `linux` below with the appropriate OS
        # Options are `alpine`, `linux`, `macos`, `windows`
        curl -Os https://uploader.codecov.io/latest/linux/codecov
        chmod +x codecov
        ./codecov -t ${CODECOV_TOKEN}

Which is right?

jayber avatar Apr 15 '23 19:04 jayber

@jayber sorry for my delay, just noticing this. Thanks for the feedback.

What pull request? there are no pull requests. Do there need to be?

No, it doesn't require a pull request. However, commonly configuration would be done with a PR workflow, but it sounds like you committed directly to the head. We mention the PR in step 4 is because there is a PR comment coverage report and status check.

How do I tell if coverage was generated for a repo?

If you go to your action and look at workflow, you may see the following:

Screenshot 2023-05-05 at 9 39 28 AM

Could you send the output of the CI step where you're uploading the coverage?

This page https://docs.codecov.com/docs/quick-start specifically shows something different for step 3:

Sorry for the confusion here. The reason there is a diff is because the first one is more specific to GitHub actions CI and the other is generic CI. The Codecov GitHub action is a wrapper for the same instructions in the quick start guide. We will be following up to update our docs to be more clear about this. Thanks for the feedback 🙏

codecovdesign avatar May 05 '23 15:05 codecovdesign

I've got codecov working fine with several public repositories but I can't get it working with one private repo - I always get the same error. I have done:

  1. Added the CODECOV_TOKEN as a repository secret
  2. Allowed access to the repo in the Codecov app that I installed in my GitHub account
  3. Have this in my GitHub Action (the same as I have in my working public repos, except with the addition of the with section):
      - name: Upload Coverage to Codecov
        uses: codecov/codecov-action@v3
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
    

But running that step results in this (I've only replaced the name of the repo with myrepo):

Run codecov/codecov-action@v3
==> linux OS detected
https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
==> SHASUM file signed by key id 806bb28aed779869
==> Uploader SHASUM verified (02b055414cc124203ab061ffc45f5497ca39ede5e63a06717a6981c32d7b425f  codecov)
==> Running version latest
==> Running version v0.5.0
/home/runner/work/_actions/codecov/codecov-action/v3/dist/codecov -n  -Q github-action-3.1.3
[2023-05-15T11:55:18.421Z] ['info'] 
     _____          _
    / ____|        | |
   | |     ___   __| | ___  ___ _____   __
   | |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
   | |___| (_) | (_| |  __/ (_| (_) \ V /
    \_____\___/ \__,_|\___|\___\___/ \_/

  Codecov report uploader 0.5.0
[2023-05-15T11:55:18.432Z] ['info'] => Project root located at: /home/runner/work/myrepo/myrepo
[2023-05-15T11:55:18.433Z] ['info'] -> No token specified or token is empty
[2023-05-15T11:55:18.614Z] ['info'] Running coverage xml...
[2023-05-15T11:55:19.482Z] ['info'] Searching for coverage files...
[2023-05-15T11:55:19.572Z] ['info'] Warning: Some files located via search were excluded from upload.
[2023-05-15T11:55:19.572Z] ['info'] If Codecov did not locate your files, please review https://docs.codecov.com/docs/supported-report-formats
[2023-05-15T11:55:19.573Z] ['info'] => Found 1 possible coverage files:
  coverage.xml
[2023-05-15T11:55:19.573Z] ['info'] Processing /home/runner/work/myrepo/myrepo/coverage.xml...
[2023-05-15T11:55:19.579Z] ['info'] Detected GitHub Actions as the CI provider.
[2023-05-15T11:55:19.846Z] ['info'] Pinging Codecov: https://codecov.io/upload/v4?package=github-action-3.1.3-uploader-0.5.0&token=*******&branch=main&build=4980002434&build_url=https%3A%2F%2Fgithub.com%2Fphilgyford%2F myrepo%2Factions%2Fruns%2F4980002434&commit=b1b59b59a1fedc21b8ca307e00180de555b6f9fd&job=test-and-deploy&pr=&service=github-actions&slug=philgyford%2F myrepo&name=&tag=&flags=&parent=
[2023-05-15T11:55:20.203Z] ['error'] There was an error running the uploader: Error uploading to [https://codecov.io:](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')}

philgyford avatar May 15 '23 12:05 philgyford

Thanks @philgyford I also needed to add:

    with:
      token: ${{ secrets.CODECOV_TOKEN }}

to my GitHub Action. Before adding that I was getting:

[2023-05-17T11:49:49.686Z] ['info'] -> No token specified or token is empty
...
[2023-05-17T11:49:50.234Z] ['info'] Pinging Codecov: https://codecov.io/upload/v4?package=github-action-3.1.4-uploader-0.5.0&  [rest redacted]
[2023-05-17T11:49:50.481Z] ['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')}

Now it succeeds:

[2023-05-17T11:56:14.465Z] ['info'] ->  Token found by environment variables
...
[2023-05-17T11:56:15.052Z] ['info'] Pinging Codecov: https://codecov.io/upload/v4?package=github-action-3.1.4-uploader-0.5.0&  [rest redacted]
[2023-05-17T11:56:15.419Z] ['info'] Uploading...
[2023-05-17T11:56:15.640Z] ['info'] {"status":"success","resultURL":"https://app.codecov.io/github/  [ rest redacted ]

And I can now see the analysis over on the codecov.io website.

The instructions for GitHub Actions should be amended to also state the with block

gregorywilliams avatar May 17 '23 12:05 gregorywilliams

Thanks @gregorywilliams but I already had that in the example of my code I showed, or do you mean it needs to go somewhere else?

  - name: Upload Coverage to Codecov
    uses: codecov/codecov-action@v3
    with:
      token: ${{ secrets.CODECOV_TOKEN }}

philgyford avatar May 19 '23 15:05 philgyford

@philgyford I was agreeing that I'd also needed to add the same and thanking you for mentioning it.

When I set up Codecov against my repo their instructions neglected to mention the with block. It's those instructions that I think that Codecov should modify, such that others aren't also caught out. I included the before / after output that I had such that others reading this thread may recognise the signs and thus the resolution.

gregorywilliams avatar May 19 '23 17:05 gregorywilliams

@gregorywilliams Unfortunately it's not the resolution for me, because I have the with block and I'm getting the error I displayed.

philgyford avatar May 23 '23 10:05 philgyford

with:
token: ${{ secrets.CODECOV_TOKEN }}

@gregorywilliams that's right, and we'll be adding this input to the repo guide page ✅

@philgyford I'm unsure what the issue is based on your post. Could you reach out to our support team ?

codecovdesign avatar May 23 '23 13:05 codecovdesign

Hi, As a beginner while setting up code coverage for my project, I faced the following issue:

Screenshot 2023-06-15 at 9 20 51 PM In step2 when I copy the code and paste it into my Github Actions yaml file,

for this line:

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

I get the following error, and my build fails:

Nested mappings are not allowed in compact mappings YAML

Solution: we need to add it under env:

      - name: Upload coverage to codecov.io
        uses: codecov/codecov-action@v3
        env: 
         CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

Please update this part in the Setup for GitHub Actions.

enraiha0307 avatar Jun 15 '23 16:06 enraiha0307

As a member of an org that had just passed its seat limit, I could not get a new repo to show up in the dashboard list, although initiating the request to add the repo to codecov's permissioned set showed no errors. It took an admin (CTO) digging into the codecov dashboard to discover I had an "inactive" status, which, perhaps was causing the permission update to fail? Not sure, but nothing in my UI indicated that anything was amiss.

Better error/status reporting to make it clear what we needed to do would have saved some c-suite guesswork!

cameron avatar Jun 20 '23 23:06 cameron

image

I also found this problem.

JohannLai avatar Jun 21 '23 11:06 JohannLai

image

I also found this problem.

I also have this problem now. Here is the correct syntax:

- name: Upload coverage reports to Codecov
  uses: codecov/codecov-action@v3
  env:
    CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

larryaasen avatar Jul 03 '23 12:07 larryaasen

@larryaasen @JohannLai @enraiha0307 thank you for raising the syntax error. The fix in live: Screenshot 2023-07-19 at 9 52 09 AM

codecovdesign avatar Jul 19 '23 15:07 codecovdesign

Hello dear team, I think you should mention two things clearly:

  1. The action (as what I understand) will run the tests again with code coverage (is this correct? It is not clear)
  2. There are other config options for the action

Now my question (to which I'm trying to find an answer) is: Where does the action get the coverage files to upload? I think the answer is in the docs of the action itself, but I'm still investigating (spending time in something that should have clarified since the start by the docs).

Aerendir avatar Jul 20 '23 17:07 Aerendir

I'm still confused about how to specify the token required for private repositories.

The codecov-action README says:

    - name: Upload coverage to Codecov
      uses: codecov/codecov-action@v3
      with:
        token: ${{ secrets.CODECOV_TOKEN }}

The example in the website docs is like:

    - name: Upload coverage reports to Codecov
      run: |
        # Replace `linux` below with the appropriate OS
        # Options are `alpine`, `linux`, `macos`, `windows`
        curl -Os https://uploader.codecov.io/latest/linux/codecov
        chmod +x codecov
        ./codecov -t ${CODECOV_TOKEN}

The examples in the above comments – including a screenshot of a correct version from @codecovdesign – are like this (I don't know which docs the screenshot is taken from):

- name: Upload coverage reports to Codecov
  uses: codecov/codecov-action@v3
  env:
    CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN  }}

Are all of these correct? Or two of them? Or only one of them? If the latter, could they all be kept in sync?

philgyford avatar Jul 21 '23 13:07 philgyford

@Aerendir thank you for your feedback! Based on it, I'm creating some updates to the copy to be more clear in the documentation / setup guide 🙏 .

The action (as what I understand) will run the tests again with code coverage (is this correct? It is not clear)

The action does not run the test, rather after running tests in the CI and generating coverage reports, it upload coverage data to Codecov.

Now my question (to which I'm trying to find an answer) is: Where does the action get the coverage files to upload?

It will get the reports from the CI test run. If the CI isn't configured to output coverage reports, you'll need to configure this in your testing tool.

codecovdesign avatar Jul 21 '23 19:07 codecovdesign

@philgyford that is confusing and thanks for raising 🙏 . For the 1st and 3rd examples that is specific to GitHub actions and the 2nd input is generic for other CIs. My takeaway actions here are 1) update copy to be clear about input diff in documentation, 2) sync/align 1&3 to be consistent across docs.

codecovdesign avatar Jul 21 '23 19:07 codecovdesign

@codecovdesign Thanks. One thing though – you say "the 2nd input is generic for other CIs" but it's introduced with "An example of a workflow using the uploader with GitHub Actions is shown below." Which would make me think that's how to set things up with GitHub Actions?

philgyford avatar Jul 22 '23 10:07 philgyford

EDIT:

Comparing the circleci reports between the example and my repository I see this error in the "Upload Coverage Results"

[2023-07-28T12:24:29.424Z] ['info'] => Project root located at: /home/circleci/project
[2023-07-28T12:24:29.425Z] ['info'] ->  Token found by arguments
[2023-07-28T12:24:29.596Z] ['info'] Running coverage xml...
[2023-07-28T12:24:29.757Z] ['info'] Searching for coverage files...
[2023-07-28T12:24:29.783Z] ['info'] Warning: Some files located via search were excluded from upload.
[2023-07-28T12:24:29.783Z] ['info'] If Codecov did not locate your files, please review https://docs.codecov.com/docs/supported-report-formats
[2023-07-28T12:24:29.783Z] ['error'] There was an error running the uploader: No coverage files located, please try use `-f`, or change the project root with `-R`

What is the coverage files ? Where should I place the "-f" or "-R"?

ORIGINAL:

I managed to make it work with the example repository for python using circleci. I had issues with the platform by getting this error:

Screenshot from 2023-07-28 14-32-29

But once I gave the permissions it works. However, when I try to implement it on my own repository I cannot manage to connect codecov.

This is my config.yml file.

I added to token to circleci:

Screenshot from 2023-07-28 14-36-32

And both repositories have permissions:

Screenshot from 2023-07-28 14-37-58

I wonder if anyone could please share some tip on what I am missing.

Vital-Fernandez avatar Jul 28 '23 12:07 Vital-Fernandez

Hi @Vital-Fernandez , it looks like pytest isn't generating the coverage files. See https://app.circleci.com/pipelines/github/Vital-Fernandez/lime/6/workflows/e2049f6c-26dd-48b0-95cd-7d497a44f6b3/jobs/6?invite=true#step-103-16

drazisil-codecov avatar Jul 28 '23 15:07 drazisil-codecov