Cannot get "Ignore" in codecov.yml to work

Description

I was trying to ignore the “test” folder from my C++ project.
Could not get it done, so I tried ignoring any file, but seems I cannot even do this :upside_down_face:.
Yaml is codecov.yml on root folder.

Repository

(private)

Commit SHAs

c1a328a

Codecov YAML

coverage:
  ignore:
    - "test/"
    - "*/**/test/*"
    - "**/test/"
    - "**/test/*"
    - "**/test/**/"
    - "**/*.gcov"
    - "**/*.cpp"
    - "**/*"
    - "*"
    - "**/*"
    - "**/**"
ignore:
  - "test/"
  - "*/**/test/*"
  - "**/test/"
  - "**/test/*"
  - "**/test/**/"
  - "**/*.gcov"
  - "**/*.cpp"
  - "**/*"
  - "*"
  - "**/*"
  - "**/**"

Additional Information

If I also use “-t token” the report is uploaded and the page in codecov.io contains both src and test folders.

Screenshot from 2020-05-05 19-43-45

ERROR GitHub HTTP 404 {"body":"{\"message\":\"Not Found\",\"documentation_url\":\"https:\/\/developer.github.com\/v3\/repos\/contents\/#get-contents\"}","bot":"gmargari","commit":"c1a328a"
--- snip---

GitHub is telling us it’s not there when we try to pull it. When you say root, do you mean to absolute root of the repository on GitHub, or in a folder that serves as the project root?

Weird, I just copied the id from codecov report. c1a328aa7a7e3e0e45b495fba80cf3891f12c944 is the full commit from GitHub.

Yes, I mean the absolute root of repo on GitHub. Haven’t commited the yml though, just playing locally.

That is why. We need to be able to pull the codecov.yml file from the repo in order to process it.

Ah, I missed that. :innocent:

Maybe then this should be somehow documented more clearly? Because on the image I posted I was using the local yaml, the bash script was stating “Yaml found at: codecov.yml” but I could not understand why the found and processed yml file was not working.

Also, your https://codecov.io/bash mentions

-y conf file Used to specify the location of the .codecov.yml config file

which should probably fixed to reflect the fact .codecov.yml filename is not supported?

Part of the file are used by the bash uploader, most are server-side. I’ll try to think of a way to make this clearer.

Thanks for the catch on the bash uploader help, I’ll correct.

So, I commited the file in codecov/codecov.yml. I call from my terminal the bash script with -y codecov/codecov.yml.

The uploader finds the yaml, but on the server the files are not filtered, meaning yaml was not processed.

If I git mv codecov/codecov.yml codecov.yml, commit, and the repeat, the files are filtered (yaml is read).

Am I missing something again? How can I have the file in a directory?

We currently only support the codecov.yml file in the dev or .github directories. Otherwise it needs to be in the repo root.

So the line
codecov.yml in the project root. If placed elsewhere you need to pass -y <conf file> to the bash uploader
in About the Codecov YAML is not correct?

Hi @gmargari, this is correct. We are in the middle of updating our docs to show this, and you have correctly pointed out where this is inaccurate. codecov.yml must be in the project root for our server-side to pick up the configuration.

Ok, so then maybe the -y bash argument is misleading/could be removed, since there a few preconfigured places that the codecov.yml must be and user cannot set an arbitrary path.
Thanks a bunch, finally got it work. :slight_smile:

@gmargari, you are absolutely right and this is on us for not communicating this better. Glad that you got it to work!

Just out of curiosity, why is “.codecov.yml” not supported, as well?

1 Like

Came here to ask the same question as @rivy. I can’t get the ignore paths to work with the .codecov.yml file. Why is this config file name not supported, when the docs say this:

Can I name the file .codecov.yml?

Yes. However, the file must still be located in the repository root, dev/ , or .github/ directories

@PaulRBerg, I replied on this topic, but you do not have a valid bot/you did not install the GitHub app