You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Bertrand Delacretaz <bd...@apache.org> on 2020/01/31 14:32:38 UTC

Build marked unstable due to Sonar, but it's there and green

Hi,

The build at [1] is marked unstable "due to missing SonarCloud
onboarding", but if I look in Sonar at [2] that module is there and
says "passed".

The Jenkins code at [3] outputs this "unstable" message regardless of
what fails in the Maven build, we might need to provide more details
there on what failed?

I suspect the issue might not be related to Sonar, maybe it's just
unstable tests - but my knowledge of this Sonar integration is almost
nil.

-Bertrand

[1] https://builds.apache.org/job/Sling/job/sling-org-apache-sling-launchpad-testing/job/master/556/console
[2] https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-launchpad-testing
[3] https://github.com/apache/sling-tooling-jenkins/blob/master/vars/slingOsgiBundleBuild.groovy#L55

Re: Build marked unstable due to Sonar, but it's there and green

Posted by Robert Munteanu <ro...@apache.org>.
Hi Betrand,

On Fri, 2020-01-31 at 15:37 +0100, Bertrand Delacretaz wrote:
> On Fri, Jan 31, 2020 at 3:32 PM Bertrand Delacretaz
> <bd...@apache.org> wrote:
> > ...The Jenkins code at [3] outputs this "unstable" message
> > regardless of
> > what fails in the Maven build, we might need to provide more
> > details
> > there on what failed?..
> 
> ...in the meantime I read [4] and apparently getting the Maven error
> details is problematic.
> 
> We might at least change the error message to say "Sonar or something
> else failed in the Maven build", and for this launchpad-testing
> module

+1

BTW, note that this particular build failed due to a timeout.

> I think we might also ignore Sonar as that module doesn't have any
> real code. But I'm not sure how to disable Sonar.

We could update the Sling module descriptor [5] to have a
'jenkins.sonarCloudEnabled' property and set it to false for the
modules we don't want to check using SonarCloud. I suspect we'll want
to check the majority of modules.

The change would have to be in [6], and would only create the code if
jobConfig.sonarCloudEnabled is true ( default value probably needs go
in [7] ).

Robert

> 
> -Bertrand
> 
> > [1] 
> > https://builds.apache.org/job/Sling/job/sling-org-apache-sling-launchpad-testing/job/master/556/console
> > [2] 
> > https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-launchpad-testing
> > [3] 
> > https://github.com/apache/sling-tooling-jenkins/blob/master/vars/slingOsgiBundleBuild.groovy#L55
> [4] 
> https://stackoverflow.com/questions/55742773/get-the-cause-of-a-maven-build-failure-inside-a-jenkins-pipeline/55744122
[5]: https://cwiki.apache.org/confluence/display/SLING/Sling+module+descriptor
[6]: https://github.com/apache/sling-tooling-jenkins/blob/9894be99cd9c28362536fae36ce29725786f4874/vars/slingOsgiBundleBuild.groovy#L37
[7]: https://github.com/apache/sling-tooling-jenkins/blob/9894be99cd9c28362536fae36ce29725786f4874/vars/slingOsgiBundleBuild.groovy#L5


Re: Build marked unstable due to Sonar, but it's there and green

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Fri, Jan 31, 2020 at 3:32 PM Bertrand Delacretaz
<bd...@apache.org> wrote:
> ...The Jenkins code at [3] outputs this "unstable" message regardless of
> what fails in the Maven build, we might need to provide more details
> there on what failed?..

...in the meantime I read [4] and apparently getting the Maven error
details is problematic.

We might at least change the error message to say "Sonar or something
else failed in the Maven build", and for this launchpad-testing module
I think we might also ignore Sonar as that module doesn't have any
real code. But I'm not sure how to disable Sonar.

-Bertrand

> [1] https://builds.apache.org/job/Sling/job/sling-org-apache-sling-launchpad-testing/job/master/556/console
> [2] https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-launchpad-testing
> [3] https://github.com/apache/sling-tooling-jenkins/blob/master/vars/slingOsgiBundleBuild.groovy#L55
[4] https://stackoverflow.com/questions/55742773/get-the-cause-of-a-maven-build-failure-inside-a-jenkins-pipeline/55744122

Re: Build marked unstable due to Sonar, but it's there and green

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi,

On Fri, Jan 31, 2020 at 3:32 PM Bertrand Delacretaz
<bd...@apache.org> wrote:
> The build at [1] is marked unstable "due to missing SonarCloud
> onboarding"...

FWIW, I have now changed [1] this potentially misleading message to
say ""Marking build unstable due to mvn sonar:sonar failing" as we
don't know the exact failure cause at that point.

-Bertrand

[1] https://github.com/apache/sling-tooling-jenkins/commit/86148295ff5c66e4842091b81daa89b6451ae703