-
Bug
-
Resolution: Unresolved
-
Major
-
Jenkins 2.40
Promoted Build Plugin version: 2.28
Sample DSL:
freeStyleJob('test1') { properties { promotions { promotion { name('promotion 1') icon('Silver white star') conditions { manual('admin') } actions { shell "echo test" } } } } } freeStyleJob('test2') { using('test1') }
test1 is built fine
XML for test2:
<?xml version="1.0" encoding="UTF-8"?><project> <actions/> <description/> <keepDependencies>false</keepDependencies> <properties> <hudson.plugins.promoted__builds.JobPropertyImpl plugin="promoted-builds@2.28"> <activeProcessNames> <string>promotion 1</string> </activeProcessNames> </hudson.plugins.promoted__builds.JobPropertyImpl> </properties> <scm class="hudson.scm.NullSCM"/> <canRoam>true</canRoam> <disabled>false</disabled> <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding> <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding> <triggers/> <concurrentBuild>false</concurrentBuild> <builders/> <publishers/> <buildWrappers/> </project>
however, no promotions:
# ls test2/promotions/ | wc -l 0
- is duplicated by
-
JENKINS-40262 Promotions created with job DSL are not visible
-
- Closed
-
Seems that the issue is with the construction of the
in the jobDsl contect, the class is initiated and a call is made to
which, in turn, runs
.
Problem is, in this context, the root dir, is now the NEW job, not the old one, so, the class isn't initiated properly and thus, later, the List of
is left empty.
I think, that also, part of the problem, is that in no entry point between the jobDsl plugin code, to the promotion one, I have see any reference that passes the name of the template job, which makes it impossibly to load it from the right context.
Solution would be either:
on
javaposse/jobdsl/plugin/JenkinsJobManagement.class:492
(or anywhere else before so, like, in the initialisation if the