Skip to content
Permalink
Browse files

added workaround for JENKINS-31366, deprecated support for older vers…

…ions of HTML Publisher plugin
  • Loading branch information...
daspilker committed Nov 3, 2015
1 parent 7c42e4b commit 1f6e144f5656db501aaf9a9bb637c8f2c1220f4f
@@ -41,12 +41,16 @@ Have a look at the [Jenkins Job DSL Gradle example](https://github.com/sheehan/j
* Added support for the [TestNG Plugin](https://wiki.jenkins-ci.org/display/JENKINS/testng-plugin)
([JENKINS-30895](https://issues.jenkins-ci.org/browse/JENKINS-30895))
* Added workaround for [GROOVY-6263](https://issues.apache.org/jira/browse/GROOVY-6263) to `WorkspaceCleanupContext`
* Added workaround for [JENKINS-31366](https://issues.jenkins-ci.org/browse/JENKINS-31366)
* Added support for the [SSH Plugin](https://wiki.jenkins-ci.org/display/JENKINS/SSH+plugin)
([JENKINS-30957](https://issues.jenkins-ci.org/browse/JENKINS-30957))
* Enhanced support for the [Gradle Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Gradle+Plugin)
([JENKINS-31264](https://issues.jenkins-ci.org/browse/JENKINS-31264))
* Support for older versions of the [Gradle Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Gradle+Plugin) is
deprecated, see [Migration](Migration#migrating-to-140)
* Support for older versions of the
[HTML Publisher Plugin](https://wiki.jenkins-ci.org/display/JENKINS/HTML+Publisher+Plugin) is deprecated, see
[Migration](Migration#migrating-to-140)
* Removed anything that has been deprecated in 1.33, see [Migration](Migration#migrating-to-133)
* 1.39 (October 05 2015)
* Increased the minimum supported Jenkins version to 1.596
@@ -6,6 +6,12 @@ Support for versions older than 1.23 of the
[Gradle Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Gradle+Plugin) is [[deprecated|Deprecation-Policy]]
and will be removed.

### HTML Publisher

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

## Migrating to 1.39

### MultiJob
@@ -334,6 +334,8 @@ class PublisherContext extends AbstractExtensibleContext {
*/
@RequiresPlugin(id = 'htmlpublisher')
void publishHtml(@DslContext(HtmlReportContext) Closure htmlReportContext) {
jobManagement.logPluginDeprecationWarning('htmlpublisher', '1.5')

HtmlReportContext reportContext = new HtmlReportContext(jobManagement)
ContextHelper.executeInContext(htmlReportContext, reportContext)

@@ -351,7 +353,9 @@ class PublisherContext extends AbstractExtensibleContext {
if (!jobManagement.getPluginVersion('htmlpublisher')?.isOlderThan(new VersionNumber('1.4'))) {
alwaysLinkToLastBuild(target.alwaysLinkToLastBuild)
}
wrapperName('htmlpublisher-wrapper.html')
if (jobManagement.getPluginVersion('htmlpublisher')?.isOlderThan(new VersionNumber('1.5'))) {
wrapperName('htmlpublisher-wrapper.html')
}
}
}
}
@@ -679,15 +679,15 @@ class PublisherContextSpec extends Specification {
publisherHtmlNode.name() == 'htmlpublisher.HtmlPublisher'
!publisherHtmlNode.reportTargets.isEmpty()
def target = publisherHtmlNode.reportTargets[0].'htmlpublisher.HtmlPublisherTarget'[0]
target.children().size() == 7
target.children().size() == 6
target.reportName[0].value() == ''
target.reportDir[0].value() == 'build/*'
target.reportFiles[0].value() == 'index.html'
target.keepAll[0].value() == false
target.allowMissing[0].value() == false
target.alwaysLinkToLastBuild[0].value() == false
target.wrapperName[0].value() == 'htmlpublisher-wrapper.html'
1 * jobManagement.requirePlugin('htmlpublisher')
1 * jobManagement.logPluginDeprecationWarning('htmlpublisher', '1.5')
}

def 'calling minimal html publisher closure, plugin version older than 1.3'() {
@@ -712,6 +712,7 @@ class PublisherContextSpec extends Specification {
target.keepAll[0].value() == false
target.wrapperName[0].value() == 'htmlpublisher-wrapper.html'
1 * jobManagement.requirePlugin('htmlpublisher')
1 * jobManagement.logPluginDeprecationWarning('htmlpublisher', '1.5')
}

def 'calling minimal html publisher closure, plugin version older than 1.4'() {
@@ -737,6 +738,7 @@ class PublisherContextSpec extends Specification {
target.allowMissing[0].value() == false
target.wrapperName[0].value() == 'htmlpublisher-wrapper.html'
1 * jobManagement.requirePlugin('htmlpublisher')
1 * jobManagement.logPluginDeprecationWarning('htmlpublisher', '1.5')
}

def 'calling html publisher closure with all options'() {
@@ -757,15 +759,15 @@ class PublisherContextSpec extends Specification {
publisherHtmlNode.name() == 'htmlpublisher.HtmlPublisher'
!publisherHtmlNode.reportTargets.isEmpty()
def target = publisherHtmlNode.reportTargets[0].'htmlpublisher.HtmlPublisherTarget'[0]
target.children().size() == 7
target.children().size() == 6
target.reportName[0].value() == 'foo'
target.reportDir[0].value() == 'build/*'
target.reportFiles[0].value() == 'test.html'
target.keepAll[0].value() == true
target.allowMissing[0].value() == true
target.alwaysLinkToLastBuild[0].value() == true
target.wrapperName[0].value() == 'htmlpublisher-wrapper.html'
1 * jobManagement.requirePlugin('htmlpublisher')
1 * jobManagement.logPluginDeprecationWarning('htmlpublisher', '1.5')
}

def 'calling html publisher with multiple reports'() {
@@ -792,6 +794,7 @@ class PublisherContextSpec extends Specification {
target2.reportDir[0].value() == 'test/*'

1 * jobManagement.requirePlugin('htmlpublisher')
1 * jobManagement.logPluginDeprecationWarning('htmlpublisher', '1.5')
}

def 'call Jabber publish with minimal args'() {

0 comments on commit 1f6e144

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