Ignore is not working for go project

We are ignoring mock files and initialization files, however, we have noticed that this value is not working.

the file, however, is being picked up. we can adjust the range and that will change the colors. Also https://codecov.io/validate on the file comes back valid.

here is the file:

coverage:
  precision: 2         # how many decimal places to display in the UI: 0 <= value <= 4
  round: down          # how coverage is rounded: down/up/nearest
  range: 70...90      # custom range of coverage colors from red -> yellow -> green

  status:
    project:                   # measuring the overall project coverage
      default:                 # context, you can create multiple ones with custom titles
        enabled: yes           # must be yes|true to enable this status
        target: 70%            # specify the target coverage for each commit status

    patch:                     # pull requests only: this commit status will measure the
                               # entire pull requests Coverage Diff. Checking if the lines
                               # adjusted are covered at least X%.
      default:
        enabled: yes             # must be yes|true to enable this status
        target: 80%              # specify the target "X%" coverage to hit
        branches: null           # -> see "branch patterns" below
        threshold: null          # allowed to drop X% and still result in a "success" commit status
        if_no_uploads: error     # will post commit status of "error" if no coverage reports we uploaded
                                 # options: success, error, failure
        if_not_found: success
        if_ci_failed: error

  ignore:          # files and folders that will be removed during processing
      - "**/*_mock.go"
      - "**/*_init.go"

This is not valid, can you try removing it and provide a commit SHA if it does not help?

(please see Status Checks and let me know if I missed correcting examples elsewhere, or if I can make this clearer)

that makes sense, enabled removed. but it didn’t fix it.

here is the sha: 1f9539c93453d1f9729ac4fc9bef3f3922fd9bcc

It looks like we can’t find the yaml file (the error before was me eyeballing it)

Is the codecov.yml file located in the repo root and not have a leading period?

no, it’s in .circleci/codecov.yaml

we invoke it with bash <(curl -s https://codecov.io/bash) in the ci config file

Can you please try moving it to the root? We no longer search in subdirectories since we were detecting other files in error. I’ll double check that we documented that.

i made the change: new SHA 0f92fba02d45fe76a9ff1575f759e60b651e21d0
it is picking up the yaml now, but still not accepting the ignore

config.yaml

coverage:
  precision: 2         # how many decimal places to display in the UI: 0 <= value <= 4
  round: down          # how coverage is rounded: down/up/nearest
  range: 70...90      # custom range of coverage colors from red -> yellow -> green

  status:
    project:                   # measuring the overall project coverage
      default:                 # context, you can create multiple ones with custom titles
        target: 80%            # specify the target coverage for each commit status

    patch:                     # pull requests only: this commit status will measure the
                               # entire pull requests Coverage Diff. Checking if the lines
                               # adjusted are covered at least X%.
      default:
        target: 75%              # specify the target "X%" coverage to hit
        branches: null           # -> see "branch patterns" below
        if_no_uploads: error     # will post commit status of "error" if no coverage reports we uploaded
                                 # options: success, error, failure
        if_not_found: success
        if_ci_failed: error

  ignore:          # files and folders that will be removed during processing
      - "**/*_mock.go"

I’ve made a change on our side that I believe will fix that. Can you give me 30-60 mins and let me know if you are still seeing the ignore…ignored?

it still is not working for us. new SHA 9aed29de0439f0bea59b1d1fcbb034af1b7aca7d

I’m not seeing the codecov.yml in the file listing for that report. Where is it currently located, and does the bash uploader say it finds it?

the bash says it was found

  _____          _
 / ____|        | |
| |     ___   __| | ___  ___ _____   __
| |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| |  __/ (_| (_) \ V /
 \_____\___/ \__,_|\___|\___\___/ \_/
                              Bash-20191211-b8db533


==> Circle CI detected.
    project root: .
--> token set from env
    Yaml found at: .circleci/config.yml
==> Running gcov in . (disable via -X gcov)
==> Python coveragepy not found
==> Searching for coverage reports in:
    + .
    -> Found 1 reports
==> Detecting git/mercurial file structure
==> Reading reports
    + ./coverage.txt bytes=6015

we are setting it with the -y command

That’s your CircleCI config file. Where is the codecov.yml file?

sorry, yes… i was a mistype on my part, i have fixed it and we are still seeing the problem

cf3f896d00206043da336213db25d6848d37831f

#!/bin/bash -eo pipefail
curl -s https://codecov.io/bash | bash -s -- -y .circleci/codecov.yml

  _____          _
 / ____|        | |
| |     ___   __| | ___  ___ _____   __
| |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| |  __/ (_| (_) \ V /
 \_____\___/ \__,_|\___|\___\___/ \_/
                              Bash-20191211-b8db533


==> Circle CI detected.
    project root: .
--> token set from env
    Yaml found at: .circleci/codecov.yml
==> Running gcov in . (disable via -X gcov)
==> Python coveragepy not found
==> Searching for coverage reports in:
    + .
    -> Found 1 reports

Hi Kevin,

Looks like there is still some confusion. Your codecov.yml file is currently underneath the .circleci directory. Although you are using the -y option, the codecov.yml file needs to be in the root directory. This should be the fastest way to unblock you.

In other words, the file structure must look like

/
|-- .circleci
|-- codecov.yml

instead of

/
|-- .circleci
   |-- codecov.yml

Please try that and let me know if it doesn’t fix your problem.