code-coverage-api-plugin
code-coverage-api-plugin copied to clipboard
Disambiguate GitHub Checks names when calling publishCoverage multiple times
Dependencies
Possibly Checks API 1.2.0, depending on the chosen solution.
Feature Request
Currently the Checks name published to GitHub is hard-coded to "Code Coverage":
https://github.com/jenkinsci/code-coverage-api-plugin/blob/43996142d125d9df156c6500f7f003ab50e3a42a/src/main/java/io/jenkins/plugins/coverage/CoverageChecksPublisher.java#L66
This would be fine if publishCoverage
were only ever called once in a given pipeline, but with the support for calling it multiple times (e.g., using a tag
to merge the results), each invocation overwrites any "Code Coverage" check(s) published previously.
The approach used by the JUnit plugin in https://github.com/jenkinsci/junit-plugin/pull/211 would be a good way to solve this by default. Additionally or instead, adding support for the withChecks
capability introduced in Checks API 1.2.0 would offer another possible solution.
Interested in providing a PR? I think nobody has the time to look at new features right now.