[Risk Hotspots] Break build when risk hotspot threshold is not met #731
-
Hi everyone, I've recently integrated ReportGenerator within our pipelines and it's working perfectly. Initially I was using the minimum coverage threshold settings to block the pipeline in case the thresholds were not met, but afterwards I moved that validation to the BuildQualityCheck as I also wanted to ensure warning-free code. Now I've noticed that the pipeline is not blocked whenever the risk hotspot thresholds are not met. It was using the defaults, but I also added them to the custom settings just to make sure - it still does not block the pipeline, even though it shows as red in the report.
I'm wondering if ReportGenerator actually breaks the build in case the risk hotspots thresholds are not met and in that case I might be missing something in the configuration above, or it just does that on the coverage. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
@dfspinto Currently there are only options to break when one of the coverage metrics is below a threshold: But I think that's a good idea. I will consider this in the next release! |
Beta Was this translation helpful? Give feedback.
-
@dfspinto The previously existing settings specified minimum values. The new settings are maximum thresholds. |
Beta Was this translation helpful? Give feedback.
-
Hi @danielpalme, Thanks a lot for considering and releasing it pretty fast.
It would be perfect to propagate the info message, which describes why the generator fails, to the pipeline using |
Beta Was this translation helpful? Give feedback.
-
Correct, I don't propagate messages anywhere else. Maybe I can change that in a future release. |
Beta Was this translation helpful? Give feedback.
@dfspinto
ReportGenerator 5.4.7 now has some new settings regarding risk hotspots:
https://github.com/danielpalme/ReportGenerator/wiki/Settings#risk-hotspots
The previously existing settings specified minimum values.
Metrics exceeding the minimum are considered as risk hotspots.
The new settings are maximum thresholds.
If any risk hotspot is greater than this threshold, ReportGenerator will exit unsuccessfully.