Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Path fixing not working #673

Open
fazo96 opened this issue Apr 4, 2025 · 0 comments
Open

[BUG] Path fixing not working #673

fazo96 opened this issue Apr 4, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@fazo96
Copy link

fazo96 commented Apr 4, 2025

Describe the bug
I am uploading coverage report from our CircleCI pipeline and the reports are successfully uploaded to codecov, but all the file paths are like this: home/circleci/project/backend/... instead of backend/... so viewing the line-by-line coverage on the Codecov website is broken.

The files in the git repo are in backend/... which is causing Codecov to be unable to match the files.

To Reproduce
Steps to reproduce the behavior:

  1. Set up codecov on CircleCI
  2. upload reports
  3. File fixes do not kick in

Expected behavior
The file paths are automatically fixed, like the codecov docs says they would be with CircleCI. I also added fixes: manually to my yml but it is being ignored

Regression
I have never used it before 10.3.0 so I am not sure

Screenshots

Image

Image

URL: https://app.codecov.io/gh/flexhire/flexhire/tree/staging/home%2Fcircleci%2Fproject

Product Area
coverage

Versions

Commit and CI link

Commit hash: 85563c5bce76f52bf015d73b2224fd4b6b203d3b
CI link: https://app.circleci.com/pipelines/github/flexhire/flexhire/32208/workflows/b363ba23-e34d-42cb-8fc8-323296252f69/jobs/121381/parallel-runs/2
Codecov link: https://app.codecov.io/gh/flexhire/flexhire/tree/staging/home%2Fcircleci%2Fproject

It is a private repo unfortunately

Additional context
Add any other context about the problem here.

CircleCI upload logs:

     _____          _
    / ____|        | |
   | |     ___   __| | ___  ___ _____   __
   | |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
   | |___| (_) | (_| |  __/ (_| (_) \ V /
    \_____\___/ \__,_|\___|\___\___/ \_/
                            Wrapper-0.2.2
                                  
==> Detected linux
 -> Downloading https://cli.codecov.io/latest/linux/codecov
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 27.5M  100 27.5M    0     0   144M      0 --:--:-- --:--:-- --:--:--  144M
==> Finishing downloading linux:latest
      Version: v10.3.0
 
gpg: directory '/home/circleci/.gnupg' created
gpg: keybox '/home/circleci/.gnupg/pubring.kbx' created
gpg: /home/circleci/.gnupg/trustdb.gpg: trustdb created
gpg: key 806BB28AED779869: public key "Codecov Uploader (Codecov Uploader Verification Key) <[email protected]>" imported
gpg: Total number processed: 1
gpg:               imported: 1
==> Verifying GPG signature integrity
 -> Downloading https://cli.codecov.io/latest/linux/codecov.SHA256SUM
 -> Downloading https://cli.codecov.io/latest/linux/codecov.SHA256SUM.sig
 
gpg: Signature made Tue 25 Mar 2025 05:04:28 PM UTC
gpg:                using RSA key 27034E7FDB850E0BBC2C62FF806BB28AED779869
gpg: Good signature from "Codecov Uploader (Codecov Uploader Verification Key) <[email protected]>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 2703 4E7F DB85 0E0B BC2C  62FF 806B B28A ED77 9869
codecov: OK
==> CLI integrity verified

 -> Token length: 36
==> Running upload-coverage
      ./codecov  upload-coverage -t <redacted> --git-service github --disable-search --file /home/circleci/project/backend/coverage/coverage_fixed.xml --flag backend --report-type coverage
info - 2025-04-04 09:17:04,295 -- ci service found: circleci
warning - 2025-04-04 09:17:04,327 -- xcrun is not installed or can't be found.
warning - 2025-04-04 09:17:04,467 -- No gcov data found.
warning - 2025-04-04 09:17:04,468 -- coverage.py is not installed or can't be found.
info - 2025-04-04 09:17:04,857 -- Found 1 coverage files to report
info - 2025-04-04 09:17:04,858 -- > /home/circleci/project/backend/coverage/coverage_fixed.xml
info - 2025-04-04 09:17:05,176 -- Your upload is now processing. When finished, results will be available at: https://app.codecov.io/github/********/********/commit/85563c5bce76f52bf015d73b2224fd4b6b203d3b
info - 2025-04-04 09:17:05,343 -- Process Upload complete

Here is the head of the coverage file being uploaded:

<!--
 Generated by simplecov-cobertura version 2.1.0 (https://github.com/dashingrocket/simplecov-cobertura) 
-->
<coverage line-rate="0.29" lines-covered="17522" lines-valid="60231" complexity="0" version="0" timestamp="1743758346">
<sources>
<source>backend</source>
</sources>
<packages>
<package name="Controllers" line-rate="0.0" complexity="0">
<classes>
<class name="admin_controller" filename="app/controllers/admin_controller.rb" line-rate="0.0" complexity="0">
<methods/>
<lines>

This file is modified by our script as an attempt to make Codecov work. The original file:

<!--
 Generated by simplecov-cobertura version 2.1.0 (https://github.com/dashingrocket/simplecov-cobertura) 
-->
<coverage line-rate="0.29" lines-covered="17522" lines-valid="60231" complexity="0" version="0" timestamp="1743758346">
<sources>
<source>/home/circleci/project/backend</source>
</sources>
<packages>
<package name="Controllers" line-rate="0.0" complexity="0">
<classes>
<class name="admin_controller" filename="app/controllers/admin_controller.rb" line-rate="0.0" complexity="0">
<methods/>

The difference is in the <source> tag. Neither file works, same result with both.

codecov.yml:

fixes:
   - "/home/circleci/project::"
coverage:
  status:
    project: #add everything under here, more options at https://docs.codecov.com/docs/commit-status
      default:
        # basic
        target: auto #default
        threshold: 0%
        base: auto 
        informational: true
comment:                  #this is a top-level key
  layout: " diff, flags, files"
  behavior: default
  require_changes: false  # if true: only post the comment if coverage changes
  require_base: false        # [true :: must have a base report to post]
  require_head: true       # [true :: must have a head report to post]
  hide_project_coverage: false # [true :: only show coverage on the git diff aka patch coverage]

component_management:
  default_rules:  # default rules that will be inherited by all components
    statuses:
      - type: project # in this case every component that doens't have a status defined will have a project type one
        target: auto
  individual_components:
    - component_id: backend_services_hris
      name: HRIS Service Layer
      paths:
        - backend/app/services/hris/**
    - component_id: backend_services_ats
      name: ATS Service Layer
      paths:
        - backend/app/services/ats/**
    - component_id: backend_services_core
      name: Core Service Layer
      paths:
        - backend/app/services/core/**
    - component_id: backend_services_talent
      name: Talent Service Layer
      paths:
        - backend/app/services/talent/**
    - component_id: backend_models
      name: Models
      paths:
        - backend/app/models/**
    - component_id: backend_graphql
      name: GraphQL
      paths:
        - backend/app/graphql/**
    - component_id: backend_controllers
      name: Controllers
      paths:
        - backend/app/controllers/**
    - component_id: backend_mailers
      name: Mailers
      paths:
        - backend/app/mailers/**
    - component_id: backend_jobs
      name: Jobs
      paths:
        - backend/app/jobs/**
    - component_id: backend_lib
      name: Lib
      paths:
        - backend/lib/**
        

@fazo96 fazo96 added the bug Something isn't working label Apr 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant