Requesting feedback on upcoming pipeline compatible SonarQube plugin

88 views
Skip to first unread message

Julien HENRY

unread,
Sep 19, 2016, 5:27:27 AM9/19/16
to Jenkins Developers, Jenkins Users
Hi guys,

We worked last weeks on making the SonarQube Scanner for Jenkins (aka sonar-plugin) compatible with pipeline. Before doing a final release I'm requesting feedback both from end users and also from Jenkins developers.

My concern is that once the plugin will be released it will be hard to change the DSL, so speak now or forever hold your peace :)

Here is a link to the official announcement with more details:

For code reviewer:

Thanks!

Julien

Jesse Glick

unread,
Sep 19, 2016, 1:53:49 PM9/19/16
to Jenkins Dev
`SonarRunnerBuilder` as a `SimpleBuildStep` looks suspicious. Might
`executeSonarQubeScanner` take more than a few seconds to run? If so,
`SimpleBuildStep` is inappropriate; you need to use durable steps,
like `sh`. The same would apply to `AbstractMsBuildSQRunner`s. Unclear
to me why you are not using a build wrapper for the msbuild cases,
though I know nothing about the domain so I can only comment on
general aspects.

janos....@sonarsource.com

unread,
Sep 26, 2016, 10:08:32 AM9/26/16
to Jenkins Developers
Hi Jesse,

Thanks for the feedback. Yes, that step takes more than a few seconds, so we'll definitely look into your suggestion.

Is there a documentation on implementation using durable steps? I've read the DEVGUIDE a couple of times, but I don't recall mention of this. If there's a documentation I can reference, that would be great help.

Thanks,
Janos

Julien HENRY

unread,
Sep 26, 2016, 10:11:25 AM9/26/16
to Jenkins Developers
Hi Jesse,

Sorry for the late follow up, I missed your reply.

Le lundi 19 septembre 2016 19:53:49 UTC+2, Jesse Glick a écrit :
`SonarRunnerBuilder` as a `SimpleBuildStep` looks suspicious. Might
`executeSonarQubeScanner` take more than a few seconds to run?

Definitely.
 
If so,
`SimpleBuildStep` is inappropriate; you need to use durable steps,
like `sh`.

What is "durable step"? Our primary source of information was https://github.com/jenkinsci/pipeline-plugin/blob/master/DEVGUIDE.md and it is not mentioned. With Freestyle jobs we were previously using the Builder extension point, and according to the DEVGUIDE:

To add support for use of a Builder or Publisher from a pipeline, depend on Jenkins 1.577+, typically 1.580.1 (tips). Then implement SimpleBuildStep.

Do you have some pointers on this concept of durable step? Is it possible to migrate a Builder to a durable step?
 
The same would apply to `AbstractMsBuildSQRunner`s. Unclear
to me why you are not using a build wrapper for the msbuild cases,

This is something we were discussing internally but again we are migrating from a Builder. There is indeed a strong coupling between these 2 steps, but on the other side, all our documentation refers to these two distinct steps (begin / end). We think it would be easier for people to understand how to write a MSBuild pipeline if we keep the same naming.

Thanks,

Julien
 

Jesse Glick

unread,
Oct 3, 2016, 5:16:26 PM10/3/16
to Jenkins Dev
On Mon, Sep 26, 2016 at 10:11 AM, Julien HENRY
<julien...@sonarsource.com> wrote:
> What is "durable step"? Our primary source of information was
> https://github.com/jenkinsci/pipeline-plugin/blob/master/DEVGUIDE.md and it
> is not mentioned.

That links to

https://github.com/jenkinsci/workflow-step-api-plugin/blob/master/README.md

> Is it possible to
> migrate a Builder to a durable step?

No, they are conceptually incompatible.

https://github.com/jenkinsci/workflow-cps-plugin/pull/59 would provide
an easy way to provide something that looks like a first-class step,
complete with _Snippet Generator_ support, while internally calling
things like `sh` to launch any potentially long-running processes.

> all our documentation refers to these two distinct steps
> (begin / end). We think it would be easier for people to understand how to
> write a MSBuild pipeline if we keep the same naming.

Only if they were starting from a freestyle project, I think.
Reply all
Reply to author
Forward
0 new messages