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.65k stars 283 forks source link

CLI argument to support custom naming of generated history files #651

Closed Abi-Rai closed 9 months ago

Abi-Rai commented 9 months ago

Hi! I absolutely love the tool.

This is a feature request for

The use case is the ability to have a specific folder where the reports collect/store historic data for the report and be able to add that folder to .gitignore so that most locally generated historic files are not tracked, but historic files generated in pipelines would be tracked by using glob patterns.

danielpalme commented 9 months ago

Hi @Abi-Rai

is it really necessary to customize the name of the history files. They have the following name pattern: 2014-02-13_21-53-06_CoverageHistory.xml

I would suggest you use a different directory for the history files in your pipeline. E.g. -historydir:pipelinehistory

Does that for work for you? I'm always trying to avoid new command line parameters. If I would add every requested parameter, the list would be become very long and nobody has the time to look through all the parameters.

Abi-Rai commented 9 months ago

Wow, thank you for the quick response.

If I would add every requested parameter, the list would be become very long and nobody has the time to look through all the parameters.

Funnily enough my goal was to create a predefined command and distribute it to my team (devs/non-devs) to run as part of their workflow, and I would create a pipeline step that would generate reports that we actually want to keep a history of. And with a preconfigured command they wouldn't need to spend time learning ReportGenerator's commands and could just focus on using the generated report.

I would suggest you use a different directory for the history files in your pipeline. E.g. -historydir:pipelinehistory

With this approach, each time a report is generated with historyDir and if we want to include our local reports to be compared with the pipeline history files historydir:pipelinehistory then the user would have remember to manually delete the file to prevent pushing local history files to the repo.

Perhaps having an argument that disables generation of history files and historyDir would only read the files in the folder would be simpler?

danielpalme commented 9 months ago

Would the following pattern work for you:

2014-02-13_21-53-06_YOURCUSTOMTEXT_CoverageHistory.xml

Abi-Rai commented 9 months ago

Yes! that would work.

danielpalme commented 9 months ago

Just made the necessary changes in the code base to support that pattern. The next release will contain this new feature.

You will be able to apple the custom text with the following command line parameter: "settings:HistoryFileNamePrefix=YOURCUSTOMTEXT"

See also: https://github.com/danielpalme/ReportGenerator/wiki/Settings

Abi-Rai commented 9 months ago

Thank you, especially for pushing it out so quick, not to mention on the same day the issue was raised!

danielpalme commented 9 months ago

New version 5.2.2 is now available.

Abi-Rai commented 9 months ago

Thank you!