jenkinsci / code-coverage-api-plugin

Deprecated Jenkins Code Coverage Plugin
https://plugins.jenkins.io/code-coverage-api/
MIT License
111 stars 77 forks source link

Remote API to connect additional code review tools #737

Closed fo-code closed 11 months ago

fo-code commented 1 year ago

Adds a REST API that provides the coverage information of modified lines for each modified file - see #731 .

codecov[bot] commented 1 year ago

Codecov Report

Merging #737 (04dfec4) into master (2ef24aa) will increase coverage by 0.39%. Report is 15 commits behind head on master. The diff coverage is 97.87%.

@@             Coverage Diff              @@
##             master     #737      +/-   ##
============================================
+ Coverage     74.08%   74.47%   +0.39%     
- Complexity     1698     1749      +51     
============================================
  Files           130      135       +5     
  Lines          6289     6393     +104     
  Branches        677      690      +13     
============================================
+ Hits           4659     4761     +102     
- Misses         1407     1408       +1     
- Partials        223      224       +1     
Files Coverage Δ
.../plugins/coverage/metrics/restapi/CoverageApi.java 100.00% <100.00%> (ø)
...overage/metrics/restapi/FileWithModifiedLines.java 100.00% <100.00%> (ø)
...ins/coverage/metrics/restapi/LineCoverageType.java 100.00% <100.00%> (ø)
...s/coverage/metrics/restapi/ModifiedLinesBlock.java 100.00% <100.00%> (ø)
...rage/metrics/restapi/ModifiedLinesCoverageApi.java 100.00% <100.00%> (ø)
...metrics/restapi/ModifiedLinesCoverageApiModel.java 83.33% <83.33%> (ø)
...gins/coverage/metrics/steps/CoverageViewModel.java 54.13% <66.66%> (-0.07%) :arrow_down:

... and 6 files with indirect coverage changes

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

fo-code commented 1 year ago

@uhafner Nonetheless there are still a few tasks to do, the API now is in a final state. What is your opinion on this? I would like to wait with merging until we have your confirmation. :)

fo-code commented 11 months ago

@uhafner I extended the GitForensicsITest with a call to the new API to verify the resulting JSON. I added that in that test class since it offers a special setup where modified code lines as well as related coverage data is provided. Both is required for a decent test scenario here. Also, I finished the implementation and added a description of the new API to the README.

From my side we can merge this PR, if you don't have any further suggestions.

fo-code commented 11 months ago

@uhafner I reworked the implementation and included your comments. Now everything works like discussed and is also tested.

The only problem is there are test failures regarding docker images and I think they are not caused by this pull request, so I do not know how to fix it.

uhafner commented 11 months ago

I am rerunning the checks and will merge if everything is back to green...