Details

    • Similar Issues:

      Description

      The following DSL does not correctly generate the choices - a, b, c - in the generated job. See attached screen shot.

      freeStyleJob('rag-test-job') {
      properties{
      promotions {
      promotion {
      name('Development')
      conditions {
      manual('araguero', parameters

      { choiceParam('myParameterName',['a','b','c'],'my description') }

      )
      }
      actions

      { shell('echo hello;') }

      }
      }
      }
      }

        Attachments

        1. 1.png
          18 kB
          ma pi
        2. 2.png
          59 kB
          ma pi
        3. Screen Shot 2016-10-11 at 1.27.35 PM.png
          32 kB
          Alex Raguero

          Issue Links

            Activity

            Hide
            jhavero Alex Raguero added a comment -

            Also not working for version Jenkins ver. 2.7.19.1 (CloudBees Jenkins Enterprise 2.7.19.1-rolling)

            Show
            jhavero Alex Raguero added a comment - Also not working for version Jenkins ver. 2.7.19.1 (CloudBees Jenkins Enterprise 2.7.19.1-rolling)
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Alex Raguero Please create an issue to CloudBees ZenDesk then. In such case I may get this assignment to work on it during office hours. My personal time plans do not include dealing with Promoted Builds in short term, sorry. Or other engineers from CB Support/Engineering team may handle it.

            Show
            oleg_nenashev Oleg Nenashev added a comment - Alex Raguero Please create an issue to CloudBees ZenDesk then. In such case I may get this assignment to work on it during office hours. My personal time plans do not include dealing with Promoted Builds in short term, sorry. Or other engineers from CB Support/Engineering team may handle it.
            Hide
            mapi ma pi added a comment - - edited

            I have same problem too.
            Add some information about this problem.

            Jenkins 2.19.1
            Job DSL Plugin 1.52
            Promoted Builds Plugin 2.27

            This is a small Job-DSL script reproduce this issue.

            job('JENKINS_38913') {
              description('reproduce JENKINS-38913')
              properties {
                promotions {
                  promotion {
                    name('promote-me')
                    icon('star-red')
                    conditions {
                      manual('') {
                        parameters {
                          choiceParam('choice', ['a', 'b', 'c'], 'FIXME')
                        }
                      }
                    }
                  }
                }
              }
            }
            

            After generate Job. Jenkins report warning.


            Generated config.xml is here.

            ${JENKINS_HOME}/jobs/JENKINS_38913/promotions/promote-me/config.xml
            <hudson.plugins.promoted__builds.PromotionProcess plugin="promoted-builds@2.27">
              <name>promote-me</name>
              <icon>star-red</icon>
              <conditions>
                <hudson.plugins.promoted__builds.conditions.ManualCondition>
                  <users></users>
                  <parameterDefinitions>
                    <hudson.model.ChoiceParameterDefinition>
                      <choices>
                        <a>
                          <string>a</string>
                          <string>b</string>
                          <string>c</string>
                        </a>
                      </choices>
                      <name>choice</name>
                      <description>FIXME</description>
                    </hudson.model.ChoiceParameterDefinition>
                  </parameterDefinitions>
                </hudson.plugins.promoted__builds.conditions.ManualCondition>
              </conditions>
              <buildSteps/>
            </hudson.plugins.promoted__builds.PromotionProcess>
            

            Then, go back to the warning page and click "Discard Unreadable Data"
            Check config.xml again

            <?xml version='1.0' encoding='UTF-8'?>
            <hudson.plugins.promoted__builds.PromotionProcess plugin="promoted-builds@2.27">
              <keepDependencies>false</keepDependencies>
              <properties/>
              <scm class="hudson.scm.NullSCM"/>
              <canRoam>false</canRoam>
              <disabled>false</disabled>
              <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
              <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
              <triggers/>
              <concurrentBuild>false</concurrentBuild>
              <conditions>
                <hudson.plugins.promoted__builds.conditions.ManualCondition>
                  <users></users>
                  <parameterDefinitions>
                    <hudson.model.ChoiceParameterDefinition>
                      <name>choice</name>
                      <description>FIXME</description>
                      <choices/>
                    </hudson.model.ChoiceParameterDefinition>
                  </parameterDefinitions>
                </hudson.plugins.promoted__builds.conditions.ManualCondition>
              </conditions>
              <icon>star-red</icon>
              <buildSteps/>
            </hudson.plugins.promoted__builds.PromotionProcess>
            
            <choices> ... </choices>

            section removed.

            finally, edit this job manually.
            Correct config.xml is here.

            <?xml version='1.0' encoding='UTF-8'?>
            <hudson.plugins.promoted__builds.PromotionProcess plugin="promoted-builds@2.27">
              <keepDependencies>false</keepDependencies>
              <properties/>
              <scm class="hudson.scm.NullSCM"/>
              <canRoam>false</canRoam>
              <disabled>false</disabled>
              <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
              <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
              <triggers/>
              <concurrentBuild>false</concurrentBuild>
              <conditions>
                <hudson.plugins.promoted__builds.conditions.ManualCondition>
                  <users></users>
                  <parameterDefinitions>
                    <hudson.model.ChoiceParameterDefinition>
                      <name>choice</name>
                      <description>FIXME</description>
                      <choices class="java.util.Arrays$ArrayList">
                        <a class="string-array">
                          <string>a</string>
                          <string>b</string>
                          <string>c</string>
                        </a>
                      </choices>
                    </hudson.model.ChoiceParameterDefinition>
                  </parameterDefinitions>
                </hudson.plugins.promoted__builds.conditions.ManualCondition>
              </conditions>
              <icon>star-red</icon>
              <isVisible></isVisible>
              <buildSteps/>
            </hudson.plugins.promoted__builds.PromotionProcess>
            

            I guess Job-DSL plugin lost choiceParam type(type hint?).
            I hope this information to help.

            Show
            mapi ma pi added a comment - - edited I have same problem too. Add some information about this problem. Jenkins 2.19.1 Job DSL Plugin 1.52 Promoted Builds Plugin 2.27 This is a small Job-DSL script reproduce this issue. job( 'JENKINS_38913' ) { description( 'reproduce JENKINS-38913' ) properties { promotions { promotion { name( 'promote-me' ) icon( 'star-red' ) conditions { manual('') { parameters { choiceParam( 'choice' , [ 'a' , 'b' , 'c' ], 'FIXME' ) } } } } } } } After generate Job. Jenkins report warning. Generated config.xml is here. ${JENKINS_HOME}/jobs/JENKINS_38913/promotions/promote-me/config.xml <hudson.plugins.promoted__builds.PromotionProcess plugin= "promoted-builds@2.27" > <name> promote-me </name> <icon> star-red </icon> <conditions> <hudson.plugins.promoted__builds.conditions.ManualCondition> <users> </users> <parameterDefinitions> <hudson.model.ChoiceParameterDefinition> <choices> <a> <string> a </string> <string> b </string> <string> c </string> </a> </choices> <name> choice </name> <description> FIXME </description> </hudson.model.ChoiceParameterDefinition> </parameterDefinitions> </hudson.plugins.promoted__builds.conditions.ManualCondition> </conditions> <buildSteps/> </hudson.plugins.promoted__builds.PromotionProcess> Then, go back to the warning page and click "Discard Unreadable Data" Check config.xml again <?xml version= '1.0' encoding= 'UTF-8' ?> <hudson.plugins.promoted__builds.PromotionProcess plugin= "promoted-builds@2.27" > <keepDependencies> false </keepDependencies> <properties/> <scm class= "hudson.scm.NullSCM" /> <canRoam> false </canRoam> <disabled> false </disabled> <blockBuildWhenDownstreamBuilding> false </blockBuildWhenDownstreamBuilding> <blockBuildWhenUpstreamBuilding> false </blockBuildWhenUpstreamBuilding> <triggers/> <concurrentBuild> false </concurrentBuild> <conditions> <hudson.plugins.promoted__builds.conditions.ManualCondition> <users> </users> <parameterDefinitions> <hudson.model.ChoiceParameterDefinition> <name> choice </name> <description> FIXME </description> <choices/> </hudson.model.ChoiceParameterDefinition> </parameterDefinitions> </hudson.plugins.promoted__builds.conditions.ManualCondition> </conditions> <icon> star-red </icon> <buildSteps/> </hudson.plugins.promoted__builds.PromotionProcess> <choices> ... </choices> section removed. finally, edit this job manually. Correct config.xml is here. <?xml version= '1.0' encoding= 'UTF-8' ?> <hudson.plugins.promoted__builds.PromotionProcess plugin= "promoted-builds@2.27" > <keepDependencies> false </keepDependencies> <properties/> <scm class= "hudson.scm.NullSCM" /> <canRoam> false </canRoam> <disabled> false </disabled> <blockBuildWhenDownstreamBuilding> false </blockBuildWhenDownstreamBuilding> <blockBuildWhenUpstreamBuilding> false </blockBuildWhenUpstreamBuilding> <triggers/> <concurrentBuild> false </concurrentBuild> <conditions> <hudson.plugins.promoted__builds.conditions.ManualCondition> <users> </users> <parameterDefinitions> <hudson.model.ChoiceParameterDefinition> <name> choice </name> <description> FIXME </description> <choices class= "java.util.Arrays$ArrayList" > <a class= "string-array" > <string> a </string> <string> b </string> <string> c </string> </a> </choices> </hudson.model.ChoiceParameterDefinition> </parameterDefinitions> </hudson.plugins.promoted__builds.conditions.ManualCondition> </conditions> <icon> star-red </icon> <isVisible> </isVisible> <buildSteps/> </hudson.plugins.promoted__builds.PromotionProcess> I guess Job-DSL plugin lost choiceParam type(type hint?). I hope this information to help.
            Hide
            warandpeace Andrew Ferguson added a comment -

            Added my vote, this bug is affecting my teams now as well.

            Show
            warandpeace Andrew Ferguson added a comment - Added my vote, this bug is affecting my teams now as well.
            Hide
            hrmpw Patrick Wolf added a comment -

            Oleg Nenashev This bug is in core is it not? JENKINS-26143

            Show
            hrmpw Patrick Wolf added a comment - Oleg Nenashev This bug is in core is it not? JENKINS-26143
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Patrick Wolf Likely. In the case of Promoted Builds all JobDSL issues are in limbo till we get https://github.com/jenkinsci/promoted-builds-plugin/pull/96 integrated

            Show
            oleg_nenashev Oleg Nenashev added a comment - Patrick Wolf Likely. In the case of Promoted Builds all JobDSL issues are in limbo till we get https://github.com/jenkinsci/promoted-builds-plugin/pull/96 integrated

              People

              • Assignee:
                Unassigned
                Reporter:
                jhavero Alex Raguero
              • Votes:
                5 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated: