-
Notifications
You must be signed in to change notification settings - Fork 76
Add Modified Files Coverage and Checks Publisher #556
Add Modified Files Coverage and Checks Publisher #556
Conversation
…e-coverage-api-plugin into file-change-coverage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will continue the review tomorrow with the checks publisher and the tests...
plugin/src/main/java/io/jenkins/plugins/coverage/metrics/model/ElementFormatter.java
Outdated
Show resolved
Hide resolved
plugin/src/main/java/io/jenkins/plugins/coverage/metrics/model/ElementFormatter.java
Outdated
Show resolved
Hide resolved
plugin/src/main/java/io/jenkins/plugins/coverage/metrics/model/ElementFormatter.java
Show resolved
Hide resolved
plugin/src/main/java/io/jenkins/plugins/coverage/metrics/source/SourceCodeFacade.java
Outdated
Show resolved
Hide resolved
plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageBuildAction.java
Show resolved
Hide resolved
plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageViewModel.java
Outdated
Show resolved
Hide resolved
plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/ModifiedFilesCoverageTable.java
Outdated
Show resolved
Hide resolved
plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/ModifiedFilesCoverageTable.java
Outdated
Show resolved
Hide resolved
plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/ModifiedFilesCoverageTable.java
Outdated
Show resolved
Hide resolved
plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageViewModel.java
Show resolved
Hide resolved
* value to ensure that the coverage of pull requests is better than the whole project coverage. | ||
*/ | ||
MODIFIED_FILES_DELTA(Messages._Baseline_MODIFIED_FILES_DELTA(), "fileCoverage", CoverageChangeTendency::getDisplayColorsForTendency), | ||
MODIFIED_FILES_DELTA(Messages._Baseline_MODIFIED_FILES_DELTA(), "modifiedFilesCoverage", CoverageChangeTendency::getDisplayColorsForTendency), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While looking at the results I think I made a mistake here. When I am developing a PR normally I am interested in the coverage of my changes.
That means we need the totals (this is already working correctly):
- coverage overall project
- changed files
- changed lines
But when looking at the delta we need:
- delta overall project - delta overall reference (typically not interesting for large projects)
- delta changed files - delta changed files reference (how is the coverage of the changed files affected)? Currently we check how it changes with respect to the overall coverage.
- delta changed lines: here I am not sure whether it makes more sense to compare vs. the whole project or the changed files. What do you think? Or do we need both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that makes sense.
Regarding the delta changed lines: I guess we should compare only against the modified files coverage. The whole project has modules with higher and with lower coverage. When we compare the changes of a module with lower coverage against the whole project, there will be a negative trend, even if the modified files are covered quiet good compared to the rest of their module. Therefore, comparing against the changed files would keep the context hence it more accurate, in my opinion.
plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageChecksPublisher.java
Outdated
Show resolved
Hide resolved
plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageChecksPublisher.java
Outdated
Show resolved
Hide resolved
I finally managed it to publish a check: https://github.com/uhafner/codingstyle/pull/716/checks?check_run_id=11653892776 |
While trying to fix the display of the changes table I am wondering what information we should show actually? There are several ways:
|
# Conflicts: # plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageReporter.java # plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageViewModel.java # plugin/src/test/java/io/jenkins/plugins/coverage/metrics/steps/GitForensicsITest.java
Yes, we should do that. n/a only distracts from what is important.
I suggest the second option - that sounds good. By default, we should show only the changed files in my opinion, since most of the time, that's what is interesting - like it is in the screenshot. |
plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageChecksPublisher.java
Outdated
Show resolved
Hide resolved
- lines covered or not - partially covered lines - lines with survived mutations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the PR is now ready to be integrated. I'll track the remaining tasks in #512.
I added Modified Files Coverage support and a new Coverage Checks Publisher including tests for it.
Also, I renamed "Change Coverage" to "Modified Lines Coverage".
Example layout for the Checks Overview:
