[JIRA] [job-dsl-plugin] (JENKINS-31832) javaposse.jobdsl.dsl.Job is not a suitable parent class for javaposse.jobdsl.dsl.jobs.WorkflowJob (org.jenkinsci.plugins.workflow.job.WorkflowJob does not extend hudson.model.AbstractProject)
6 views
Skip to first unread message
frederic.chuong@gmail.com (JIRA)
unread,
Dec 1, 2015, 11:06:02 AM12/1/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
javaposse.jobdsl.dsl.jobs.WorkflowJob (which matches org.jenkinsci.plugins.workflow.job.WorkflowJob) extends javaposse.jobdsl.dsl.Job (which mainly matches hudson.model.AbstractProject) whereas hudson.model.AbstractProject is not a parent class of org.jenkinsci.plugins.workflow.job.WorkflowJob. That results in invalid configuration file being generated when using the javaposse.jobdsl.dsl.Job API combined with javaposse.jobdsl.dsl.DslFactory#workflowJob(java.lang.String, groovy.lang.Closure). That means we cannot trust the delegate type to select which customization to apply.
Closure foo = {
if (getDelegate() instanceof javaposse.jobdsl.dsl.Job) {
// label will generate 'assignedNode' / 'canRoam' elements
label('XXX')
}
}
// below XML is OK, FreeStyleProject has 'assignedNode' / 'canRoam' via AbstractProject
freeStyleJob('A', foo)
// below resulting XML does not match org.jenkinsci.plugins.workflow.job.WorkflowJob (does not extend AbstractProject)
workflowJob('B', foo)
After upgrading to 1.70 I get warnings like this when running Job DSL:
Processing DSL script blackbox_smoke.groovy
Warning: (blackbox_smoke.groovy, line 12) concurrentBuild is deprecated
Warning: (blackbox_smoke.groovy, line 14) authenticationToken is deprecated
Why are concurrentBuild and authenticationToken deprecated? I am using both of these features with Job DSL 1.69 and the latest version of the Pipeline plugin(s). I believe these two have been deprecated by mistake.
I see that {{authenticationToken }}is deprecated. What is the reasoning behind this? It seemed to work great before version 1.70. What are we supposed to use now to enable the remote triggering API?
I see that you've marked this bug as "Fixed but unreleased"; I'm afraid that it has not yet been fixed. As I wrote in my previous comment, it's not just authenticationToken that has regressed, but also concurrentBuild. Your PR addresses the former, but not the latter.