Skip to content

Commit

Permalink
Merge pull request #913 from daspilker/JENKINS-36683
Browse files Browse the repository at this point in the history
[JENKINS-36683] enhanced support for the Exclusion Plugin
  • Loading branch information
daspilker committed Sep 16, 2016
2 parents 830438d + d1cbde5 commit 80b7102
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 6 deletions.
5 changes: 5 additions & 0 deletions docs/Home.md
Expand Up @@ -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))
Expand Down
8 changes: 8 additions & 0 deletions docs/Migration.md
@@ -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
Expand Down
@@ -1,6 +1,6 @@
job('example') {
wrappers {
exclusionResources('first', 'second')
exclusionResources('FIRST', 'SECOND')
}
steps {
criticalBlock {
Expand Down
Expand Up @@ -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)

Expand Down
Expand Up @@ -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))
}
}
}
Expand Down
Expand Up @@ -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'() {
Expand Down
Expand Up @@ -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'() {
Expand All @@ -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'() {
Expand Down

0 comments on commit 80b7102

Please sign in to comment.