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

Support ExtendedChoiceParameterDefinition plugin

    XMLWordPrintable

Details

    Description

      I have a pipeline step which has the following code for a input step :

      dynamicInput = input id: 'dynamicInput', message: 'Fill the form & wait for approval from EP', ok: 'Request', parameters: [
                       [$class: 'ChoiceParameterDefinition', choices: 'centos6\ncentos7\nrhel6\nrhel7', description: 'Select the os your job targets', name: 'OS'],
                       [$class: 'ChoiceParameterDefinition', choices: 'x86_64\ni386\nnoarch', description: 'Select the architecture your job targets', name: 'Arch'],
                       [$class: 'ChoiceParameterDefinition', choices: 'java\nnodejs', description: 'Select the type of singlebuild job', name: 'JobType'],
                       [$class: 'StringParameterDefinition', defaultValue: "sample_name", description: 'Enter the app name(lower snake_case only - https://en.wikipedia.org/wiki/Snake_case)', name: 'AppName'],
                       [$class: 'StringParameterDefinition', defaultValue: "", description: 'Enter the list of files you want to package as part of artifact', name: 'FileList'],
                       [$class: 'StringParameterDefinition', defaultValue: "", description: 'Enter the Directory name for artifacts', name: 'DirName'],
                       [$class: 'StringParameterDefinition', defaultValue: "https://github.net/organization/reponame.git", description: 'Https Git url for your repository', name: 'GitUrl'],
                       taxonomy,
                       [$class: 'StringParameterDefinition', defaultValue: "", description: 'Enter team slack channel name for notifications', name: 'SlackChannel'],
                       [$class: 'StringParameterDefinition', defaultValue: "", description: 'Enter team slack channel token for notifications', name: 'SlackToken'],
      submitterParameter: "submittedby"
                       echo ("input is : " + dynamicInput)
      

      The taxonomy here is a global groovy function from the workflow library (https://github.com/jenkinsci/workflow-cps-global-lib-plugin). The code behind the taxonomy keyword sits in jenkins and is basically this:

      import com.cwctravel.hudson.plugins.extended_choice_parameter.ExtendedChoiceParameterDefinition
      
      def call(body) {
        node ('xxx') {
          def taxonomy = new ExtendedChoiceParameterDefinition("Taxonomy",
                                                                ExtendedChoiceParameterDefinition.PARAMETER_TYPE_SINGLE_SELECT,
                                                                null,
                                                                null,
                                                                null,
                                                                null,
                                                                env.JENKINS_HOME+"/workflow-libs/src/ep/taxonomylist.groovy",
                                                                null,
                                                                null,
                                                                null,
                                                                null,
                                                                null,
                                                                null,
                                                                null,
                                                                null,
                                                                null,
                                                                null,
                                                                null,
                                                                null,
                                                                null,
                                                                null,
                                                                null,
                                                                null,
                                                                null,
                                                                null,
                                                                null,
                                                                false,
                                                                false,
                                                                5,
                                                                null,
                                                                null)
      
          return taxonomy
        }
      }
      

      Now as I use this in classic view , it succeeds and the input step gives me the drop down for taxonomy ( the whole list of views), but in blue ocean plugin this fails and gives me an error instead of a dropdown : No component found for PT_SINGLE_SELECT

      The issue obviously is blue ocean just supporting the following types of inputs: https://github.com/jenkinsci/blueocean-plugin/blob/master/blueocean-dashboard/src/main/js/components/parameter/index.js#L10

      It needs to support custom type as well.

      Attachments

        Issue Links

          Activity

            kaulk Kuber Kaul added a comment -

            Any eta on this ?

            kaulk Kuber Kaul added a comment - Any eta on this ?
            jamesdumay James Dumay added a comment -

            kaulk not that this stage. We need to do some more work on our extensibility framework in order to have plugins like Extended Choice plugin be able to add their own elements to Blue Ocean.

            jamesdumay James Dumay added a comment - kaulk not that this stage. We need to do some more work on our extensibility framework in order to have plugins like Extended Choice plugin be able to add their own elements to Blue Ocean.
            kaulk Kuber Kaul added a comment -

            jamesdumay - thanks

            kaulk Kuber Kaul added a comment - jamesdumay - thanks
            eid Eid Badr added a comment -

            jamesdumay is there any new development/work regarding this?

            eid Eid Badr added a comment - jamesdumay is there any new development/work regarding this?

            Please fix it, we need it

            leang07 Leandro Garcia added a comment - Please fix it, we need it
            ajiwanand Ajay J added a comment -

            This would be amazing to have, is it being worked on?

            ajiwanand Ajay J added a comment - This would be amazing to have, is it being worked on?

            Would love to see this implemented as it's a blocker for switching over to blue ocean for our users

            jugglefish Peter Niederlag added a comment - Would love to see this implemented as it's a blocker for switching over to blue ocean for our users
            jugglefish Peter Niederlag added a comment - - edited

            the link in the bug-description to the supported input types is dead, however this seems to be the current starting point. there are even hints on adding custom input types.

            https://github.com/jenkinsci/blueocean-plugin/blob/fb1580ed84d34f6e365ba966450a440f1f71b152/blueocean-dashboard/src/main/js/components/karaoke/components/InputStep.jsx

            jugglefish Peter Niederlag added a comment - - edited the link in the bug-description to the supported input types is dead, however this seems to be the current starting point. there are even hints on adding custom input types. https://github.com/jenkinsci/blueocean-plugin/blob/fb1580ed84d34f6e365ba966450a440f1f71b152/blueocean-dashboard/src/main/js/components/karaoke/components/InputStep.jsx

            People

              Unassigned Unassigned
              kaulk Kuber Kaul
              Votes:
              14 Vote for this issue
              Watchers:
              17 Start watching this issue

              Dates

                Created:
                Updated: