Skip to content

[JENKINS-47571] Pipeline Snippet Generator for 'build' steps doesn't generate proper code for node and label parameters #559

@jenkins-infra-bot

Description

@jenkins-infra-bot

Reporting this as suggested by jglick 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']]]


 

 


Originally reported by mklement0, imported from: Pipeline Snippet Generator for 'build' steps doesn't generate proper code for node and label parameters
  • status: Open
  • priority: Minor
  • component(s): nodelabelparameter-plugin
  • label(s): pipeline
  • resolution: Unresolved
  • votes: 3
  • watchers: 3
  • imported: 20251210-235911
Raw content of original issue

Reporting this as suggested by jglick 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']]]

 

 

  • environment: Jenkins v2.85, Node and Label parameter plugin v1.7.2

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions