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

          thetaiter Ian Tait created issue -
          thetaiter Ian Tait made changes -
          Field Original Value New Value
          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.

          {quote}[Tue Nov 17 12:33:43] nzrtcbld ➤ devtools4 ➔ ~
          $ 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>
          {quote}
          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.

          {quote}[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>
          {quote}
          scm_issue_link SCM/JIRA link daemon made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          daspilker Daniel Spilker made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 167034 ] JNJira + In-Review [ 209446 ]

            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: