Granularity of pipeline steps

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Granularity of pipeline steps

Ulli Hafner
I’m currently implementing a better pipeline support for the static analysis plug-ins (see [1]).
From the documentation of Step it is not clear to me, when to implement a Step or when to use a method on a returned object. So basically, is a procedural or object oriented approach desired?

E.g, in a freestyle project the warnings publisher does the following things (among others):
1) parse files for warnings
2) copy files to build folder for future reference
3) compute difference (new, old, fixed warnings) with regard to a reference build
4) blame authors of warnings
5) publish warnings as persistent Action

So my question is: is everything a step? Or should e.g. step 1 (parse warnings) return an object that has some methods, e.g. to copy the files (2) to the build folder?

When I implement everything as Step then the list of available steps will grow very fast (name clashes will be also very probable)

Are there some recommendations or is this decision up to the plugin author?

[1] https://wiki.jenkins.io/display/JENKINS/Static+Analysis+in+Pipelines


--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/9E4A672A-2BE5-4352-AFF2-0298751EA7CE%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

signature.asc (506 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Granularity of pipeline steps

Jenkins dev mailing list
Hi,

It looks like a lot of the problems are linked to:
https://issues.jenkins-ci.org/browse/JENKINS-28119,Link to log of failed step
https://issues.jenkins-ci.org/browse/JENKINS-38381, Optimize log handling in Pipeline and Durable Task
https://issues.jenkins-ci.org/browse/JENKINS-26522, Annotated block/stage status

Björn

Am Montag, 24. Juli 2017 22:55:53 UTC+2 schrieb Ullrich Hafner:
I’m currently implementing a better pipeline support for the static analysis plug-ins (see [1]).
From the documentation of Step it is not clear to me, when to implement a Step or when to use a method on a returned object. So basically, is a procedural or object oriented approach desired?

E.g, in a freestyle project the warnings publisher does the following things (among others):
1) parse files for warnings
2) copy files to build folder for future reference
3) compute difference (new, old, fixed warnings) with regard to a reference build
4) blame authors of warnings
5) publish warnings as persistent Action

So my question is: is everything a step? Or should e.g. step 1 (parse warnings) return an object that has some methods, e.g. to copy the files (2) to the build folder?

When I implement everything as Step then the list of available steps will grow very fast (name clashes will be also very probable)

Are there some recommendations or is this decision up to the plugin author?

[1] <a href="https://wiki.jenkins.io/display/JENKINS/Static+Analysis+in+Pipelines" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdisplay%2FJENKINS%2FStatic%2BAnalysis%2Bin%2BPipelines\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEL5xfsVGlGQJ6KHSxp42vHHcWHCA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdisplay%2FJENKINS%2FStatic%2BAnalysis%2Bin%2BPipelines\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEL5xfsVGlGQJ6KHSxp42vHHcWHCA&#39;;return true;">https://wiki.jenkins.io/display/JENKINS/Static+Analysis+in+Pipelines


--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/08472d05-1b2f-4d85-ae9c-2b949c3f131e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Granularity of pipeline steps

Jesse Glick-4
In reply to this post by Ulli Hafner
On Mon, Jul 24, 2017 at 4:55 PM, Ullrich Hafner
<[hidden email]> wrote:
> in a freestyle project the warnings publisher does the following things (among others):
> 1) parse files for warnings
> 2) copy files to build folder for future reference
> 3) compute difference (new, old, fixed warnings) with regard to a reference build
> 4) blame authors of warnings
> 5) publish warnings as persistent Action
>
> So my question is: is everything a step?

With the possible exception of #4, all of these sound like they should
be part of a single `Step`. (Or if the freestyle version can
reasonably be factored into a `SimpleBuildStep`, there is no need for
a `workflow-step-api` dependency at all.) Compare
`JUnitResultArchiver`.

If you do need to break functionality apart in order to offer greater
flexibility, just provide multiple steps. OO style is not well
supported.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr36XfAy%2BBwgJMP3fwSntyCx425aTnrzMmFPtJ5e3zXPdg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.