jenkinsci / jenkinsci/branch-api-plugin
[JENKINS-30206] Multibranch plugin: Modified properties do not propagate to existing branches
- Dominant language
- Java
- Stars
- 39
- Forks
- 154
- PR merge metrics
- No merged PRs in 30d
Description
Steps to reproduce:
1. Create a multi-branch workflow project
2. Select a git repository as a branch source
3. Set property strategy to "named branches get different properties"
4. Add a parameter property (as the default or as an exception that matches the branch you're building. both seem to not work) of a string or boolean with a set default value
5. Run a branch that attempts to use that property
6. Property does not appear to be accessible from Jenkinsfile
Example
Set parameter property of 'test_parameter' with a default value
Attempt to use the parameter
def param = test_parameternode("nodejs && swarm") {
checkout scm
println(param)
...
this exception gets thrown when the script is being executed.
groovy.lang.MissingPropertyException: No such property: test_parameter for class: groovy.lang.Binding
I've tried accessing
- boolean and string parameters
- As properties of the 'env' object or directly (The current tutorial for the workflow-plugin suggests that parameters are exported as variables in the global scope)
And I can't seem to get it to work in any instance
---
Originally reported by notnarb, imported from: Multibranch plugin: Modified properties do not propagate to existing branches
Raw content of original issue
Steps to reproduce:
1. Create a multi-branch workflow project
2. Select a git repository as a branch source
3. Set property strategy to "named branches get different properties"
4. Add a parameter property (as the default or as an exception that matches the branch you're building. both seem to not work) of a string or boolean with a set default value
5. Run a branch that attempts to use that property
6. Property does not appear to be accessible from JenkinsfileExample
Set parameter property of 'test_parameter' with a default value
Attempt to use the parameter
def param = test_parameternode("nodejs && swarm") {
checkout scm
println(param)
...this exception gets thrown when the script is being executed.
groovy.lang.MissingPropertyException: No such property: test_parameter for class: groovy.lang.Binding
I've tried accessing
- boolean and string parameters
- As properties of the 'env' object or directly (The current tutorial for the workflow-plugin suggests that parameters are exported as variables in the global scope)
And I can't seem to get it to work in any instance
environment
```
Jenkins: 1.612
Workflow (all): 1.10-beta-1
Workflow multibranch: 1.9-beta-2
```
6 attachments
- [Jenkinsfile](https://issues.jenkins.io/secure/attachment/30577/Jenkinsfile)
- [Selection_384.png](https://issues.jenkins.io/secure/attachment/30567/Selection_384.png)
> 
- [build.xml](https://issues.jenkins.io/secure/attachment/30576/build.xml)
- [config.xml](https://issues.jenkins.io/secure/attachment/30578/config.xml)
- [config.xml](https://issues.jenkins.io/secure/attachment/30579/config.xml)
- [log](https://issues.jenkins.io/secure/attachment/30575/log)
Contributor guide
Research direction
Start by reproducing the multibranch setup using the attached Jenkinsfile, config.xml files, and log, focusing on the branch property strategy and parameter visibility. Trace how properties reach existing branches; done means the configured string or boolean parameter is available from the branch's Jenkinsfile without a MissingPropertyException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- groovy, java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100