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

Pipeline parameters not properly updated in multibranch job config

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      I have a multi-branch pipeline where I've replaced a boolean parameter with a choice parameter but the "build with parameters" page shows the old boolean parameter; this is after I've done a dummy run to pick up the change. The log reports that it read the pipeline from the latest commit on that branch (master) which has the parameter change.

      In branches/master/config.xml, I see that the new parameter is listed in the parameters element, but the definition in parameterDefinitions is the old one! Here's an excerpt of that file - the old parameter is named REBOOT_FIRST and the new one is REBOOT_WHEN:

      branches/master/config.xml
      <flow-definition plugin="workflow-job@2.33">
        <actions>
      ...
      <org.jenkinsci.plugins.pipeline.modeldefinition.actions.DeclarativeJobPropertyTrackerAction plugin="pipeline-model-definition@1.3.9">
      ...
            <parameters>
              <string>REBOOT_WHEN</string>
      ...
            </parameters>
      ...    </org.jenkinsci.plugins.pipeline.modeldefinition.actions.DeclarativeJobPropertyTrackerAction>
        </actions>
      ...
        <properties>
          <hudson.model.ParametersDefinitionProperty>
            <parameterDefinitions>
              <hudson.model.BooleanParameterDefinition>
                <name>REBOOT_FIRST</name>
                <description>...</description>
                <defaultValue>true</defaultValue>
              </hudson.model.BooleanParameterDefinition>
      ...
      

      (I've elided various irrelevant bits with '...')

      So it seems like the first list has been updated, but the actual definition hasn't. THis has left me with a broken pipeline that I can't recover without editing config.xml manually and restarting Jenkins; I haven't yet tried this but I expect it to work.

      If updating any plugins would help, please advise and I'll try that, subject to my sysadmin approving.

        Attachments

          Issue Links

            Activity

            Hide
            allanlewis_youview Allan Lewis added a comment -

            I'm not sure which plugin is responsible for this logic - apologies if I picked the wrong one!

            Show
            allanlewis_youview Allan Lewis added a comment - I'm not sure which plugin is responsible for this logic - apologies if I picked the wrong one!
            Hide
            allanlewis_youview Allan Lewis added a comment -

            I just noticed that there are many hudson.model.ParametersDefinitionProperty elements in config.xml! So perhaps they're being appended instead of replaced? The excerpt in the description is from the first one, which I guess gets read in favour of the later ones.

            Show
            allanlewis_youview Allan Lewis added a comment - I just noticed that there are many hudson.model.ParametersDefinitionProperty elements in config.xml ! So perhaps they're being appended instead of replaced? The excerpt in the description is from the first one, which I guess gets read in favour of the later ones.

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              allanlewis_youview Allan Lewis
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated: