Why do some plugins/classes not show up in the Pipeline Syntax snippet generator?

122 views
Skip to first unread message

red 888

unread,
Aug 20, 2017, 1:00:00 PM8/20/17
to Jenkins Users
I noticed the xunit plugin and wscleanup don't appear in the Sample Step drop down of the snippet generator.

This is how I use them in my jenkinsfile:

step([$class: 'WsCleanup'])

step([$class : 'XUnitPublisher',
    testTimeMargin: '3000',
    thresholdMode: 1,
    thresholds: [
        [$class: 'FailedThreshold', failureNewThreshold: '', failureThreshold:'2', unstableNewThreshold: '', unstableThreshold: '']
    ],
    tools : [[$class: 'MSTestJunitHudsonTestType',
        deleteOutputFiles: true,
        failIfNotNew: false,
        pattern: "\\TestResults\\*.trx",
        skipNoTestFiles: false,
        stopProcessingIfError: true
    ]]
])

Does this have something to do with the fact that they are called with step()? Im not really even sure what step() is or why its necessary for them to work. Is this because they don't actually have 100% declarative pipeline support yet?

red 888

unread,
Aug 20, 2017, 1:37:20 PM8/20/17
to Jenkins Users
So I'm dumb I can see the xunit plugin under the "step: General Build Step". Still confused why some plugins use this and some don't. For example cleanWs doesn't use step but wsCleanup does and they seem to do the exact same thing?

Slide

unread,
Aug 20, 2017, 3:35:24 PM8/20/17
to Jenkins Users

Some plugins may not have a @Symbol annotation, or explicit pipeline step implementation. If they don't, but do implement SimpleBuildStep, then they will show up usable under step(). The @Symbol allows for a more symbolic usage of the step in pipeline scripts. Otherwise, the plugin has to implement a separate pipeline step class an provide an implementation of a method which returns the shorthand for executing the step. Pipeline support in plugins is still something that needs work, there are many plugins that don't implement the correct functions.


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/18d4bdf9-fee3-47c9-b2de-b765d05e1213%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages