feedback icon indicating copy to clipboard operation
feedback copied to clipboard

Golang: Tracked lines are calculated wrong on conflicting package and file names

Open KinNeko-De opened this issue 1 year ago • 1 comments

Describe the bug I have a GitHub repository that contains the path /internal/operation/logger. Inside the package 'logger' there is a logger.go file with 21 lines of code On complete off my last pull request ( https://app.codecov.io/gh/KinNeko-De/restaurant-file-store-svc/commit/13fd235fc1849eff785a4b362d432062e78a4905/blob/internal/app/operation/logger/logger.go ) codecov listed the file with 122 tracked, 33 covered and 12 partial line ( https://app.codecov.io/gh/KinNeko-De/restaurant-file-store-svc/commit/13fd235fc1849eff785a4b362d432062e78a4905/tree/internal/app/operation/logger ) Before I had 2 tracked, 2 covered, and 0 partial lines.

Environment (please complete the following information):

  • GitHub Actions upload action

To Reproduce Steps to reproduce the behavior:

  1. See https://app.codecov.io/gh/KinNeko-De/restaurant-file-store-svc/commit/13fd235fc1849eff785a4b362d432062e78a4905/blob/internal/app/operation/logger/logger.go
  2. See https://app.codecov.io/gh/KinNeko-De/restaurant-file-store-svc/commit/13fd235fc1849eff785a4b362d432062e78a4905/tree/internal/app/operation/logger

Expected behavior 2 tracked lines, 2 covered, 0 partial

Screenshots

Additional context

  1. I have fixed the issue renaming the file to 'mylogger.go' see https://app.codecov.io/gh/KinNeko-De/restaurant-file-store-svc/tree/feature%2Fcodecov2/internal%2Fapp%2Foperation%2Flogger
  2. Renaming the package to 'mylogger' and keeping 'logger.go' does not fix the issue. https://app.codecov.io/gh/KinNeko-De/restaurant-file-store-svc/tree/feature%2Fcodecov/internal%2Fapp%2Foperation%2Flogger
  3. The problem may somehow related to that a file in go.mongodb.org/mongodriver/internal/logger/logger.go exists. see https://storage.googleapis.com/codecov/v4/raw/2024-01-28/52FA2701666D41EF52E744CD2F9BAE39/13fd235fc1849eff785a4b362d432062e78a4905/76c97f5f-1d29-4564-a383-300d0a01dfff.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=GOOG1EJOGFN2JQ4OCTGA2MU5AEIT7OT5Z7HTFOAN2SPG4NWSN2UJYOY5U6LZQ%2F20240128%2FUS%2Fs3%2Faws4_request&X-Amz-Date=20240128T204708Z&X-Amz-Expires=30&X-Amz-SignedHeaders=host&X-Amz-Signature=cfe800a1fc4ac2340bdeb01bef1651f5deb42381fe437d0a27d091eefa6fac82

If something else is needed, I am happy to provide help. You have a great product :)

KinNeko-De avatar Jan 28 '24 21:01 KinNeko-De

For everyone else that has this problem: I added 'go.mongodb.org/mongo-driver/internal/logger/logger.go' to my .covignore file. That workaround enables me to keep my file name.

KinNeko-De avatar Mar 02 '24 19:03 KinNeko-De

@KinNeko-De I'm going to close this out for now as it seems like you have a fix. If this comes back up, please feel free to reopen.

thomasrockhu-codecov avatar May 28 '24 16:05 thomasrockhu-codecov