On Sat, Jan 5, 2019 at 12:23 AM martinda <[email protected]> wrote: >>> e.g. jenkinsRest.api().systemApi().version() -> return the version number >>> as a String? > > so is there a way forward for plugins of that type (those that intent to wrap > REST APIs of external services)?
Besides not existing? At a minimum, use no `GlobalVariable`s or any other `workflow-cps` dep, and use the `Step` API as it was designed: so that the arguments are straightforward uses of Jenkins databinding (comprehensible by `structs`). If you want to be compatible with Declarative Pipeline, there must be no return value, which rules out most such plugins unless they merely set up authentication environment variables and/or `$PATH`. If you are limiting yourself to Scripted, then any return values should still be simple data like primitives, `String`s, `List`s, or `Map`s. As an aside, for the special case that the Jenkins instance being queried is the same one the build is running on, I prototyped https://github.com/jenkinsci/workflow-basic-steps-plugin/pull/71 which does not make any actual HTTP call (so needs no stored credentials), and is designed to be usable on other plausible execution engines running something like Scripted syntax. -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr21CfPCV1MP8mN1hVam3PDcwsW-OMSORGuY6F2Obt3%2Bcg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
