[JIRA] (JENKINS-57433) Seed Job - Picks up incorrect Boolean Operator Classes

8 views
Skip to first unread message

james@time4tea.net (JIRA)

unread,
May 13, 2019, 9:10:03 AM5/13/19
to jenkinsc...@googlegroups.com
James Richardson created an issue
 
Jenkins / Bug JENKINS-57433
Seed Job - Picks up incorrect Boolean Operator Classes
Issue Type: Bug Bug
Assignee: Daniel Spilker
Components: job-dsl-plugin
Created: 2019-05-13 13:09
Environment: unix
Priority: Minor Minor
Reporter: James Richardson

Job DSL boolean operators in singleConditionalBuilder do not work. they appear to pick up incorrect classes

ERROR: (seed_job.groovy, line 298) No signature of method: javaposse.jobdsl.plugin.structs.DescribableListContext.and() is applicable for argument types: (seed_job$_freestyle_closure6$_closure59$_closure69$_closure71$_closure74, seed_job$_freestyle_closure6$_closure59$_closure69$_closure71$_closure75) values: [seed_job$_freestyle_closure6$_closure59$_closure69$_closure71$_closure74@78db9567, ...]

`

singleConditionalBuilder {
condition {
and {
status('ABORTED', 'FAILURE')
} {
not {
fileExists('script.sh', BaseDir.WORKSPACE)
}
}
}
runner

{ fail() }

buildStep {
shell

{ command(job.command) }

}
}

`

 

 

 

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

mail@daniel-spilker.com (JIRA)

unread,
Jun 6, 2019, 8:53:03 AM6/6/19
to jenkinsc...@googlegroups.com
Daniel Spilker updated Bug JENKINS-57433
 

You can not arbitrarily mix built-in and dynamic DSL. Use the API viewer to lookup the syntax.

job('example-1') {
  steps {
    singleConditionalBuilder {
      condition {
        and {
          conditions {
            conditionContainer {
              condition {
                statusCondition {
                  bestResult('FAILURE')
                  worstResult('ABORTED')
                }
              }
            } 
            conditionContainer {
              condition {
                not {
                  condition {
                    fileExistsCondition {
                      baseDir {
                        workspace()
                      }
                      file('script.sh')
                    }
                  }
                }
              }
            }
          }
        }
      }
      runner {
        fail()
      }
      buildStep {
        shell {
          command('echo Hello World')
        }
      }
    }
  }
}job('example-2') {
  steps {
    conditionalSteps {
      condition {
        and {
          status('ABORTED', 'FAILURE')
        } {
          not {
            fileExists('script.sh', BaseDir.WORKSPACE)
          }
        }
      }
      runner('Fail')
      steps {
        shell {
          command('echo Hello World')
        }
      }
    }
  }
} 
Change By: Daniel Spilker
Status: Open Fixed but Unreleased
Resolution: Not A Defect

mail@daniel-spilker.com (JIRA)

unread,
Mar 11, 2020, 9:04:04 AM3/11/20
to jenkinsc...@googlegroups.com
Change By: Daniel Spilker
Status: Fixed but Unreleased Closed
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages