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

pipeline-build-step-plugin: "triggeredBy UpstreamCause" when condition in declarative pipeline is broken

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      We upgrade the plugin lately from 2.13 to 2.15 and noticed that build steps in our declarative where not triggered anymore. Then we figured out that all these build steps have in common that they use the triggeredBy 'UpstreamCause' condition which we guess is broken because of JENKINS-60995. Probably the new class implemented by this is not taken into consideration for evaluating the when condition or there is some non-compatibility between this and the original class. This unfortunately has a bigger impact for us as we are checking the trigger in our jobs if it was by a user or by a upstream job. An example of this would be

       

      pipeline {
          agent any    
          parameters {
              booleanParam(name: 'FORCE_RUN', defaultValue: false)
          }
          stages {
              stage("Job check") {
                  when {
                      not {
                          anyOf {
                              triggeredBy 'UpstreamCause'
                              expression { return  params.FORCE_RUN }
                          }
                      }
                  }
                  steps {
                      script {
                          currentBuild.result = 'NOT_BUILT'
                          error('Please use the FORCE_RUN parameter to start manually, or start the deployment from upstream')
                      }
                  }
              }
              stage('Initialization of the pipeline') {
                  steps {
                      echo "Job triggered successfully"
                  }
              }
          }
      }
      

       

        Attachments

          Issue Links

            Activity

            Hide
            mattiasbpersson Mattias Persson added a comment - - edited

            We have have the same issue. We see that the class has changed:

            From: hudson.model.Cause$UpstreamCause
            To: org.jenkinsci.plugins.workflow.support.steps.build.BuildUpstreamCause

            Show
            mattiasbpersson Mattias Persson added a comment - - edited We have have the same issue. We see that the class has changed: From: hudson.model.Cause$UpstreamCause To: org.jenkinsci.plugins.workflow.support.steps.build.BuildUpstreamCause

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              seros Erik
              Votes:
              4 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated: