Page MenuHomePhabricator

sonarcloud.io build failures reported but the results are not accessible
Closed, ResolvedPublic

Description

For example on https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1030575, I see:

Build failed.

However, the linked page only shown an error:

image.png (2×3 px, 228 KB)

If this is reporting some real problems, I would like to see the results.

If this is some experiment, I would like it to be disabled, as I find these bot comments disruptive.

(I don't know which tag to file this under.)

Event Timeline

thcipriani added subscribers: dancy, hashar, thcipriani.

When sonarcloud fails, it reports back to CI the following url:

https://sonarcloud.io/dashboard?id=mediawiki-core&branch={build.parameters[ZUUL_CHANGE]}-{build.parameters[ZUUL_PATCHSET]}&resolved=false

Defined in zuul/layout.yaml.

The problem here is that the job failed before it submitted anything to sonarcloud.io (see jenkins console output), so sonarcloud doesn't have anything to show you.


The actual failure is: T282893: Expected host directory /srv/jenkins/workspace/mwcore-codehealth-master-non-voting/cover to exist but it does not.

Which is from a recent CI change we made to work around T282893: Various CI jobs failing after "mkdir: cannot create directory ‘log’: Permission denied".


So two problems:

  1. If the job fails before submitting anything to sonarcloud, then there's nothing to see in sonar cloud.
  2. The mwcore-codehealth-{name} template in integration/config is mounting a cover directory that does not exist.

CC: @dancy @hashar

Change #1034138 had a related patch set uploaded (by Thcipriani; author: Thcipriani):

[integration/config@master] mwcore-codehealth: ensure cover directory exists

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

Change #1034138 merged by jenkins-bot:

[integration/config@master] mwcore-codehealth: ensure cover directory exists

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

Mentioned in SAL (#wikimedia-releng) [2024-05-20T19:31:28Z] <dancy> Updated Jenkins mwcore-codehealth-master-non-voting and mwcore-codehealth-patch jobs for https://gerrit.wikimedia.org/r/c/integration/config/+/1034138 (T365260)

dancy claimed this task.

check codehealth worked.

The problem here is that the job failed before it submitted anything to sonarcloud.io (see jenkins console output), so sonarcloud doesn't have anything to show you.

@ArielGlenn I don't think there is much we can do about this. I don't think it's possible to avoid posting a comment back on Gerrit if the job fails. If the syntax errors in the patch are fixed, the Sonarcloud link will work.

...

@ArielGlenn I don't think there is much we can do about this. I don't think it's possible to avoid posting a comment back on Gerrit if the job fails. If the syntax errors in the patch are fixed, the Sonarcloud link will work.

Admittedly this is perhaps my bad for not doing a simple php -l beforehand. But I will sometimes forget that, and I will sometimes push up a broken change. It would be nice if I could at least get told "hey try linting your stuff" instead of the generic 404 error.

...

@ArielGlenn I don't think there is much we can do about this. I don't think it's possible to avoid posting a comment back on Gerrit if the job fails. If the syntax errors in the patch are fixed, the Sonarcloud link will work.

Admittedly this is perhaps my bad for not doing a simple php -l beforehand. But I will sometimes forget that, and I will sometimes push up a broken change. It would be nice if I could at least get told "hey try linting your stuff" instead of the generic 404 error.

@pwangai maybe we could change the error message to something like "The patch was not checked with SonarQube, probably because of PHP linting errors" and also not show the URL to sonarcloud.io, since it doesn't work in that situation.

...

@ArielGlenn I don't think there is much we can do about this. I don't think it's possible to avoid posting a comment back on Gerrit if the job fails. If the syntax errors in the patch are fixed, the Sonarcloud link will work.

Admittedly this is perhaps my bad for not doing a simple php -l beforehand. But I will sometimes forget that, and I will sometimes push up a broken change. It would be nice if I could at least get told "hey try linting your stuff" instead of the generic 404 error.

@pwangai maybe we could change the error message to something like "The patch was not checked with SonarQube, probably because of PHP linting errors" and also not show the URL to sonarcloud.io, since it doesn't work in that situation.

@kostajh That is a good solution. I will upload a patch for review to fix that.

Change #1036288 had a related patch set uploaded (by Pwangai; author: Pwangai):

[integration/config@master] jjb: Change error message when codehealth build fails

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

Change #1036288 merged by jenkins-bot:

[integration/config@master] jjb: Change error message when codehealth build fails

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

pwangai claimed this task.

The generic 404 error fixed.