Ignoring pull requests from certain branches

Is it possible to ignore certain branches wilcard, so to prevent codecov from happening?

for my scenario: my team do git flow where there’s a release branch, and we want to merge the release branch back to the main branch.
However, for these branches, we want to skip various jobs (linting/testing/etc/etc) because we don’t see the need to. Unfortunately, codecov will wait indefinitely for the test reports to be out, which will not happen for those branches

I’m confused @finalight, is Codecov waiting because it is set as a required status check?

which required are you referring to? the one in codecov settings or the one in github repo settings?

@finalight I meant the one in GitHub settings


as an example

yea, i checked, it is required.

i don’t think my team can remove that, because we need that for other branches → master

but at the same time, release branch → master should just pass as it is

@finalight I’m sorry it took me awhile to get back to you. I’ve been wracking my brain on this one, because I don’t think we support that flow, but I want to see if the following is a workable solution. The issue is that without any uploads, Codecov isn’t aware of the commit or to return a status check.

  1. Add Flags to all uploads in CI. If you are using the CircleCI orb, you should be able to pass in something like
- codecov/upload:
    flags: <some useful name>

What we are doing here is telling Codecov to label coverage reports are they are being uploaded.

  1. Set those flags to be Carryforward. You should be able to do this in the codecov.yml by doing
flag_management:
  default_rules:
    carryforward: true

Now we are telling Codecov that IF we do not upload a coverage report with a given label (as specified in part 1), pull the most recent commit with that flag and use that for coverage. The purpose of this is to keep consistent coverage even when you don’t upload a coverage report.

  1. Ok, now we need to upload a “fake” coverage report to Codecov. It still need to hold some data, or Codecov will assume it’s an empty coverage report. This will need to be uploaded all the time, but it should not require any tests to be run. I don’t know what your current coverage reports look like, or what line of code you will assume is ALWAYS run. If you could share a commit SHA, maybe we can figure this out. If you are feeling skilled enough, you can create a report based off of a support coverage format.

  2. I think you will need to still run tests and upload coverage one time on the release and master branch, afterwards you should be good.

Let me know if this helps or if you need more help setting this up. I’m sorry it’s not really a smooth solution, but I’m hoping it’ll work for you.