Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-34002

Means of declaring a Pipeline's plugin requirements

      While a traditional project's config.xml can simply be inspected for plugins it is using, which is useful for example to ensure that the project is not loaded in an inappropriate server, this is not true of Pipeline scripts—steps it uses might be defined in various plugins, or metasteps like checkout might have configuration which refers to various plugins.

      There should be a way for the job itself to declare which plugins it wants loaded. The simplest approach would simply be a step which fails if some of the requested plugins are missing or too old:

      requirePlugins ['junit@1.6', 'parallel-test-executor']
      

      However as this is logically part of the job configuration as a whole, rather than something to be executed at a particular point in the build, it might make more sense as a JobProperty; a build started with missing plugins would immediately fail with an informative message. Using a property does not preclude defining the list from the script itself, using the properties step.

      The configuration form for the property or step could use JENKINS-31582 to inspect the last build and suggest which plugins to list.

          [JENKINS-34002] Means of declaring a Pipeline's plugin requirements

          Jesse Glick created issue -
          Jesse Glick made changes -
          Link New: This issue depends on JENKINS-31582 [ JENKINS-31582 ]
          Jesse Glick made changes -
          Epic Link New: JENKINS-35396 [ 171189 ]
          Liam Newman made changes -
          Comment [ I assume this is a way of asserting that specific plugin (or specific version of a plugin) must be present. The script shouldn't be able to install a plugin, only give a meaningful error if it isn't.

          I disagree that things that are required can be handled by individual steps. Having to wait until mid-pipeline to get a "nohup" error because you're missing some configuration is extremely frustrating. Groovy and Java coding guidelines enforce "import"s at the top (not in the middle of the file), the same should be true of pipeline. Fail fast with a meaningful message at the beginning of a pipeline when you know you're going to fail because you're missing a plugin is consistent and vastly better behavior. ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 170018 ] New: JNJira + In-Review [ 183731 ]
          Andrew Bayer made changes -
          Component/s New: pipeline-general [ 21692 ]
          Andrew Bayer made changes -
          Component/s Original: workflow-plugin [ 18820 ]
          Jesse Glick made changes -
          Component/s New: workflow-job-plugin [ 21716 ]
          Component/s Original: pipeline [ 21692 ]
          John Mellor made changes -
          Link New: This issue is related to JENKINS-39921 [ JENKINS-39921 ]
          John Mellor made changes -
          Link New: This issue is related to JENKINS-39920 [ JENKINS-39920 ]
          Patrick Wolf made changes -
          Remote Link New: This issue links to "PR-31 (Web Link)" [ 15500 ]

            Unassigned Unassigned
            jglick Jesse Glick
            Votes:
            6 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated: