My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 3538: Add REST API to support color coding reviews and adding tooltips to present code-coverage information
18 people starred this issue and may be notified of changes. Back to list
Status:  New
Owner:  ----


Sign in to add a comment
 
Reported by oyvindha...@gmail.com, Aug 28, 2015
Color coding + tooltips would be useful for inserting information about code-coverage in a review.

Perhaps it would be better to add an explicit code-coverage REST API and leave the actual representation to Gerrit? Gerrit could then innovate w.r.t. representation of code-coverage.

See discussion in repo-discuss:

https://groups.google.com/forum/#!topic/repo-discuss/XpJMfa1RTAA

Here's a presentation from Google on how they are doing this sort of thing:

http://googletesting.blogspot.co.uk/2014/07/measuring-coverage-at-google.html

A presentation that explains how google uses it:

https://www.youtube.com/watch?v=4bublRBCLVQ
Aug 28, 2015
#1 nick.talbot@gmail.com
To clarify a little further, we are looking to post data very similar to comments. We already use the REST API to post comments from SonarQube analysis. For code coverage, instead of ['file', 'line', 'message'], it would be something like ['file', 'line', 'status' (COVERED/NOT_COVERED), 'branches_covered', 'branch_count']. We already have JaCoCo code coverage recorded for all unit, integration and system tests across multiple target platforms so can easily generate the data.

This gives enough data to visualise coverage in Gerrit similar to what you get with a JaCoCo/EclEmma HTML reports which gives green=full coverage, yellow=partial coverage, red=no coverage. Where branch_count > 0 add a tooltip to the line, e.g. "1 of 2 branches covered".
Nov 17, 2015
#3 remy.mas...@ullink.com
That would be awesome!

Gerrit is already a great review tool. Integrating it with known quality tools like sonar enhance it further, which is already possible for violations for example.

Code coverage is even more helpful than violations - having it available at review time would be great.
Nov 18, 2015
#4 remy.mas...@ullink.com
Has anybody already started working on a patch that would make this possible?
Dec 14, 2015
Project Member #5 david.pu...@sonymobile.com
 Issue 2478  has been merged into this issue.
Dec 17, 2015
#6 sschuberth
Looks like there's a plugin for that now: https://github.com/Ullink/gerrit-coverage-plugin
Dec 17, 2015
#7 haffax
@sschuberth The plugin does not actually render coverage information in the diff screen. The screenshot is just a sketch of how it is supposed to work, if it actually worked.

Looking at the plugin source code, all it currently does is adding REST endpoints to attach and read per change coverage information.

This issue remains valid.
Dec 17, 2015
#8 sschuberth
@haffax I was assuming the screenshot to be real and that it actually *does* work, but only with the mentioned fork of Gerrit 2.11. Which in turn would mean the changes are probably ready and just pending review for integration with upstream.
Dec 17, 2015
#9 francois...@gmail.com
The screenshot is real, but to actually get it you need a couple of things more than this plugin:

1. need to be able to extend gerrit diff UI with gutter coloring
-> was hacked into 2.11 branch (no GWT extension point available in that branch)
-> should/could be pushed to master as a GWT extension point (currently in discussion)

2. need to upload coverage when building the patchset
-> was achieved for us by modifying gerrit plugin for Sonar: https://github.com/tech-advantage/sonar-gerrit-plugin/
-> works for all languages supported by sonar, tested on java/C#
-> could be achieved by other means for other ppl/lang

Fork for #1 (2.11) is here: https://github.com/muryoh/gerrit/tree/v2.11.5-coverage

Fork for #2 is here: https://github.com/muryoh/sonar-gerrit-plugin/tree/v2.2.2.1-coverage (will become an official PR once the requirements are merged into gerrit)

None of this is my work but I'm supporting @muryoh, because we benefit highly from this.
Sign in to add a comment

Powered by Google Project Hosting