Skip to content
Permalink
Browse files

Merge pull request #913 from daspilker/JENKINS-36683

[JENKINS-36683] enhanced support for the Exclusion Plugin
  • Loading branch information
daspilker committed Sep 16, 2016
2 parents 830438d + d1cbde5 commit 80b71024094058646227ffa69635ec49df732bbb
@@ -28,6 +28,11 @@ Browse the Jenkins issue tracker to see any [open issues](https://issues.jenkins
## Release Notes
* 1.52 (unreleased)
* Increased the minimum supported Jenkins version to 1.642
* Enhanced support for the [Exclusion Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Exclusion-Plugin)
([JENKINS-36683](https://issues.jenkins-ci.org/browse/JENKINS-36683))
* Support for the older versions of the
[Exclusion Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Exclusion-Plugin) is deprecated, see
[Migration](Migration#migrating-to-152)
* 1.51 (September 13 2016)
* Enhanced support for the [RunDeck Plugin](https://wiki.jenkins-ci.org/display/JENKINS/RunDeck+Plugin)
([#885](https://github.com/jenkinsci/job-dsl-plugin/pull/885))
@@ -1,3 +1,11 @@
## Migrating to 1.52

### Exclusion

Support for versions older than 0.12 of the
[Exclusion Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Exclusion-Plugin) is [[deprecated|Deprecation-Policy]]
and will be removed.

## Migrating to 1.51

### Rundeck
@@ -1,6 +1,6 @@
job('example') {
wrappers {
exclusionResources('first', 'second')
exclusionResources('FIRST', 'SECOND')
}
steps {
criticalBlock {
@@ -690,6 +690,8 @@ class StepContext extends AbstractExtensibleContext {
*/
@RequiresPlugin(id = 'Exclusion')
void criticalBlock(@DslContext(StepContext) Closure closure) {
jobManagement.logPluginDeprecationWarning('Exclusion', '0.12')

StepContext stepContext = new StepContext(jobManagement, item)
ContextHelper.executeInContext(closure, stepContext)

@@ -462,11 +462,13 @@ class WrapperContext extends AbstractExtensibleContext {
*/
@RequiresPlugin(id = 'Exclusion')
void exclusionResources(Iterable<String> resourceNames) {
jobManagement.logPluginDeprecationWarning('Exclusion', '0.12')

wrapperNodes << new NodeBuilder().'org.jvnet.hudson.plugins.exclusion.IdAllocator' {
ids {
resourceNames.each { String resourceName ->
'org.jvnet.hudson.plugins.exclusion.DefaultIdType' {
name resourceName
name(resourceName.toUpperCase(Locale.ENGLISH))
}
}
}
@@ -2642,6 +2642,7 @@ class StepContextSpec extends Specification {
context.stepNodes[1].name() == 'hudson.tasks.Shell'
context.stepNodes[2].name() == 'org.jvnet.hudson.plugins.exclusion.CriticalBlockEnd'
1 * jobManagement.requirePlugin('Exclusion')
1 * jobManagement.logPluginDeprecationWarning('Exclusion', '0.12')
}

def 'call rake method'() {
@@ -1094,9 +1094,10 @@ class WrapperContextSpec extends Specification {
then:
with(context.wrapperNodes[0]) {
name() == 'org.jvnet.hudson.plugins.exclusion.IdAllocator'
ids[0].'org.jvnet.hudson.plugins.exclusion.DefaultIdType'[0].name[0].value() == 'first'
ids[0].'org.jvnet.hudson.plugins.exclusion.DefaultIdType'[0].name[0].value() == 'FIRST'
}
(1.._) * mockJobManagement.requirePlugin('Exclusion')
1 * mockJobManagement.logPluginDeprecationWarning('Exclusion', '0.12')
}

def 'call exclusion with multiple args'() {
@@ -1106,11 +1107,12 @@ class WrapperContextSpec extends Specification {
then:
with(context.wrapperNodes[0]) {
name() == 'org.jvnet.hudson.plugins.exclusion.IdAllocator'
ids[0].'org.jvnet.hudson.plugins.exclusion.DefaultIdType'[0].name[0].value() == 'first'
ids[0].'org.jvnet.hudson.plugins.exclusion.DefaultIdType'[1].name[0].value() == 'second'
ids[0].'org.jvnet.hudson.plugins.exclusion.DefaultIdType'[2].name[0].value() == 'third'
ids[0].'org.jvnet.hudson.plugins.exclusion.DefaultIdType'[0].name[0].value() == 'FIRST'
ids[0].'org.jvnet.hudson.plugins.exclusion.DefaultIdType'[1].name[0].value() == 'SECOND'
ids[0].'org.jvnet.hudson.plugins.exclusion.DefaultIdType'[2].name[0].value() == 'THIRD'
}
1 * mockJobManagement.requirePlugin('Exclusion')
1 * mockJobManagement.logPluginDeprecationWarning('Exclusion', '0.12')
}

def 'set delivery pipeline version'() {

0 comments on commit 80b7102

Please sign in to comment.
You can’t perform that action at this time.