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

[TCE-1009] Allow uploading Codacy native coverage report #506

Open
mrazauskas opened this issue Jun 13, 2024 · 3 comments
Open

[TCE-1009] Allow uploading Codacy native coverage report #506

mrazauskas opened this issue Jun 13, 2024 · 3 comments
Labels
jira-issue Issue tracked on JIRA

Comments

@mrazauskas
Copy link

This is a feature request. Would it be possible to allow uploading Codacy native coverage report file directly instead of parsing it from lcov or similar? (That would be JSON file with CoverageReportFile or similar object.)

Real world use case

monocart-coverage-reports is a new tool which generates coverage reports for JavaScript. It processes native V8 reports directly instead of converting them to Istanbul or so. They create coverage data object for each file, with lines map of the following shape:

{
  "1": 1,
  "3": 1,
  "10": 5,
  "35": 1,
}

This means that lcov is a redundant intermediate format and it would be trivial to provide native coverage report file for Codacy. Which means increase of performance and precision.

Example

Codecov supports uploading reports in their native format: https://docs.codecov.com/docs/codecov-custom-coverage-format. And here is how monocart generates it: https://github.com/cenfun/monocart-coverage-reports/blob/5dbff72f1cc4e41d6d77f01e7ac54058ce92aa01/lib/generate.js#L263-L283

That’s straight forward solution. Much more simple than encoding and decoding lcov.

@github-actions github-actions bot added the jira-issue Issue tracked on JIRA label Jun 13, 2024
@github-actions github-actions bot changed the title Allow uploading Codacy native coverage report [TCE-1009] Allow uploading Codacy native coverage report Jun 13, 2024
Copy link

Internal ticket created : TCE-1009

@mrazauskas
Copy link
Author

The latest version of monocart-coverage-reports shipped with builtin Codacy native coverage reporter. See the release notes: https://github.com/cenfun/monocart-coverage-reports/releases/tag/2.8.7

In one project I am using the reporter and I am uploading the report via the api endpoint. Here is the script: https://github.com/tstyche/tstyche/blob/main/scripts/upload-coverage.js

All works fine. Only problem is that I have to copy the script to each of my projects. Or I could publish it as an npm package or GitHub Action. Actually codacy-coverage-reporter can do this job (and already is doing it internally!). So that feels like unnecessary duplication.

Do you consider making it possible to upload Codacy native coverage reports?

@mrazauskas
Copy link
Author

@mrfyda Friendly ping.

This feature is still interesting for me. Since July I use a script to upload Codacy native coverage report. It works just fine, but this solution does not scale. I mean, copy-pasting the script to every repo is clumsy. Native implementation would be very very helpful (;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira-issue Issue tracked on JIRA
Projects
None yet
Development

No branches or pull requests

1 participant