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

Globs not supported in v2? #770

Closed
dyladan opened this issue Jun 24, 2022 · 15 comments · May be fixed by #1524
Closed

Globs not supported in v2? #770

dyladan opened this issue Jun 24, 2022 · 15 comments · May be fixed by #1524

Comments

@dyladan
Copy link

dyladan commented Jun 24, 2022

A lerna monorepo consists of many packages in a single git repository. They are typically each in a folder in the packages/ directory. After my tests run, coverage reports are generated in the ./coverage folder of each subproject.

packages/package-1/coverage
packages/package-2/coverage
...

I am attempting to upload coverage for lerna monorepo using the following configuration:

      - name: Report Coverage
        uses: codecov/codecov-action@v2
        with:
          file: ./packages/*/coverage/*.json

But no coverage files are found. Full log output:

Run codecov/codecov-action@v2
==> linux OS detected
https://uploader.codecov.io/latest/linux/codecov.SHA25[6](https://github.com/open-telemetry/opentelemetry-js/runs/7030918438?check_suite_focus=true#step:9:7)SUM
==> SHASUM file signed by key id 806bb28aed[7](https://github.com/open-telemetry/opentelemetry-js/runs/7030918438?check_suite_focus=true#step:9:8)79[8](https://github.com/open-telemetry/opentelemetry-js/runs/7030918438?check_suite_focus=true#step:9:9)6[9](https://github.com/open-telemetry/opentelemetry-js/runs/7030918438?check_suite_focus=true#step:9:10)
==> Uploader SHASUM verified (432553f03714a83ab5cac78be2e7fe6a6050767f78f77e9c7a84bdb1c34a0bd3  codecov)
==> Running version latest
==> Running version v0.2.4
/home/runner/work/_actions/codecov/codecov-action/v2/dist/codecov -n  -Q github-action-2.1.0 -f ./packages/*/coverage/*.json -C 413ad93886a715283ebd[11](https://github.com/open-telemetry/opentelemetry-js/runs/7030918438?check_suite_focus=true#step:9:12)11ce83e4c22b17d4d9
[2022-06-23T20:04:53.433Z] ['info'] 
     _____          _
    / ____|        | |
   | |     ___   __| | ___  ___ _____   __
   | |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
   | |___| (_) | (_| |  __/ (_| (_) \ V /
    \_____\___/ \__,_|\___|\___\___/ \_/
  Codecov report uploader 0.2.4
[[20](https://github.com/open-telemetry/opentelemetry-js/runs/7030918438?check_suite_focus=true#step:9:21)[22](https://github.com/open-telemetry/opentelemetry-js/runs/7030918438?check_suite_focus=true#step:9:23)-06-[23](https://github.com/open-telemetry/opentelemetry-js/runs/7030918438?check_suite_focus=true#step:9:24)T20:04:53.440Z] ['info'] => Project root located at: /home/runner/work/opentelemetry-js/opentelemetry-js
[2022-06-23T20:04:53.443Z] ['info'] -> No token specified or token is empty
[2022-06-23T20:04:53.451Z] ['info'] Searching for coverage files...
[2022-06-23T20:04:53.582Z] ['error'] None of the following appear to exist as files: ./packages/*/coverage/*.json
[2022-06-23T20:04:53.583Z] ['error'] There was an error running the uploader: Error while cleaning paths. No paths matched existing files!
@ssbarnea
Copy link

The current version is v3 and they did not bother to reply or to mention in docs if glob patterns are allowed.

@lefou
Copy link

lefou commented Nov 30, 2022

From personal experiments, globs aren't supported in v3.

@ssbarnea
Copy link

ssbarnea commented Dec 1, 2022

@thomasrockhu Any chance to get a pair of eyes on this one. Forcing people to use only hard-coded file paths instead of being able to use glob patterns for the files to be collected is a huge regression.

@thomasrockhu-codecov
Copy link
Contributor

@dyladan @ssbarnea ok, I made some changes here to how we handle globs. I would recommend trying ** for dirs as opposed to *, but I have to be honest, I'm not sure if it'll work.

I'm going to push towards our community boards because I check that more frequently. If the above doesn't work, please ping me there and I'll do what I can to fix it.

@lefou
Copy link

lefou commented Apr 25, 2023

@thomasrockhu-codecov This issue is still present. Your suggested ** glob does not work. Please reopen the issue.


==> linux OS detected
https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
==> SHASUM file signed by key id 806bb28aed779869
==> Uploader SHASUM verified (02b055414cc124203ab061ffc45f5497ca39ede5e63a06717a6981c32d7b425f  codecov)
==> Running version latest
==> Running version v0.5.0
/home/runner/work/_actions/codecov/codecov-action/v3/dist/codecov -n  -Q github-action-3.1.3 -f ./out/**/scoverage/xmlReport.dest/scoverage.xml -C 08e0d7031ca1c86d39fbafcee9e409d5731052a2
[2023-04-25T09:52:06.087Z] ['info'] 
     _____          _
    / ____|        | |
   | |     ___   __| | ___  ___ _____   __
   | |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
   | |___| (_) | (_| |  __/ (_| (_) \ V /
    \_____\___/ \__,_|\___|\___\___/ \_/

  Codecov report uploader 0.5.0
[2023-04-25T09:52:06.096Z] ['info'] => Project root located at: /home/runner/work/mill-kotlin/mill-kotlin
[2023-04-25T09:52:06.098Z] ['info'] -> No token specified or token is empty
[2023-04-25T09:52:06.106Z] ['info'] Searching for coverage files...
[2023-04-25T09:52:06.242Z] ['error'] None of the following appear to exist as files: ./out/**/scoverage/xmlReport.dest/scoverage.xml
[2023-04-25T09:52:06.242Z] ['error'] There was an error running the uploader: Error while cleaning paths. No paths matched existing files!

When the files are specified explicitly, the logs looks like this:

/home/runner/work/_actions/codecov/codecov-action/v3/dist/codecov -n  -Q github-action-3.1.3 -f ./out/api/0.11.0-M8/scoverage/xmlReport.dest/scoverage.xml -f ./out/api/0.10/scoverage/xmlReport.dest/scoverage.xml -f ./out/api/0.9/scoverage/xmlReport.dest/scoverage.xml -f ./out/api/0.7/scoverage/xmlReport.dest/scoverage.xml -f ./out/worker/0.11.0-M8/scoverage/xmlReport.dest/scoverage.xml -f ./out/worker/0.10/scoverage/xmlReport.dest/scoverage.xml -f ./out/worker/0.9/scoverage/xmlReport.dest/scoverage.xml -f ./out/worker/0.7/scoverage/xmlReport.dest/scoverage.xml -f ./out/main/0.11.0-M8/scoverage/xmlReport.dest/scoverage.xml -f ./out/main/0.10/scoverage/xmlReport.dest/scoverage.xml -f ./out/main/0.9/scoverage/xmlReport.dest/scoverage.xml -f ./out/main/0.7/scoverage/xmlReport.dest/scoverage.xml -C 314ee8ad69155e80b7d4acba94553986bb747e5f

I also couldn't find any glob related change in the release notes or merged pull request list. Where did you made your "changes"?

@lishaduck
Copy link

For people coming here from Google, you can use files as opposed to file to get globs.

@lefou
Copy link

lefou commented Jul 24, 2024

@lishaduck Can you please point to the respective documentation?

I mean, it would be nice to see at least one working example using globs. It should then be added to the documentation. (FTR, I already use files, but it does not work with globs.)

@lefou
Copy link

lefou commented Jul 24, 2024

@lishaduck Thank you! I need to try it again, then. If it works now, it must be rather newish, since I definitely tried a single * glob before without success.

@lefou
Copy link

lefou commented Jul 24, 2024

I think globs still don't work. But since no valid files where given, the action falls back to file search, which probably works for you.

Here is part of your log:

warning - 2024-07-24 01:15:09,476 -- Some files were not found --- {"not_found_files": ["packages/*/coverage/lcov.info"]}
info - 2024-07-24 01:15:09,488 -- Found 1 coverage files to report
info - 2024-07-24 01:15:09,488 -- > /home/runner/work/our_democracy/our_democracy/packages/app/coverage/lcov.info

And here is my log:

warning - 2024-07-24 22:07:05,283 -- Some files were not found --- {"not_found_files": ["out/api/*/scoverage/xmlReport.dest/scoverage.xml", "out/worker/*/scoverage/xmlReport.dest/scoverage.xml", "out/main/*/scoverage/xmlReport.dest/scoverage.xml"]}
info - 2024-07-24 22:07:05,329 -- Found 66 coverage files to report
info - 2024-07-24 22:07:05,330 -- > /home/runner/work/mill-kotlin/mill-kotlin/out/main/0.9/worker/scoverage/xmlReport.dest/scoverage.xml
info - 2024-07-24 22:07:05,330 -- > /home/runner/work/mill-kotlin/mill-kotlin/out/main/0.10/scoverageReportWorkerClasspath.json
info - 2024-07-24 22:07:05,330 -- > /home/runner/work/mill-kotlin/mill-kotlin/out/main/0.11/scoveragePluginDeps.json
info - 2024-07-24 22:07:05,330 -- > /home/runner/work/mill-kotlin/mill-kotlin/out/main/0.11/worker/scoverageToolsClasspath.json
...

The files list containing names with * globs result in files not found. Instead, it's searching and collecting files by file extension. It upload a whole lot of unrelated files, which leaks way to much data. What a mess.

@lishaduck
Copy link

lishaduck commented Jul 25, 2024

I think globs still don't work. But since no valid files where given, the action falls back to file search, which probably works for you.

Ah, I didn't know it did that.

Here is part of your log:

warning - 2024-07-24 01:15:09,476 -- Some files were not found --- {"not_found_files": ["packages/*/coverage/lcov.info"]}
info - 2024-07-24 01:15:09,488 -- Found 1 coverage files to report
info - 2024-07-24 01:15:09,488 -- > /home/runner/work/our_democracy/our_democracy/packages/app/coverage/lcov.info

And here is my log:

warning - 2024-07-24 22:07:05,283 -- Some files were not found --- {"not_found_files": ["out/api/*/scoverage/xmlReport.dest/scoverage.xml", "out/worker/*/scoverage/xmlReport.dest/scoverage.xml", "out/main/*/scoverage/xmlReport.dest/scoverage.xml"]}
info - 2024-07-24 22:07:05,329 -- Found 66 coverage files to report
info - 2024-07-24 22:07:05,330 -- > /home/runner/work/mill-kotlin/mill-kotlin/out/main/0.9/worker/scoverage/xmlReport.dest/scoverage.xml
info - 2024-07-24 22:07:05,330 -- > /home/runner/work/mill-kotlin/mill-kotlin/out/main/0.10/scoverageReportWorkerClasspath.json
info - 2024-07-24 22:07:05,330 -- > /home/runner/work/mill-kotlin/mill-kotlin/out/main/0.11/scoveragePluginDeps.json
info - 2024-07-24 22:07:05,330 -- > /home/runner/work/mill-kotlin/mill-kotlin/out/main/0.11/worker/scoverageToolsClasspath.json
...

The files list containing names with * globs result in files not found. Instead, it's searching and collecting files by file extension. It upload a whole lot of unrelated files, which leaks way to much data. What a mess.

That's a really silly default. Well, back to manually writing them, I guess 😢
Though, this is open source. It's probably just a call to globby to fix it, right? I'll take a look.
EDIT: doesn't look to bad. I'll send in a PR soonish.

@lishaduck
Copy link

@lefou: #1524

@glen-84
Copy link

glen-84 commented Sep 10, 2024

@thomasrockhu-codecov Please reopen this issue.

@glen-84
Copy link

glen-84 commented Sep 20, 2024

@joseph-sentry Can you please reopen this issue?

@glen-84
Copy link

glen-84 commented Sep 29, 2024

#1582

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants