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

Alternate build chooser is not working with the pipeline plugin

XMLWordPrintable

      Executing the following:

      Jenkinsfile
      checkout([$class: 'GitSCM', 
            branches: [[name: "origin/test"], [name: "origin/master"]], 
            doGenerateSubmoduleConfigurations: false, 
            submoduleCfg: [], 
            userRemoteConfigs: [[url: 'some url',
                                 credentialsId: 'some creds']],
            extensions: [
                [$class: 'PruneStaleBranch'],
                [$class: 'CleanBeforeCheckout'],
                [$class: 'BuildChooserSetting', buildChooser: [$class: 'AlternativeBuildChooser']]
            ]
          ])
      

      Throwing the following exception:

      java.lang.ClassCastException: org.jenkinsci.plugins.workflow.job.WorkflowRun cannot be cast to hudson.model.AbstractBuild
      	at org.jenkinsci.plugins.git.chooser.alternative.AlternativeBuildChooser$1.invoke(AlternativeBuildChooser.java:44)
      	at hudson.plugins.git.GitSCM$BuildChooserContextImpl.actOnBuild(GitSCM.java:907)
      	at org.jenkinsci.plugins.git.chooser.alternative.AlternativeBuildChooser.getCandidateRevisions(AlternativeBuildChooser.java:44)
      	at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:995)
      	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1098)
      	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:109)
      	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:83)
      	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:73)
      	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:49)
      	at hudson.security.ACL.impersonate(ACL.java:213)
      	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:47)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
      	at java.util.concurrent.FutureTask.run(Unknown Source)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      	at java.lang.Thread.run(Unknown Source)
      

            Unassigned Unassigned
            sebgod Sebastian Godelet
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: