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

Upgrade from 0.17 incomplete when scriptOnlyIfSuccess and scriptOnlyIfFailure are both false

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • postbuildscript-plugin
    • None
    • Windows 2012R2 x64
      Jenkins 2.104 (was: 1.6x)
      PostBuildScript Plugin 2.30 (was: 0.17)

      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.

          [JENKINS-49423] Upgrade from 0.17 incomplete when scriptOnlyIfSuccess and scriptOnlyIfFailure are both false

          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.

          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.

          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

          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

          Thanks!

          Stefan Drissen added a comment - Thanks!

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

              Created:
              Updated:
              Resolved: