jenkinsci / jenkinsci/nodelabelparameter-plugin
[JENKINS-47571] Pipeline Snippet Generator for 'build' steps doesn't generate proper code for node and label parameters
- Dominant language
- Java
- Stars
- 28
- Forks
- 59
- Avg merge
- 1h 24m
- Merged PRs (30d)
- 3
Description
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: []
```
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
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
Contributor guide
Research direction
Start with the Pipeline Snippet Generator path used by the “Build a job” example and trace how node and label parameter values are rendered. Compare the generated output with the expected NodeParameterValue example; done means both parameter types produce usable Pipeline code instead of an object representation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100