Merge global defaults for jobs also
Currently, global defaults are merged to custom defaults for job templates, but not for jobs. Unify this behaviour. Change-Id: I26fb2678df7f4225571bf7c3cd4be7041ce99217
This commit is contained in:
parent
18efe5066b
commit
b669001eaa
@ -80,7 +80,7 @@ class RootBase:
|
|||||||
expanded_contents["description"] = amended_description
|
expanded_contents["description"] = amended_description
|
||||||
return expanded_contents
|
return expanded_contents
|
||||||
|
|
||||||
def _pick_defaults(self, name, merge_global=True):
|
def _pick_defaults(self, name):
|
||||||
try:
|
try:
|
||||||
defaults = self._defaults[name]
|
defaults = self._defaults[name]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
@ -93,16 +93,13 @@ class RootBase:
|
|||||||
)
|
)
|
||||||
if name == "global":
|
if name == "global":
|
||||||
return defaults
|
return defaults
|
||||||
if merge_global:
|
return defaults.merged_with_global(self._pick_defaults("global"))
|
||||||
return defaults.merged_with_global(self._pick_defaults("global"))
|
|
||||||
else:
|
|
||||||
return defaults
|
|
||||||
|
|
||||||
|
|
||||||
class NonTemplateRootMixin:
|
class NonTemplateRootMixin:
|
||||||
def top_level_generate_items(self):
|
def top_level_generate_items(self):
|
||||||
try:
|
try:
|
||||||
defaults = self._pick_defaults(self.defaults_name, merge_global=False)
|
defaults = self._pick_defaults(self.defaults_name)
|
||||||
item_params = LocDict.merge(
|
item_params = LocDict.merge(
|
||||||
defaults.params,
|
defaults.params,
|
||||||
self.params,
|
self.params,
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<keepDependencies>false</keepDependencies>
|
<keepDependencies>false</keepDependencies>
|
||||||
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
|
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
|
||||||
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
|
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
|
||||||
<concurrentBuild>false</concurrentBuild>
|
<concurrentBuild>true</concurrentBuild>
|
||||||
<canRoam>true</canRoam>
|
<canRoam>true</canRoam>
|
||||||
<properties/>
|
<properties/>
|
||||||
<scm class="hudson.scm.NullSCM"/>
|
<scm class="hudson.scm.NullSCM"/>
|
||||||
@ -15,5 +15,7 @@
|
|||||||
</hudson.tasks.Shell>
|
</hudson.tasks.Shell>
|
||||||
</builders>
|
</builders>
|
||||||
<publishers/>
|
<publishers/>
|
||||||
<buildWrappers/>
|
<buildWrappers>
|
||||||
|
<hudson.plugins.timestamper.TimestamperBuildWrapper/>
|
||||||
|
</buildWrappers>
|
||||||
</project>
|
</project>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
# Global defaults are not used, not merged to custom ones if used from a job.
|
# Global defaults are merged to custom ones if used from jobs,
|
||||||
|
# not just from job templates.
|
||||||
|
|
||||||
- defaults:
|
- defaults:
|
||||||
name: global
|
name: global
|
||||||
|
Loading…
x
Reference in New Issue
Block a user