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

Pipeline Snippet Generator for 'build' steps doesn't generate proper code for node and label parameters

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Reporting this as suggested by Jesse Glick at https://stackoverflow.com/a/29806918/45375:

      In short: job parameters of type "node" and "label" are not correctly instantiated by the Snippet Generator.

      Current behavior:

      When I use the Snippet Generator with "Build a job", the generated code is :
      
      build job: 'test job', parameters: [<object of type org.jvnet.jenkins.plugins.nodelabelparameter.NodeParameterValue>]
      
      
      

      Expected behavior (example, assuming a parameter name of "UPSTREAM_NODE", a node name of "my_node"):

      build job: 'test job', parameters: [[$class: 'NodeParameterValue', name: 'UPSTREAM_NODE', labels: ['my_node'], nodeEligibility: [$class: 'AllNodeEligibility']]]
      
      

       

       

        Attachments

          Activity

          Hide
          davida2009 David Aldrich added a comment -

          Jesse Glick I think this issue was filed in response to your answer to https://stackoverflow.com/questions/29794804/how-to-use-a-parameter-from-nodelabelparameter-plugin-with-the-build-step-of-j/29806918#29806918. I see a similar bug:

          <object of type org.jvnet.jenkins.plugins.nodelabelparameter.NodeParameterValue>,
          

          I see there's no resolution to this bug. Do you think it needs to be reallocated?

          Show
          davida2009 David Aldrich added a comment - Jesse Glick I think this issue was filed in response to your answer to https://stackoverflow.com/questions/29794804/how-to-use-a-parameter-from-nodelabelparameter-plugin-with-the-build-step-of-j/29806918#29806918 . I see a similar bug: <object of type org.jvnet.jenkins.plugins.nodelabelparameter.NodeParameterValue>, I see there's no resolution to this bug. Do you think it needs to be reallocated?
          Hide
          jglick Jesse Glick added a comment -

          If there is no resolution to the bug, either the maintainer of this plugin has not seen it, or does not have time to fix it, or there is no active maintainer at all. I have no idea.

          By the way, @Symbol has been available as a nicer alternative to $class for quite some time (perhaps this question predates it), so the desired snippet would be something more resembling

          build job: 'test job', parameters: [node(name: 'UPSTREAM_NODE', labels: 'my_node', eligibility: all())]
          
          Show
          jglick Jesse Glick added a comment - If there is no resolution to the bug, either the maintainer of this plugin has not seen it, or does not have time to fix it, or there is no active maintainer at all. I have no idea. By the way, @Symbol has been available as a nicer alternative to $class for quite some time (perhaps this question predates it), so the desired snippet would be something more resembling build job: 'test job' , parameters: [node(name: 'UPSTREAM_NODE' , labels: 'my_node' , eligibility: all())]
          Hide
          davida2009 David Aldrich added a comment -

          Jesse Glick Thanks for your reply and sorry to bother you.  I posted a related question on Stack Overflow. If you have time to have a look I would be very grateful.

          Show
          davida2009 David Aldrich added a comment - Jesse Glick Thanks for your reply and sorry to bother you.  I posted a related question on Stack Overflow . If you have time to have a look I would be very grateful.

            People

            Assignee:
            domi Dominik Bartholdi
            Reporter:
            mklement0 Michael Klement
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: