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

Upgrade from 0.17 incomplete when scriptOnlyIfSuccess and scriptOnlyIfFailure are both false

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Component/s: postbuildscript-plugin
    • Labels:
      None
    • Environment:
      Windows 2012R2 x64
      Jenkins 2.104 (was: 1.6x)
      PostBuildScript Plugin 2.30 (was: 0.17)
    • Similar Issues:

      Description

      The effects of this issue have been mentioned, but not addressed, in JENKINS-48169

      Multiple jobs contained the post build step part:

      <org.jenkinsci.plugins.postbuildscript.PostBuildScript plugin="postbuildscript@0.17">
        <buildSteps>
          <hudson.tasks.BatchFile>
            <command>somecommand</command>
          </hudson.tasks.BatchFile>
        </buildSteps>
        <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
        <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
        <markBuildUnstable>true</markBuildUnstable>
      </org.jenkinsci.plugins.postbuildscript.PostBuildScript>

      After upgrading, this became:

      <org.jenkinsci.plugins.postbuildscript.PostBuildScript plugin="postbuildscript@2.3.0">
        <config>
          <scriptFiles/>
          <groovyScripts/>
          <buildSteps>
            <org.jenkinsci.plugins.postbuildscript.model.PostBuildStep>
              <results/>
              <role>BOTH</role>
              <buildSteps>
                <hudson.tasks.BatchFile>
                  <command>somecommand</command>
                </hudson.tasks.BatchFile>
              </buildSteps>
            </org.jenkinsci.plugins.postbuildscript.model.PostBuildStep>
          </buildSteps>
          <markBuildUnstable>true</markBuildUnstable>
        </config>
      </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
      

      Due to no results being selected this results in

      [PostBuildScript] - Build does not have any of the results []. Did not execute build step #0.
      

      I am only guessing as to what the intention was of:

        <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
        <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
      

      Since the job was created by an ex-coworker, so have selected success / unstable / failure from the selection list.

      Please smoothen out the upgrade to handle this case - figuring out what is going wrong with someone else's job after an upgrade is not a nice experience.

        Attachments

          Activity

          Hide
          dheid Daniel Heid added a comment -

          Thanks for submitting this bug ticket. You are absolutely right: The old behavior was different and I totally misunderstood it. Script were executed every time independent of the build result. I will fix that.

          Show
          dheid Daniel Heid added a comment - Thanks for submitting this bug ticket. You are absolutely right: The old behavior was different and I totally misunderstood it. Script were executed every time independent of the build result. I will fix that.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Daniel Heid
          Path:
          .gitignore
          README.md
          pom.xml
          src/main/java/org/jenkinsci/plugins/postbuildscript/PostBuildScript.java
          src/test/java/org/jenkinsci/plugins/postbuildscript/PostBuildScriptIT.java
          src/test/java/org/jenkinsci/plugins/postbuildscript/PostBuildScriptTest.java
          src/test/java/org/jenkinsci/plugins/postbuildscript/service/CommandExecutorIT.java
          src/test/java/org/jenkinsci/plugins/postbuildscript/service/CommandExecutorTest.java
          src/test/java/org/jenkinsci/plugins/postbuildscript/service/GroovyScriptExecutorIT.java
          src/test/java/org/jenkinsci/plugins/postbuildscript/service/GroovyScriptExecutorTest.java
          src/test/resources/v0.18_config_a.xml
          src/test/resources/v0.18_config_b.xml
          src/test/resources/v0.18_config_c.xml
          src/test/resources/v0.18_config_d.xml
          http://jenkins-ci.org/commit/postbuildscript-plugin/32371bc0ba591abf9a4bbb1d09ef47ae9ae681c7
          Log:
          JENKINS-49423 Upgrade from 0.17 incomplete when scriptOnlyIfSuccess and scriptOnlyIfFailure are both false

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Heid Path: .gitignore README.md pom.xml src/main/java/org/jenkinsci/plugins/postbuildscript/PostBuildScript.java src/test/java/org/jenkinsci/plugins/postbuildscript/PostBuildScriptIT.java src/test/java/org/jenkinsci/plugins/postbuildscript/PostBuildScriptTest.java src/test/java/org/jenkinsci/plugins/postbuildscript/service/CommandExecutorIT.java src/test/java/org/jenkinsci/plugins/postbuildscript/service/CommandExecutorTest.java src/test/java/org/jenkinsci/plugins/postbuildscript/service/GroovyScriptExecutorIT.java src/test/java/org/jenkinsci/plugins/postbuildscript/service/GroovyScriptExecutorTest.java src/test/resources/v0.18_config_a.xml src/test/resources/v0.18_config_b.xml src/test/resources/v0.18_config_c.xml src/test/resources/v0.18_config_d.xml http://jenkins-ci.org/commit/postbuildscript-plugin/32371bc0ba591abf9a4bbb1d09ef47ae9ae681c7 Log: JENKINS-49423 Upgrade from 0.17 incomplete when scriptOnlyIfSuccess and scriptOnlyIfFailure are both false
          Hide
          smd Stefan Drissen added a comment -

          Thanks!

          Show
          smd Stefan Drissen added a comment - Thanks!

            People

            • Assignee:
              dheid Daniel Heid
              Reporter:
              smd Stefan Drissen
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: