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

UserCause does not get set properly by DSL plugin for conditional run steps.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Environment:
    • Similar Issues:

      Description

      The configuration created by the DSL plugin for the USER_CAUSE run condition 'exclusiveCause' parameter is not correct.

      You can see in the DSL_Code.png image I have attached that my DSL code is correct, and that this script is supposed to create a job that runs a shell script based on some conditions. One of those conditions is an OR condition with 3 conditions. One of those conditions is a "cause" condition. Currently, running this script as is produces a job that does not have any build steps.

      Looking more closely, I noticed that in the config.xml file that gets created, the xml element for the "exclusiveCause" option of the run condition is actually being incorrectly named "exclusiveCondition" instead of "exclusiveCause". This is causing the job to not be created correctly.

      Below I have posted a diff of the config file of a job that was manually created (config2.xml) to do the same thing, and the DSL config file (config.xml), grepping for 'cause'. You can clearly see that "<exclusiveCause>" is not listed for the DSL config file. Instead it appears as "<exclusiveCondition>", which is not correct.

      [Tue Nov 17 12:33:43] user ➤ domain ➔ ~
      $ diff config.xml config2.xml | grep -i cause
      > <condition class="org.jenkins_ci.plugins.run_condition.core.CauseCondition">
      > <buildCause>USER_CAUSE</buildCause>
      > <exclusiveCause>true</exclusiveCause>
      < <condition class='org.jenkins_ci.plugins.run_condition.core.CauseCondition'>
      < <buildCause>USER_CAUSE</buildCause>

        Attachments

          Activity

            People

            Assignee:
            daspilker Daniel Spilker
            Reporter:
            thetaiter Ian Tait
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: