Skip to content
Permalink
Browse files

Merge remote-tracking branch 'ldez/JENKINS-33674'

[FIXES JENKINS-32785]
  • Loading branch information
daspilker committed Mar 22, 2016
2 parents dd385af + e93adcb commit 3a205447608734938775c2195f86c15a2d313bec
@@ -33,7 +33,8 @@ Browse the Jenkins issue tracker to see any [open issues](https://issues.jenkins
([JENKINS-33416](https://issues.jenkins-ci.org/browse/JENKINS-33416),
[JENKINS-33675](https://issues.jenkins-ci.org/browse/JENKINS-33675))
* Enhanced support for the [Extra Columns Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Extra+Columns+Plugin)
([JENKINS-33676](https://issues.jenkins-ci.org/browse/JENKINS-33676),
([JENKINS-32785](https://issues.jenkins-ci.org/browse/JENKINS-32785),
[JENKINS-33676](https://issues.jenkins-ci.org/browse/JENKINS-33676),
[JENKINS-33677](https://issues.jenkins-ci.org/browse/JENKINS-33677))
* Improved script execution performance by re-using script engines
([#782](https://github.com/jenkinsci/job-dsl-plugin/pull/782))
@@ -49,6 +50,8 @@ Browse the Jenkins issue tracker to see any [open issues](https://issues.jenkins
* Support for the older versions of the [CloudBees Docker Build and Publish
Plugin](https://wiki.jenkins-ci.org/display/JENKINS/CloudBees+Docker+Build+and+Publish+plugin) is deprecated, see
[Migration](Migration#migrating-to-145)
* Support for [Build Node Column Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Build+Node+Column+Plugin) is
deprecated, see [Migration](Migration#migrating-to-145)
* Enhanced support for the [EnvInject Plugin](https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin)
([#747](https://github.com/jenkinsci/job-dsl-plugin/pull/747))
* Deprecated a method for the [EnvInject Plugin](https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin), see
@@ -37,6 +37,13 @@ job('example') {
}
```

### Build Node Column

The [Build Node Column Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Build+Node+Column+Plugin) is deprecated and
has been replaced by the [Extra Columns Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Extra+Columns+Plugin). DSL
support for the Build Node Column Plugin is [[deprecated|Deprecation-Policy]] as well and will be removed. Use the Extra
Columns Plugin instead, the DSL syntax stays the same.

## Migrating to 1.44

### Git
@@ -92,12 +92,18 @@ class ColumnsContext extends AbstractContext {

/**
* Adds a column for showing the node which executed the last build.
* Requires version 1.16 or later of the Extra Columns plugin.
*
* @since 1.31
*/
@RequiresPlugin(id = 'build-node-column', minimumVersion = '0.1')
void lastBuildNode() {
columnNodes << new Node(null, 'org.jenkins.plugins.column.LastBuildNodeColumn')
if (jobManagement.isMinimumPluginVersionInstalled('build-node-column', '0.1')) {
jobManagement.logDeprecationWarning('support for build-node-column plugin')
columnNodes << new Node(null, 'org.jenkins.plugins.column.LastBuildNodeColumn')
} else {
jobManagement.requireMinimumPluginVersion('extra-columns', '1.16')
columnNodes << new Node(null, 'jenkins.plugins.extracolumns.LastBuildNodeColumn')
}
}

/**
@@ -198,42 +198,27 @@ class ListViewSpec<T extends ListView> extends Specification {
root.columns[0].children.size() == 0
}

def 'add all columns'() {
def 'add several columns'() {
when:
view.columns {
status()
weather()
name()
lastSuccess()
lastFailure()
lastDuration()
buildButton()
claim()
lastBuildNode()
categorizedJob()
cronTrigger()
progressBar()
}

then:
Node root = view.node
root.columns.size() == 1
root.columns[0].value().size() == 12
root.columns[0].value().size() == 6
root.columns[0].value()[0].name() == 'hudson.views.StatusColumn'
root.columns[0].value()[1].name() == 'hudson.views.WeatherColumn'
root.columns[0].value()[2].name() == 'hudson.views.JobColumn'
root.columns[0].value()[3].name() == 'hudson.views.LastSuccessColumn'
root.columns[0].value()[4].name() == 'hudson.views.LastFailureColumn'
root.columns[0].value()[5].name() == 'hudson.views.LastDurationColumn'
root.columns[0].value()[6].name() == 'hudson.views.BuildButtonColumn'
root.columns[0].value()[7].name() == 'hudson.plugins.claim.ClaimColumn'
root.columns[0].value()[8].name() == 'org.jenkins.plugins.column.LastBuildNodeColumn'
root.columns[0].value()[9].name() == 'org.jenkinsci.plugins.categorizedview.IndentedJobColumn'
root.columns[0].value()[10].name() == 'hudson.plugins.CronViewColumn'
root.columns[0].value()[11].name() == 'org.jenkins.ci.plugins.progress__bar.ProgressBarColumn'
1 * jobManagement.requireMinimumPluginVersion('build-node-column', '0.1')
1 * jobManagement.requireMinimumPluginVersion('categorized-view', '1.8')
1 * jobManagement.requirePlugin('claim')
root.columns[0].value()[2].name() == 'hudson.views.LastSuccessColumn'
root.columns[0].value()[3].name() == 'hudson.views.LastFailureColumn'
root.columns[0].value()[4].name() == 'hudson.views.LastDurationColumn'
root.columns[0].value()[5].name() == 'hudson.views.BuildButtonColumn'
}

def 'call columns twice'() {
@@ -281,6 +266,37 @@ class ListViewSpec<T extends ListView> extends Specification {
1 * jobManagement.requirePlugin('extra-columns')
}

def 'last build node column with deprecated build-node-column'() {
setup:
jobManagement.isMinimumPluginVersionInstalled('build-node-column', '0.1') >> true

when:
view.columns {
lastBuildNode()
}

then:
Node root = view.node
root.columns.size() == 1
root.columns[0].value().size() == 1
root.columns[0].value()[0].name() == 'org.jenkins.plugins.column.LastBuildNodeColumn'
1 * jobManagement.logDeprecationWarning('support for build-node-column plugin')
}

def 'last build node column'() {
when:
view.columns {
lastBuildNode()
}

then:
Node root = view.node
root.columns.size() == 1
root.columns[0].value().size() == 1
root.columns[0].value()[0].name() == 'jenkins.plugins.extracolumns.LastBuildNodeColumn'
1 * jobManagement.requireMinimumPluginVersion('extra-columns', '1.16')
}

def 'robotResults column'() {
when:
view.columns {

0 comments on commit 3a20544

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