codecov/codecov-bash

CircleCI is looking for .codecov.yml when the documentation suggest naming file without dot

Closed this issue ยท 7 comments

Hello there!

I added Codecov to a project using CircleCI to send the reports. When my codecov.yml file was named without the first dot CircleCI wasn't able to find the file. See the error below.

  _____          _
 / ____|        | |
| |     ___   __| | ___  ___ _____   __
| |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| |  __/ (_| (_) \ V /
 \_____\___/ \__,_|\___|\___\___/ \_/
                              Bash-20200303-bc4d7e6


==> Circle CI detected.
    project root: .
    Yaml found at: .codecov.yml
sed: ./.codecov.yml: No such file or directory
    -> Found 1 reports

My circleci config is:

... 
- codecov/upload:
          file: coverage.txt

I renamed the codecov file by adding the dot and it worked.

There's an inconsistency with the documentation here https://docs.codecov.io/docs/codecov-yaml#section-can-i-name-the-file-codecov-yml.
I suggest updating the docs or the CircleCI implementation. Let me know which one is more correct.

Thanks :)

The docs are correct. I find it strange that the uploader said it found it, then sed failed. Let me look into this, thanks for the report.

When the name contains the dot the logs are:

  _____          _
 / ____|        | |
| |     ___   __| | ___  ___ _____   __
| |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| |  __/ (_| (_) \ V /
 \_____\___/ \__,_|\___|\___\___/ \_/
                              Bash-20200303-bc4d7e6


==> Circle CI detected.
    project root: .
    Yaml found at: .codecov.yml
    -> Found 1 reports

Pretty much the same but without failing.
Anyways, it's working for me with the . so it's not something urgent. I'll be following this issue for updates. Thanks for replying really fast ๐Ÿ‘

I believe it's choking on this:
https://github.com/codecov/codecov-bash/blob/master/codecov#L224-L239

Can you run without the dot, add the -v flag and share the full output? That will tell me if I'm correct.

I'm wondering if it's an indenting issue. Can you also share a commit SHA so I can make sure the YAML is actually making it though the system with no errors?

How can I add the flag to CircleCI command? CircleCI is responsible for writing it, I just add the step and the orb.

If it helps, I believe all the data you need is here (from previous builds):
circleci build without dot
circleci build with dot
the codecov file

curl -s https://codecov.io/bash | bash -s -- \
  -f "coverage.txt" \
  -t "${CODECOV_TOKEN}" \
  -n "${CIRCLE_BUILD_NUM}" \
  -y ".codecov.yml" \
  -F "" \
  -Z || echo 'Codecov upload failed'

I've just realized that the CircleCI command adds the ., the command is the same for both builds. Is this something from their side?
this circleci article also uses the dot.

Oh., you are using the orb. In that case I'll dig in further here, thanks for the examples.

@thomasrockhu Do we hardcode .codecov.yml as a default in the orb, and if so can we change that, please?

@drazisil Yes I can add that to the next release