danielpalme / ReportGenerator

ReportGenerator converts coverage reports generated by coverlet, OpenCover, dotCover, Visual Studio, NCover, Cobertura, JaCoCo, Clover, gcov or lcov into human readable reports in various formats.
https://reportgenerator.io
Apache License 2.0
2.59k stars 281 forks source link

Dynamic file lookup #414

Closed mgreisen closed 3 years ago

mgreisen commented 3 years ago

I have a situation where source files need to be dynamically retrieved when coverage is viewed for them. This is because the source tree is too large to make available all at one time.

Also it's possible that the source could come from different kinds of repositories.

Right now I'm thinking the ability to specify a REST API that gets invoked to get a file when someone wants to look at the coverage for a specific file would work.

Any chance this is currently supported or could be added?

danielpalme commented 3 years ago

This is not supported at the moment.

The typical workflow currently is (local machine or on a build server):

If this workflow would be changed to get the class file content dynamically, a couple of other problems have to be solved:

I guess it would be possibile to implement that feature, but it would not work for everyone / in every environment.

mgreisen commented 3 years ago

You are right that the scenario I have is not the typical scenario, this would not run in a build server context. What we are doing is fuzzing binaries and generating coverage data. The coverage data then needs processing with a tool like yours that can generate a report.

At the moment let's assume that the commit hash of the file is available, it would be up to the REST API function to retrieve the right version of the file. In this case a unique URL is not needed. The REST function can return the file contents after lookup. The REST function also will manage access to the source code base, as everyone who looks at the coverage data may not have access rights to the code.

I think your right that some JavaScript to do this would be required.

danielpalme commented 3 years ago

How should we move on with this? I'm really busy at the moment. Can you share a sample coverage file which you want be able to process? A file with 1 or 2 classes should be enough.

mgreisen commented 3 years ago

Let's hold off for now until we get further down our design process. I appreciate your willingness to work with us on this.

danielpalme commented 3 years ago

I'm closing this for now. Feel free to reopen once it becomes relevant.

mgreisen commented 3 years ago

Thanks. I'll do that.