Skip to content

Commit 8d3bfc1

Browse files
committed
deprecated support for older versions of the Subversion plugin
1 parent 093d13e commit 8d3bfc1

File tree

6 files changed

+50
-1
lines changed

6 files changed

+50
-1
lines changed

docs/Home.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ Browse the Jenkins issue tracker to see any [open issues](https://issues.jenkins
4242
* Deprecated `concurrentBuild` method in `pipelineJob` context, see [Migration](Migration#migrating-to-176)
4343
([JENKINS-53775](https://issues.jenkins-ci.org/browse/JENKINS-53775))
4444
* Support for older versions of the [Pipeline Job Plugin](https://plugins.jenkins.io/workflow-job) is deprecated, see
45-
[Migration](Migration#migrating-to-169)
45+
[Migration](Migration#migrating-to-176)
46+
* Support for older versions of the [Subversion Plugin](https://plugins.jenkins.io/subversion) is deprecated, see
47+
[Migration](Migration#migrating-to-176)
4648
* 1.75 (August 12 2019)
4749
* Added documentation about mandatory identifier in multi-branch Pipeline job branch sources, the identifier will no
4850
longer be generated and must be set to a constant and unique value, see [Migration](Migration#migrating-to-175)

docs/Migration.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ pipelineJob('example-2') {
3232
}
3333
```
3434

35+
### Subversion Plugin
36+
37+
Support for versions older than 2.8 of the [Subversion Plugin](https://plugins.jenkins.io/subversion) is
38+
[[deprecated|Deprecation-Policy]] and will be removed.
39+
3540
## Migrating to 1.75
3641

3742
The `id` option in the Git and GitHub branch source contexts is now mandatory

job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/helpers/BuildParametersContext.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ class BuildParametersContext extends AbstractExtensibleContext {
5959
*/
6060
@RequiresPlugin(id = 'subversion', minimumVersion = '2.1')
6161
void listTagsParam(String parameterName, String scmUrl, @DslContext(ListTagsParamContext) Closure closure = null) {
62+
jobManagement.logPluginDeprecationWarning('subversion', '2.8')
63+
6264
checkParameterName(parameterName)
6365
checkNotNullOrEmpty(scmUrl, 'scmUrl cannot be null or empty')
6466

job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/helpers/ScmContext.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ class ScmContext extends AbstractExtensibleContext {
229229
*/
230230
@RequiresPlugin(id = 'subversion', minimumVersion = '2.1')
231231
void svn(@DslContext(SvnContext) Closure svnClosure) {
232+
jobManagement.logPluginDeprecationWarning('subversion', '2.8')
233+
232234
SvnContext svnContext = new SvnContext(jobManagement)
233235
executeInContext(svnClosure, svnContext)
234236

job-dsl-core/src/test/groovy/javaposse/jobdsl/dsl/helpers/BuildParametersContextSpec.groovy

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ class BuildParametersContextSpec extends Specification {
115115
!uuid.text().empty
116116
}
117117
(1.._) * jobManagement.requireMinimumPluginVersion('subversion', '2.1')
118+
1 * jobManagement.logPluginDeprecationWarning('subversion', '2.8')
118119
}
119120

120121
def 'simplified listTagsParam usage'() {
@@ -140,6 +141,7 @@ class BuildParametersContextSpec extends Specification {
140141
!uuid.text().empty
141142
}
142143
(1.._) * jobManagement.requireMinimumPluginVersion('subversion', '2.1')
144+
1 * jobManagement.logPluginDeprecationWarning('subversion', '2.8')
143145
}
144146

145147
def 'simplest listTagsParam usage'() {
@@ -164,6 +166,7 @@ class BuildParametersContextSpec extends Specification {
164166
!uuid.text().empty
165167
}
166168
(1.._) * jobManagement.requireMinimumPluginVersion('subversion', '2.1')
169+
1 * jobManagement.logPluginDeprecationWarning('subversion', '2.8')
167170
}
168171

169172
def 'simplest closure listTagsParam usage'() {
@@ -189,6 +192,7 @@ class BuildParametersContextSpec extends Specification {
189192
!uuid.text().empty
190193
}
191194
(1.._) * jobManagement.requireMinimumPluginVersion('subversion', '2.1')
195+
1 * jobManagement.logPluginDeprecationWarning('subversion', '2.8')
192196
}
193197

194198
def 'listTagsParam with all closure options'() {
@@ -221,6 +225,7 @@ class BuildParametersContextSpec extends Specification {
221225
!uuid.text().empty
222226
}
223227
(1.._) * jobManagement.requireMinimumPluginVersion('subversion', '2.1')
228+
1 * jobManagement.logPluginDeprecationWarning('subversion', '2.8')
224229
}
225230

226231
def 'listTagsParam with maxTagsToDisplay int argument'() {
@@ -253,6 +258,7 @@ class BuildParametersContextSpec extends Specification {
253258
!uuid.text().empty
254259
}
255260
(1.._) * jobManagement.requireMinimumPluginVersion('subversion', '2.1')
261+
1 * jobManagement.logPluginDeprecationWarning('subversion', '2.8')
256262
}
257263

258264
def 'listTagsParam name argument cant be null'() {
@@ -305,6 +311,7 @@ class BuildParametersContextSpec extends Specification {
305311
maxTags.text() == 'all'
306312
}
307313
(1.._) * jobManagement.requireMinimumPluginVersion('subversion', '2.1')
314+
1 * jobManagement.logPluginDeprecationWarning('subversion', '2.8')
308315

309316
where:
310317
filter << [null, '']

job-dsl-core/src/test/groovy/javaposse/jobdsl/dsl/helpers/ScmContextSpec.groovy

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,6 +1237,7 @@ class ScmContextSpec extends Specification {
12371237
context.scmNodes[0].excludedRegions.size() == 1
12381238
context.scmNodes[0].excludedRegions[0].value() == '/trunk/.*'
12391239
(1.._) * mockJobManagement.requireMinimumPluginVersion('subversion', '2.1')
1240+
1 * mockJobManagement.logPluginDeprecationWarning('subversion', '2.8')
12401241
}
12411242

12421243
def 'call svn with remote and local'() {
@@ -1248,6 +1249,7 @@ class ScmContextSpec extends Specification {
12481249
locations[0].'hudson.scm.SubversionSCM_-ModuleLocation'[0].local[0].value() == '/mydir/mycode'
12491250
}
12501251
(1.._) * mockJobManagement.requireMinimumPluginVersion('subversion', '2.1')
1252+
1 * mockJobManagement.logPluginDeprecationWarning('subversion', '2.8')
12511253
}
12521254

12531255
def 'call svn with browser - Fisheye example'() {
@@ -1265,6 +1267,7 @@ class ScmContextSpec extends Specification {
12651267
context.scmNodes[0].browser[0].url[0].value() == 'http://mycompany.com/fisheye/repo_name'
12661268
context.scmNodes[0].browser[0].rootModule[0].value() == 'my_root_module'
12671269
(1.._) * mockJobManagement.requireMinimumPluginVersion('subversion', '2.1')
1270+
1 * mockJobManagement.logPluginDeprecationWarning('subversion', '2.8')
12681271
}
12691272

12701273
def 'call svn with browser - ViewSVN example'() {
@@ -1278,6 +1281,7 @@ class ScmContextSpec extends Specification {
12781281
context.scmNodes[0].browser[0].attributes()['class'] == 'hudson.scm.browsers.ViewSVN'
12791282
context.scmNodes[0].browser[0].url[0].value() == 'http://mycompany.com/viewsvn/repo_name'
12801283
(1.._) * mockJobManagement.requireMinimumPluginVersion('subversion', '2.1')
1284+
1 * mockJobManagement.logPluginDeprecationWarning('subversion', '2.8')
12811285
}
12821286

12831287
def 'call svn with no locations'() {
@@ -1309,6 +1313,7 @@ class ScmContextSpec extends Specification {
13091313
locations[0].'hudson.scm.SubversionSCM_-ModuleLocation'[0].ignoreExternalsOption[0].value() == true
13101314
}
13111315
(1.._) * mockJobManagement.requireMinimumPluginVersion('subversion', '2.1')
1316+
1 * mockJobManagement.logPluginDeprecationWarning('subversion', '2.8')
13121317
}
13131318

13141319
def 'call svn with credentials'() {
@@ -1331,6 +1336,7 @@ class ScmContextSpec extends Specification {
13311336
locations[0].'hudson.scm.SubversionSCM_-ModuleLocation'[0].ignoreExternalsOption[0].value() == false
13321337
}
13331338
(1.._) * mockJobManagement.requireMinimumPluginVersion('subversion', '2.1')
1339+
1 * mockJobManagement.logPluginDeprecationWarning('subversion', '2.8')
13341340
}
13351341

13361342
def 'call svn with multiple locations'() {
@@ -1350,6 +1356,7 @@ class ScmContextSpec extends Specification {
13501356
context.scmNodes[0].locations[0].'hudson.scm.SubversionSCM_-ModuleLocation'[1].remote[0].value() == 'url2'
13511357
context.scmNodes[0].locations[0].'hudson.scm.SubversionSCM_-ModuleLocation'[1].local[0].value() == 'dir2'
13521358
(1.._) * mockJobManagement.requireMinimumPluginVersion('subversion', '2.1')
1359+
1 * mockJobManagement.logPluginDeprecationWarning('subversion', '2.8')
13531360
}
13541361

13551362
def 'call svn without specifying a local dir for the location'() {
@@ -1364,6 +1371,7 @@ class ScmContextSpec extends Specification {
13641371
context.scmNodes[0].locations[0].'hudson.scm.SubversionSCM_-ModuleLocation'[0].remote[0].value() == 'url'
13651372
context.scmNodes[0].locations[0].'hudson.scm.SubversionSCM_-ModuleLocation'[0].local[0].value() == '.'
13661373
(1.._) * mockJobManagement.requireMinimumPluginVersion('subversion', '2.1')
1374+
1 * mockJobManagement.logPluginDeprecationWarning('subversion', '2.8')
13671375
}
13681376

13691377
@Unroll
@@ -1381,6 +1389,7 @@ class ScmContextSpec extends Specification {
13811389
locations[0].'hudson.scm.SubversionSCM_-ModuleLocation'[0].depthOption[0].value() == xmlValue
13821390
}
13831391
(1.._) * mockJobManagement.requireMinimumPluginVersion('subversion', '2.1')
1392+
1 * mockJobManagement.logPluginDeprecationWarning('subversion', '2.8')
13841393

13851394
where:
13861395
depth || xmlValue
@@ -1401,6 +1410,7 @@ class ScmContextSpec extends Specification {
14011410
isValidSvnScmNode(context.scmNodes[0])
14021411
context.scmNodes[0].workspaceUpdater[0].attributes()['class'] == 'hudson.scm.subversion.UpdateUpdater'
14031412
(1.._) * mockJobManagement.requireMinimumPluginVersion('subversion', '2.1')
1413+
1 * mockJobManagement.logPluginDeprecationWarning('subversion', '2.8')
14041414
}
14051415

14061416
def 'call svn with checkout strategy'() {
@@ -1414,6 +1424,7 @@ class ScmContextSpec extends Specification {
14141424
isValidSvnScmNode(context.scmNodes[0])
14151425
context.scmNodes[0].workspaceUpdater[0].attributes()['class'] == workspaceUpdaterClass
14161426
(1.._) * mockJobManagement.requireMinimumPluginVersion('subversion', '2.1')
1427+
1 * mockJobManagement.logPluginDeprecationWarning('subversion', '2.8')
14171428

14181429
where:
14191430
strategy | workspaceUpdaterClass
@@ -1433,6 +1444,7 @@ class ScmContextSpec extends Specification {
14331444
isValidSvnScmNode(context.scmNodes[0])
14341445
context.scmNodes[0].excludedRegions[0].value() == ''
14351446
(1.._) * mockJobManagement.requireMinimumPluginVersion('subversion', '2.1')
1447+
1 * mockJobManagement.logPluginDeprecationWarning('subversion', '2.8')
14361448
}
14371449

14381450
def 'call svn with single excluded region'() {
@@ -1446,6 +1458,7 @@ class ScmContextSpec extends Specification {
14461458
isValidSvnScmNode(context.scmNodes[0])
14471459
context.scmNodes[0].excludedRegions[0].value() == 'exreg'
14481460
(1.._) * mockJobManagement.requireMinimumPluginVersion('subversion', '2.1')
1461+
1 * mockJobManagement.logPluginDeprecationWarning('subversion', '2.8')
14491462
}
14501463

14511464
def 'call svn with multiple excluded regions'() {
@@ -1460,6 +1473,7 @@ class ScmContextSpec extends Specification {
14601473
isValidSvnScmNode(context.scmNodes[0])
14611474
context.scmNodes[0].excludedRegions[0].value() == 'exreg1\nexreg2'
14621475
(1.._) * mockJobManagement.requireMinimumPluginVersion('subversion', '2.1')
1476+
1 * mockJobManagement.logPluginDeprecationWarning('subversion', '2.8')
14631477
}
14641478

14651479
def 'call svn with a list of excluded regions'() {
@@ -1474,6 +1488,7 @@ class ScmContextSpec extends Specification {
14741488
isValidSvnScmNode(context.scmNodes[0])
14751489
context.scmNodes[0].excludedRegions[0].value() == 'exreg1\nexreg2\nexreg3\nexreg4'
14761490
(1.._) * mockJobManagement.requireMinimumPluginVersion('subversion', '2.1')
1491+
1 * mockJobManagement.logPluginDeprecationWarning('subversion', '2.8')
14771492
}
14781493

14791494
def 'call svn without included regions'() {
@@ -1486,6 +1501,7 @@ class ScmContextSpec extends Specification {
14861501
isValidSvnScmNode(context.scmNodes[0])
14871502
context.scmNodes[0].includedRegions[0].value() == ''
14881503
(1.._) * mockJobManagement.requireMinimumPluginVersion('subversion', '2.1')
1504+
1 * mockJobManagement.logPluginDeprecationWarning('subversion', '2.8')
14891505
}
14901506

14911507
def 'call svn with single included region'() {
@@ -1499,6 +1515,7 @@ class ScmContextSpec extends Specification {
14991515
isValidSvnScmNode(context.scmNodes[0])
15001516
context.scmNodes[0].includedRegions[0].value() == 'increg'
15011517
(1.._) * mockJobManagement.requireMinimumPluginVersion('subversion', '2.1')
1518+
1 * mockJobManagement.logPluginDeprecationWarning('subversion', '2.8')
15021519
}
15031520

15041521
def 'call svn with multiple included regions'() {
@@ -1513,6 +1530,7 @@ class ScmContextSpec extends Specification {
15131530
isValidSvnScmNode(context.scmNodes[0])
15141531
context.scmNodes[0].includedRegions[0].value() == 'increg1\nincreg2'
15151532
(1.._) * mockJobManagement.requireMinimumPluginVersion('subversion', '2.1')
1533+
1 * mockJobManagement.logPluginDeprecationWarning('subversion', '2.8')
15161534
}
15171535

15181536
def 'call svn with a list of included regions'() {
@@ -1527,6 +1545,7 @@ class ScmContextSpec extends Specification {
15271545
isValidSvnScmNode(context.scmNodes[0])
15281546
context.scmNodes[0].includedRegions[0].value() == 'increg1\nincreg2\nincreg3\nincreg4'
15291547
(1.._) * mockJobManagement.requireMinimumPluginVersion('subversion', '2.1')
1548+
1 * mockJobManagement.logPluginDeprecationWarning('subversion', '2.8')
15301549
}
15311550

15321551
def 'call svn without excluded users'() {
@@ -1539,6 +1558,7 @@ class ScmContextSpec extends Specification {
15391558
isValidSvnScmNode(context.scmNodes[0])
15401559
context.scmNodes[0].excludedUsers[0].value() == ''
15411560
(1.._) * mockJobManagement.requireMinimumPluginVersion('subversion', '2.1')
1561+
1 * mockJobManagement.logPluginDeprecationWarning('subversion', '2.8')
15421562
}
15431563

15441564
def 'call svn with single excluded user'() {
@@ -1552,6 +1572,7 @@ class ScmContextSpec extends Specification {
15521572
isValidSvnScmNode(context.scmNodes[0])
15531573
context.scmNodes[0].excludedUsers[0].value() == 'user'
15541574
(1.._) * mockJobManagement.requireMinimumPluginVersion('subversion', '2.1')
1575+
1 * mockJobManagement.logPluginDeprecationWarning('subversion', '2.8')
15551576
}
15561577

15571578
def 'call svn with multiple excluded users'() {
@@ -1566,6 +1587,7 @@ class ScmContextSpec extends Specification {
15661587
isValidSvnScmNode(context.scmNodes[0])
15671588
context.scmNodes[0].excludedUsers[0].value() == 'user1\nuser2'
15681589
(1.._) * mockJobManagement.requireMinimumPluginVersion('subversion', '2.1')
1590+
1 * mockJobManagement.logPluginDeprecationWarning('subversion', '2.8')
15691591
}
15701592

15711593
def 'call svn with a list of excluded users'() {
@@ -1580,6 +1602,7 @@ class ScmContextSpec extends Specification {
15801602
isValidSvnScmNode(context.scmNodes[0])
15811603
context.scmNodes[0].excludedUsers[0].value() == 'user1\nuser2\nuser3\nuser4'
15821604
(1.._) * mockJobManagement.requireMinimumPluginVersion('subversion', '2.1')
1605+
1 * mockJobManagement.logPluginDeprecationWarning('subversion', '2.8')
15831606
}
15841607

15851608
def 'call svn without excluded commit messages'() {
@@ -1592,6 +1615,7 @@ class ScmContextSpec extends Specification {
15921615
isValidSvnScmNode(context.scmNodes[0])
15931616
context.scmNodes[0].excludedCommitMessages[0].value() == ''
15941617
(1.._) * mockJobManagement.requireMinimumPluginVersion('subversion', '2.1')
1618+
1 * mockJobManagement.logPluginDeprecationWarning('subversion', '2.8')
15951619
}
15961620

15971621
def 'call svn with single excluded commit message'() {
@@ -1605,6 +1629,7 @@ class ScmContextSpec extends Specification {
16051629
isValidSvnScmNode(context.scmNodes[0])
16061630
context.scmNodes[0].excludedCommitMessages[0].value() == 'commit'
16071631
(1.._) * mockJobManagement.requireMinimumPluginVersion('subversion', '2.1')
1632+
1 * mockJobManagement.logPluginDeprecationWarning('subversion', '2.8')
16081633
}
16091634

16101635
def 'call svn with multiple excluded commit messages'() {
@@ -1619,6 +1644,7 @@ class ScmContextSpec extends Specification {
16191644
isValidSvnScmNode(context.scmNodes[0])
16201645
context.scmNodes[0].excludedCommitMessages[0].value() == 'commit1\ncommit2'
16211646
(1.._) * mockJobManagement.requireMinimumPluginVersion('subversion', '2.1')
1647+
1 * mockJobManagement.logPluginDeprecationWarning('subversion', '2.8')
16221648
}
16231649

16241650
def 'call svn with a list of excluded commit messages'() {
@@ -1633,6 +1659,7 @@ class ScmContextSpec extends Specification {
16331659
isValidSvnScmNode(context.scmNodes[0])
16341660
context.scmNodes[0].excludedCommitMessages[0].value() == 'commit1\ncommit2\ncommit3\ncommit4'
16351661
(1.._) * mockJobManagement.requireMinimumPluginVersion('subversion', '2.1')
1662+
1 * mockJobManagement.logPluginDeprecationWarning('subversion', '2.8')
16361663
}
16371664

16381665
def 'call svn with a mix of excluded commit message specifications'() {
@@ -1647,6 +1674,7 @@ class ScmContextSpec extends Specification {
16471674
isValidSvnScmNode(context.scmNodes[0])
16481675
context.scmNodes[0].excludedCommitMessages[0].value() == 'commit1\ncommit2\ncommit3'
16491676
(1.._) * mockJobManagement.requireMinimumPluginVersion('subversion', '2.1')
1677+
1 * mockJobManagement.logPluginDeprecationWarning('subversion', '2.8')
16501678
}
16511679

16521680
def 'call svn without excluded revprop'() {
@@ -1659,6 +1687,7 @@ class ScmContextSpec extends Specification {
16591687
isValidSvnScmNode(context.scmNodes[0])
16601688
context.scmNodes[0].excludedRevprop[0].value() == ''
16611689
(1.._) * mockJobManagement.requireMinimumPluginVersion('subversion', '2.1')
1690+
1 * mockJobManagement.logPluginDeprecationWarning('subversion', '2.8')
16621691
}
16631692

16641693
def 'call svn with an excluded revprop'() {
@@ -1672,6 +1701,7 @@ class ScmContextSpec extends Specification {
16721701
isValidSvnScmNode(context.scmNodes[0])
16731702
context.scmNodes[0].excludedRevprop[0].value() == 'revprop'
16741703
(1.._) * mockJobManagement.requireMinimumPluginVersion('subversion', '2.1')
1704+
1 * mockJobManagement.logPluginDeprecationWarning('subversion', '2.8')
16751705
}
16761706

16771707
def 'call svn with configure'() {
@@ -1687,6 +1717,7 @@ class ScmContextSpec extends Specification {
16871717
isValidSvnScmNode(context.scmNodes[0])
16881718
context.scmNodes[0].testNode[0].value() == 'testValue'
16891719
(1.._) * mockJobManagement.requireMinimumPluginVersion('subversion', '2.1')
1720+
1 * mockJobManagement.logPluginDeprecationWarning('subversion', '2.8')
16901721
}
16911722

16921723
def 'call perforceP4 with all options'() {

0 commit comments

Comments
 (0)