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

Declarative Pipeline does not work with Milestone without Ordinal

XMLWordPrintable

      Pipeline milestone step has two optional parameters:

      ordinal number
      label

      stage ("Build") {
      milestone()
      }
      

      works fine in Pipeline script but will fail without an ordinal value in Declarative Pipeline.

      Started by user Admin
      org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
      WorkflowScript: 5: Missing required parameter: 'ordinal' @ line 5, column 13.
      milestone()
      ^

      WorkflowScript: 10: Missing required parameter: 'ordinal' @ line 10, column 13.
      milestone (label: 'Test')
      ^

      WorkflowScript: 15: Missing required parameter: 'ordinal' @ line 15, column 13.
      milestone (label: 'Deploy')
      ^

      3 errors

      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:411)
      at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:374)
      at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:220)
      at hudson.model.ResourceController.execute(ResourceController.java:98)
      at hudson.model.Executor.run(Executor.java:410)
      Finished: FAILURE

            abayer Andrew Bayer
            hrmpw Patrick Wolf
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: