Updating Pipeline Code - Advice request

53 views
Skip to first unread message

Richard Bywater

unread,
Sep 9, 2017, 3:32:13 AM9/9/17
to jenkin...@googlegroups.com
Hi

I'm currently maintaining the HTML publisher plugin ( https://github.com/jenkinsci/htmlpublisher-plugin ) but unfortunately I'm not really up-to-speed on coding plugins for pipelines just yet. 

Whilst looking at a recent question regarding HTML Publisher & Pipelines, I came across the fact that AbstractStepImpl was being used by HTML Publisher but perhaps this is an old deprecated approach which isn't used anymore.

I took a look at https://github.com/jenkinsci/workflow-step-api-plugin#creating-a-basic-synchronous-step and figured that the new way was fairly different.

So, looking for advice as to whether I should be considering updating the code to use the new way of working or whether it's fine to keep with the existing implementation (I guess knowing what I'm missing out on my not updating would be useful).

Thanks
Richard.

Slide

unread,
Sep 9, 2017, 1:08:59 PM9/9/17
to jenkin...@googlegroups.com

I've found that the easiest entry to pipeline is implementing SimpleBuildStep and overriding the perform method that doesn't has a void return. You'll have to make sure you change things to use Run<?,?> Instead of something like AbstractBuild. If you haven't already, it would be beneficial to add a dependency on the structs plugin and add an @Symbol annotation to your descriptor. I'd be willing to help out if you need it.


--
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 jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAMui944Xw1aApRyoORYAuG5ttYkxLB0Bda5-6HKcgmEt4ZRRYg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Mark Waite

unread,
Sep 9, 2017, 1:22:59 PM9/9/17
to jenkin...@googlegroups.com
In case a simple reference case is useful, you're welcome to refer to the hello-world implementation that I extended with pipeline for Jenkins World 2017 [1].  It took a while to learn how to write the tests for it [2].


Jesse Glick

unread,
Sep 11, 2017, 10:42:40 AM9/11/17
to Jenkins Dev
On Sat, Sep 9, 2017 at 3:31 AM, Richard Bywater <ric...@byh2o.com> wrote:
> Whilst looking at a recent question regarding HTML Publisher & Pipelines, I
> came across the fact that AbstractStepImpl was being used by HTML Publisher
> but perhaps this is an old deprecated approach which isn't used anymore.

`AbstractStepImpl` continues to work. Migrating to the recommended
APIs is optional, though it should result in simpler and more
transparent code.
Reply all
Reply to author
Forward
0 new messages