Cannot disable codecov/patch check?

Description

I have recently implemented tests and code coverage reports on the R package mombf using codecov. I have tried to disable the comment and the codecov/patch, but I cannot seem to make it work as intended.

For example, this PR has no comment but has codecov/patch check and this other one has comment and codecov/patch. I think I am correctly following the docs on patch: no and comment: off.

Any help will be greatly appreciated.

1 Like

Hi @OriolAbril

It would be patch: off as discribed here: Status Checks

It looks like you tried no and the default: block, which should not work

1 Like

Hi @drazisil,

Sorry for the late reply. I am using now off instead of no or default: block and I still see the codecov/patch check (I think I have tried no, false, off and default: block but at this point I have completely lost track). Moreover, I also see the comment even though I have comment: off. Link to the PR again

Any explanation?

Hi @OriolAbril

Thanks for sharing the PR. Our docs regarding the codecov.yml file are a little confusing, it’s a project of mine to improse them (though suggestions welcome)

Our default config for this section is

  status:
    project: yes
    patch: yes
    changes: no

In addition, `comment is validates the same way.

I believe the default key is only when you are setting the Team yaml in the UI, so let’s try this:

# configuration related to pull request comments
comment: no # do not comment PR with the result

coverage:
  range: 50..90 # coverage lower than 50 is red, higher than 90 green, between color code

  status:
    project: # settings affecting project coverage
      enabled: yes
      target: auto # auto % coverage target
      threshold: 5%  # allow for 5% reduction of coverage without failing

    # do not run coverage on patch nor changes
    patch: no
    changes: no

If that still fails, if you can share the commit SHA again from that try, I can see what the system parsed it as.

Hi,

Thanks a lot for the help and the patience. It is still doing the same, project and patch checks plus comment. The latest commit hash is fb81310146c6912c6393f925fc06e8b1a1a3d7b5

The log: Unable to use yaml from commit because it is invalid

The error: 'auto' should be instance of 'dict'

The validation rule: Optional('target'): Or('auto', percent_type),

This isn’t making any sense at all now. Thank you for your patience, I will have to dig into this more. :frowning:

2 Likes

Any updates on this issue? I met the same issue (Disable codecov/patch by gpengzhi · Pull Request #4 · gpengzhi/forte · GitHub) that codecov/patch cannot be disabled even though patch was set to be off.

Also from this PR (Remove __future__ imports by gpengzhi · Pull Request #253 · asyml/texar · GitHub), it seems that .codecov.yml is not working at all. Please let me know if I am wrong.

Ug. I thought I responded back here, guess not.

Try this, please:

coverage:
  status:
    patch:
      default:
        enabled: false

I know it doesn’t match the docs, I can correct them if this works. I’m checking if I understand the code correctly first.

Both issues are still present, comment and patch check.

Can you provide the updated SHA, please?

Definitely, sorry about that.

New sha is 81ba629cb3493b49a3018118d045ab1619726a57

Failing on target I think now, can you share the codecov.yml? I have an idea, but need to see it.

The current codecov.yml is the following:

# configuration related to pull request comments
comment: no # do not comment PR with the result

coverage:
  range: 50..90 # coverage lower than 50 is red, higher than 90 green, between color code

  status:
    project: # settings affecting project coverage
      enabled: yes
      target: auto # auto % coverage target
      threshold: 5%  # allow for 5% reduction of coverage without failing

    # do not run coverage on patch nor changes
    patch:
      default:
        enabled: false
    changes: no

You need a default block for the project section as well. It’s not clear (I’m trying to improve it) but default is the name of the status, it can be anything, but it has to exist.

1 Like

Something like this then?

# configuration related to pull request comments
comment: no # do not comment PR with the result

coverage:
  range: 50..90 # coverage lower than 50 is red, higher than 90 green, between color code

  status:
    project: # settings affecting project coverage
      default:
        enabled: yes
        target: auto # auto % coverage target
        threshold: 5%  # allow for 5% reduction of coverage without failing

    # do not run coverage on patch nor changes
    patch:
      default:
        enabled: false
    changes: no

Or having both a default and a “non-default”?

Nope, that should be perfect :crossed_fingers:

1 Like

I happened again :confused:

Let me check the logs then. SHA please? :slight_smile:

Here you go: 30758f30538bc21f7d082e2c76ffa496c1990992

Thank you for your patience.

Sorry, I don’t think enabled is valid. Since you have settings, it’s on. Try removing that key?