Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. 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)

    Details

    • Similar Issues:

      Description

      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)
      

        Attachments

          Issue Links

            Activity

            Hide
            basil Basil Crow added a comment -

            We started having builds launched in parallel, even though they should have been queued.

            Frank Gen You might want to take a look at JENKINS-53775, where I discuss how I solved a similar-sounding problem with Job DSL and concurrent builds.

            Show
            basil Basil Crow added a comment - We started having builds launched in parallel, even though they should have been queued. Frank Gen You might want to take a look at JENKINS-53775 , where I discuss how I solved a similar-sounding problem with Job DSL and concurrent builds.
            Hide
            franknarf888 Frank Gen added a comment -

            Hello,

            Will this issue be resolved and released any time soon? We started having builds launched in parallel, even though they should have been queued.

            Thanks

            Show
            franknarf888 Frank Gen added a comment - Hello, Will this issue be resolved and released any time soon? We started having builds launched in parallel, even though they should have been queued. Thanks
            Hide
            basil Basil Crow added a comment -

            Hi Daniel Spilker,

            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.

            Show
            basil Basil Crow added a comment - Hi Daniel Spilker , 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.
            Hide
            daspilker Daniel Spilker added a comment -

            The next release will fix support for authenticationToken.

            Show
            daspilker Daniel Spilker added a comment - The next release will fix support for authenticationToken .
            Hide
            redeamer Michael Musenbrock added a comment -

            As authenticationToken is still configurable in the GUI, what is the new equivalent in the JobDSL?

            Show
            redeamer Michael Musenbrock added a comment - As authenticationToken is still configurable in the GUI, what is the new equivalent in the JobDSL?

              People

              • Assignee:
                daspilker Daniel Spilker
                Reporter:
                fchuong Frédéric Chuong
              • Votes:
                0 Vote for this issue
                Watchers:
                16 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: