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

SauceConnect step fails in Declarative pipeline: Missing required parameter: "sauceConnectPath"

      The following code fails on the sauceconnect step unless the script block is uncommented:
      https://raw.githubusercontent.com/bitwiseman/JS-Nightwatch.js/issue/declarative/sauceConnectPath/Jenkinsfile

      pipeline {
          agent any
          stages {
              stage ("Build") {
                  steps {
                      // Install dependencies
                      sh 'npm install'
                  }
              }
              stage ("Test") {
                  steps {
      //              script {
                      // Add sauce credentials
                      sauce('f0a6b8ad-ce30-4cba-bf9a-95afbc470a8a') {
                          // Start sauce connect
                          sauceconnect(options: '', useGeneratedTunnelIdentifier: false, verboseLogging: false) {
      
                          }
                      }
      //              }
                  }
              }
          }
      }
      

      The error is:

      org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
      WorkflowScript: 16: Missing required parameter: "sauceConnectPath" @ line 16, column 25.
                                 sauceconnect(options: '', useGeneratedTunnelIdentifier: false, verboseLogging: false) {
                                 ^
      
      1 error
      
      	at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310)
      	at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1073)
      	at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:591)
      	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:569)
      	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:546)
      	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
      	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
      	at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688)
      	at groovy.lang.GroovyShell.parse(GroovyShell.java:700)
      	at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:67)
      	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:429)
      	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:392)
      	at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:221)
      	at hudson.model.ResourceController.execute(ResourceController.java:98)
      	at hudson.model.Executor.run(Executor.java:404)
      Finished: FAILURE
      

          [JENKINS-41236] SauceConnect step fails in Declarative pipeline: Missing required parameter: "sauceConnectPath"

          Andrew Bayer added a comment - - edited

          So...I would consider this very much a bug in the Sauce plugin rather than Declarative. If you look at https://github.com/jenkinsci/sauce-ondemand-plugin/blob/master/src/main/java/com/saucelabs/jenkins/pipeline/SauceConnectStep.java#L49-L55, you can see that the sauceconnect step in fact has four required parameters - if any of them should actually be optional, they shouldn't be in the @DataBoundConstructor, and they should instead have their own @DataBoundSetter.

          And I should mention that I'm actually not sure how this works outside Declarative! =)

          Andrew Bayer added a comment - - edited So...I would consider this very much a bug in the Sauce plugin rather than Declarative. If you look at https://github.com/jenkinsci/sauce-ondemand-plugin/blob/master/src/main/java/com/saucelabs/jenkins/pipeline/SauceConnectStep.java#L49-L55 , you can see that the sauceconnect step in fact has four required parameters - if any of them should actually be optional, they shouldn't be in the @DataBoundConstructor , and they should instead have their own @DataBoundSetter . And I should mention that I'm actually not sure how this works outside Declarative! =)

          R. Tyler Croy added a comment -

          halkeye, my colleague bitwiseman were hoping to feature the Sauce OnDemand plugin in another blog post around Declarative Pipeline.

          Would that be sufficient motivation to fix this issue mebbe?

          R. Tyler Croy added a comment - halkeye , my colleague bitwiseman were hoping to feature the Sauce OnDemand plugin in another blog post around Declarative Pipeline. Would that be sufficient motivation to fix this issue mebbe?

          Gavin Mogan added a comment -

          Do you have a timeline for that? I've been looking at this one and the related one (JENKINS-37610) on and off the last couple of weeks but been busy with an important internal project (DIE FLASH DIE).

          Can it wait till early next week? I should have time then.

          Gavin Mogan added a comment - Do you have a timeline for that? I've been looking at this one and the related one ( JENKINS-37610 ) on and off the last couple of weeks but been busy with an important internal project (DIE FLASH DIE). Can it wait till early next week? I should have time then.

          R. Tyler Croy added a comment -

          Most definitely can wait until early next week. We're queuing up a blog series to start after the 1.0 launch of Declarative Pipeline (~ feb 4/5th)

          R. Tyler Croy added a comment - Most definitely can wait until early next week. We're queuing up a blog series to start after the 1.0 launch of Declarative Pipeline (~ feb 4/5th)

          Gavin Mogan added a comment -

          Okay, I had time today, so did a bit of refactoring. Should be released tomorrow, monday at the latest.

          Gavin Mogan added a comment - Okay, I had time today, so did a bit of refactoring. Should be released tomorrow, monday at the latest.

          Code changed in jenkins
          User: Gavin Mogan
          Path:
          src/main/java/com/saucelabs/jenkins/pipeline/SauceConnectStep.java
          http://jenkins-ci.org/commit/sauce-ondemand-plugin/18608f6f3e3188fd0c4f3f0d5002291575c35fb1
          Log:
          Make parameters for sauceconnect pipeline step optional - JENKINS-41236

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gavin Mogan Path: src/main/java/com/saucelabs/jenkins/pipeline/SauceConnectStep.java http://jenkins-ci.org/commit/sauce-ondemand-plugin/18608f6f3e3188fd0c4f3f0d5002291575c35fb1 Log: Make parameters for sauceconnect pipeline step optional - JENKINS-41236

          Gavin Mogan added a comment -

          bitwiseman
          this should now be fixed in 1.160

          https://github.com/saucelabs/jenkins-sauce-ondemand-plugin/blob/master/CHANGELOG.md#jenkins-1160---2017-01-27

          I'll mark it as resolved, reopen if necessary

          Gavin Mogan added a comment - bitwiseman this should now be fixed in 1.160 https://github.com/saucelabs/jenkins-sauce-ondemand-plugin/blob/master/CHANGELOG.md#jenkins-1160---2017-01-27 I'll mark it as resolved, reopen if necessary

            Unassigned Unassigned
            bitwiseman Liam Newman
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: