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.

Home Page:https://reportgenerator.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CLI argument to support custom naming of generated history files

Abi-Rai opened this issue · comments

commented

Hi! I absolutely love the tool.

This is a feature request for

  • Adding support for customising the name of the generated history file.
  • Being able to specify paths of files to include in historic data in reports.

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.

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.

commented

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?

Would the following pattern work for you:

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

commented

Yes! that would work.

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

commented

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

New version 5.2.2 is now available.

commented

Thank you!