Page MenuHomePhabricator

Make it easier to get to code health report in SonarQube from Gerrit
Closed, ResolvedPublicFeature

Description

Right now, from Gerrit, you have to click the link to the console output of the code health Jenkins job, then scroll through 50 pages of useless console output, then down at the very bottom you can click on the link to the actual report in SonarQube. Is there any way that we could link to the SonarQube report directly from Gerrit?

Event Timeline

kaldari renamed this task from Make it easier to get to code health report in SonarQube to Make it easier to get to code health report in SonarQube from Gerrit.May 15 2019, 7:08 PM
kaldari added a project: Gerrit.
hashar added a subscriber: kostajh.

We can tweak the URL for success and failures, there are plenty of examples in zuul/layout.yaml. That is done by adding a job rule and then setting success-pattern / failure-pattern. Example to force the full console output:

zuul/layout.yaml
- name: mediawiki-fresnel-patch-docker
  branch: master
  # Point to full output instead of default (tail-trimmed) output.
  # This is (oddly) to make the output visually shorter.
  # The reason the full output will be visually shorter is because nothing
  # will be partially cut off, and thus the collapsible sections work.
  #
  # Without this, you land in the middle of 100s of lines of unintersting output.
  #
  # With this, you land at collapsed sections, with right after that "Fresnel result"
  #
  # Format isn't documented AFAIK, but its code is here:
  # https://github.com/wikimedia/integration-zuul/blob/6ca76c5f84/zuul/model.py#L733-L753
  success-pattern: 'https://integration.wikimedia.org/ci/job/{job.name}/{build.number}/consoleFull'
  failure-pattern: 'https://integration.wikimedia.org/ci/job/{job.name}/{build.number}/consoleFull'

Change 510686 had a related patch set uploaded (by Kosta Harlan; owner: Kosta Harlan):
[integration/config@master] wip: Output link to SonarQube dashboard for success/failure

https://gerrit.wikimedia.org/r/510686

Change 510686 merged by jenkins-bot:
[integration/config@master] Output link to SonarQube dashboard for success/failure on patch

https://gerrit.wikimedia.org/r/510686

kostajh changed the subtype of this task from "Task" to "Feature Request".

Thanks for the nudge on this @kaldari, @hashar and I were able to get it working with https://gerrit.wikimedia.org/r/c/integration/config/+/512379

I've updated the blog post. You can see an example link directly to SonarQube here https://gerrit.wikimedia.org/r/c/mediawiki/extensions/GrowthExperiments/+/511333#message-21a009ab4c023850e46cfe46d580e0b6251da28d

kostajh claimed this task.