# Ignore option not working

**URL:** <https://community.codecov.com/t/ignore-option-not-working/1417>\
**Category:** Support\
**Tags:** java\
**Created:** [May 14, 2020, 6:13pm UTC](https://community.codecov.com/t/ignore-option-not-working/1417 "2020-05-14T18:13:57Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![sushantmimani](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@sushantmimani](https://community.codecov.com/u/sushantmimani)\
**Post date:** [May 14, 2020, 6:13pm UTC](https://community.codecov.com/t/ignore-option-not-working/1417/1 "2020-05-14T18:13:57Z")

</div>

### Description

I’m trying to ignore some java auto-generated files from coverage using the ignore option but it is still showing up in the reports

> **[Code coverage done right.](https://app.codecov.io/gh/sushantmimani/asherah/tree/remove-server-codecov/server/java/target/generated-sources/protobuf)**
>
> Hosted coverage report highly integrated with GitHub, Bitbucket and GitLab. Awesome pull request comments to enhance your QA.

### Repository

> **[GitHub - sushantmimani/asherah: Asherah is a multi-language, cross-platform...](https://github.com/sushantmimani/asherah)**
>
> Asherah is a multi-language, cross-platform application encryption SDK

### CI/CD

CircleCI

### Uploader

I’m using the codecov orb on CircleCI

### Commit SHAs

79769cb5ef9fefe20d8c208609d09b419bdd8e7f  
f3211c74897c3d85a0beb950d8f12aca2cc57de0

### Codecov YAML

```
coverage:
  status:
    project:
      default:
        target: 90%
        threshold: 5%
      csharp-AppEncryption:
        flags: csharp_AppEncryption
        target: 90%
      csharp-Logging:
        flags: csharp_Logging
        target: 90%
      csharp-SecureMemory:
        flags: csharp_SecureMemory
        target: 90%
      go-securememory:
        flags: go_securememory
        target: 90%
      go-appencryption:
        flags: go_appencryption
        target: 90%
      java-app-encryption:
        flags: java_app_encryption
        target: 90%
      java-secure-memory:
        flags: java_secure_memory
        target: 90%
      server-go:
        flags: server_go
        target: 90%
      server-java:
        flags: server_java
        target: 90%
# Note flags have to be "\w" charset (hence underscore instead of hyphen)
flags:
  csharp_AppEncryption:
    paths:
      - csharp/AppEncryption
  csharp_Logging:
    paths:
      - csharp/Logging
  csharp_SecureMemory:
    paths:
      - csharp/SecureMemory
  go_securememory:
    paths:
      - go/securememory
  go_appencryption:
    paths:
      - go/appencryption
  java_app_encryption:
    paths:
      - java/app-encryption
  java_secure_memory:
    paths:
      - java/secure-memory
  server-go:
    paths:
      - server/go
  server-java:
    paths:
      - server/java
ignore:
  # Ignore non-linux native paths. Ideally, be nice to setup separate OS-specific builds.
  # No need for C# path since the dotnet test command handles it currently (should change if/when we do the above)
  - "**/com/godaddy/asherah/securememory/protectedmemoryimpl/macos" # java macos path
  - "*/**/target/generated-sources/protobuf/java/com/godaddy/asherah/grpc"
  - "*/**/target/generated-sources/protobuf/grpc-java/com/godaddy/asherah/grpc"

```

### Codecov Output

```
#!/bin/bash -eo pipefail 
curl -s https://codecov.io/bash | bash -s -- \ 
  -f "server/java/target/site/jacoco/jacoco.xml" \ 
  -t "${CODECOV_TOKEN}" \ 
  -n "${CIRCLE_BUILD_NUM}" \ 
  -y ".codecov.yml" \ 
  -F "server_java" \ 
  -Z || echo 'Codecov upload failed' 
 

 
  _____ _
 
 / ____ | | |
 
| | _____ | | ______  _______
 
| | / _ \ / _` |/ _ \/ __/ _ \ \ / /
 
| |___| (_) | (_| |__/ (_| (_) \ V /
 
 \ _____\___ / \ __,_|\___ |\ ___\___ / \_/
 
                              Bash-tbd
 

 

 
==> Circle CI detected.
 
    project root: .
 
    Yaml found at: .codecov.yml
 
    -> Found 1 reports
 
==> Detecting git/mercurial file structure
 
==> Reading reports
 
    + server/java/target/site/jacoco/jacoco.xml bytes=459998
 
==> Appending adjustments
 
    http://docs.codecov.io/docs/fixing-reports
 
    + Found adjustments
 
==> Gzipping contents
 
==> Uploading reports
 
    url: https://codecov.io
 
    query: branch=remove-server-codecov&commit=79769cb5ef9fefe20d8c208609d09b419bdd8e7f&build=1210&build_url=&name=1210&tag=&slug=sushantmimani%2Fasherah&service=circleci&flags=server_java&pr=&job=0
 
    -> Pinging Codecov
 
https://codecov.io/upload/v4?package=bash-tbd&token=secret&branch=remove-server-codecov&commit=79769cb5ef9fefe20d8c208609d09b419bdd8e7f&build=1210&build_url=&name=1210&tag=&slug=sushantmimani%2Fasherah&service=circleci&flags=server_java&pr=&job=0
 
    -> Uploading
 
    -> View reports at https://codecov.io/github/sushantmimani/asherah/commit/79769cb5ef9fefe20d8c208609d09b419bdd8e7f
 
CircleCI received exit code 0

```

---

<div class="post-metadata">

**Author:** ![tom](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/tom/32/8_2.png) [@tom](https://community.codecov.com/u/tom)\
**Post date:** [May 14, 2020, 6:30pm UTC](https://community.codecov.com/t/ignore-option-not-working/1417/2 "2020-05-14T18:30:20Z")

</div>

Hi @sushantmimani, please rename the yaml file to `codecov.yml`. Let me know if that solves your issue.

---

<div class="post-metadata">

**Author:** ![sushantmimani](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@sushantmimani](https://community.codecov.com/u/sushantmimani)\
**Post date:** [May 14, 2020, 6:49pm UTC](https://community.codecov.com/t/ignore-option-not-working/1417/3 "2020-05-14T18:49:47Z")

</div>

I ran my job with `codecov.yml` but same result.

Commit SHA - 3424861819052b1dbc1bc06ef496283c8e6fbcbf

The codecov orb [documentation](https://circleci.com/orbs/registry/orb/codecov/codecov) states that the default file is .codecov.yml

| PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
| --- | --- | --- | --- | --- |
| conf | Used to specify the location of the .codecov.yml config file | - | .codecov.yml | string |

Do i need to make any additional updates to my circleci config?

---

<div class="post-metadata">

**Author:** ![tom](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/tom/32/8_2.png) [@tom](https://community.codecov.com/u/tom)\
**Post date:** [May 14, 2020, 6:57pm UTC](https://community.codecov.com/t/ignore-option-not-working/1417/4 "2020-05-14T18:57:45Z")

</div>

Hi @sushantmimani, that is accurate, but we are working on pushing out a new version of the orb here. The underlying bash uploader should be giving a deprecation warning here: [codecov-bash/codecov at master · codecov/codecov-bash · GitHub](https://github.com/codecov/codecov-bash/blob/master/codecov#L929)

One other thing, there was a bug in the yaml, try this

```auto
coverage:
  status:
    project:
      default:
        target: 90%
        threshold: 5%
      csharp-AppEncryption:
        flags:
          - csharp_AppEncryption
        target: 90%
      csharp-Logging:
        flags:
          - csharp_Logging
        target: 90%
      csharp-SecureMemory:
        flags:
          - csharp_SecureMemory
        target: 90%
      go-securememory:
        flags:
          - go_securememory
        target: 90%
      go-appencryption:
        flags:
          - go_appencryption
        target: 90%
      java-app-encryption:
        flags:
          - java_app_encryption
        target: 90%
      java-secure-memory:
        flags:
          - java_secure_memory
        target: 90%
      server-go:
        flags:
          - server_go
        target: 90%
      server-java:
        flags: 
          - server_java
        target: 90%
# Note flags have to be "\w" charset (hence underscore instead of hyphen)
flags:
  csharp_AppEncryption:
    paths:
      - csharp/AppEncryption
  csharp_Logging:
    paths:
      - csharp/Logging
  csharp_SecureMemory:
    paths:
      - csharp/SecureMemory
  go_securememory:
    paths:
      - go/securememory
  go_appencryption:
    paths:
      - go/appencryption
  java_app_encryption:
    paths:
      - java/app-encryption
  java_secure_memory:
    paths:
      - java/secure-memory
  server-go:
    paths:
      - server/go
  server-java:
    paths:
      - server/java
ignore:
  # Ignore non-linux native paths. Ideally, be nice to setup separate OS-specific builds.
  # No need for C# path since the dotnet test command handles it currently (should change if/when we do the above)
  - "**/com/godaddy/asherah/securememory/protectedmemoryimpl/macos" # java macos path
  - "*/**/target/generated-sources/protobuf/java/com/godaddy/asherah/grpc"
  - "*/**/target/generated-sources/protobuf/grpc-java/com/godaddy/asherah/grpc"

```

---

<div class="post-metadata">

**Author:** ![sushantmimani](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@sushantmimani](https://community.codecov.com/u/sushantmimani)\
**Post date:** [May 14, 2020, 6:59pm UTC](https://community.codecov.com/t/ignore-option-not-working/1417/5 "2020-05-14T18:59:30Z")

</div>

Is it necessary to delete existing codcov data or should it automatically remove ignored files when the results are uploaded next?

---

<div class="post-metadata">

**Author:** ![tom](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/tom/32/8_2.png) [@tom](https://community.codecov.com/u/tom)\
**Post date:** [May 14, 2020, 7:00pm UTC](https://community.codecov.com/t/ignore-option-not-working/1417/6 "2020-05-14T19:00:14Z")

</div>

Hi @sushantmimani, I believe it should not be automatically removed from previous uploads

---

<div class="post-metadata">

**Author:** ![sushantmimani](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@sushantmimani](https://community.codecov.com/u/sushantmimani)\
**Post date:** [May 14, 2020, 8:11pm UTC](https://community.codecov.com/t/ignore-option-not-working/1417/7 "2020-05-14T20:11:28Z")

</div>

Hi @tom. I made the following changes to my project:

- Used the updated yaml provided above
- Added a `conf: codecov.yml` statement to my circleci config
- Deleted past data on Codecov

Then when i ran the job, it ignored the files as expected.

I have one last question. Why does the first ignore statement work correctly with ` **/` while the second and third ones require `*/** /`?

---

<div class="post-metadata">

**Author:** ![tom](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/tom/32/8_2.png) [@tom](https://community.codecov.com/u/tom)\
**Post date:** [May 14, 2020, 8:17pm UTC](https://community.codecov.com/t/ignore-option-not-working/1417/8 "2020-05-14T20:17:16Z")

</div>

Hi @sushantmimani, I’m glad that worked for you! I’ll be honest I don’t think you need `*/` on the 2nd and 3rd ones, as I had copied it from what you had provided above. I don’t think it is necessary.

---

<div class="post-metadata">

**Author:** ![sushantmimani](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@sushantmimani](https://community.codecov.com/u/sushantmimani)\
**Post date:** [May 14, 2020, 8:18pm UTC](https://community.codecov.com/t/ignore-option-not-working/1417/9 "2020-05-14T20:18:33Z")

</div>

Perfect! Thanks once again, Tom!
