Skip to content

Commit

Permalink
Add conditional build step plugin to fix BOM tests (#1375)
Browse files Browse the repository at this point in the history
Notes from Basil Crow:

Can be reproduced in git-plugin by running

```
$ mvn -Denforcer.skip=true \
-Dhpi-plugin.version=3.37 -Djenkins.version=2.381 \
-Djth.jenkins-war.path=~/src/jenkinsci/bom/target/local-test/megawar.war \
-DoverrideWar=~/src/jenkinsci/bom/target/local-test/megawar.war \
-DoverrideWarAdditions=true -Dtest=InjectedTest \
-DupperBoundsExcludes=javax.servlet:servlet-api -DuseUpperBounds=true \
clean verify
```

after running

```
$ PLUGINS=git TEST=InjectedTest bash local-test.sh
```

in bom to build the megawar.

Bisection shows the trouble started occurring at #1369
which updated parameterized-trigger from 2.39 to 2.43.1, which in
turn updated conditional-buildstep from 1.3.1 to 1.4.1, which in turn
put maven-plugin on the compile classpath. Turns out that declaring
maven-plugin as non-optional was a bug in conditional-buildstep 1.4.1,
fixed in 1.4.2 with jenkinsci/conditional-buildstep-plugin#27.

Verified that the problem can be successfully worked around in git-plugin
by downgrading parameterized-trigger back to 2.39 (which also downgrades
conditional-buildstep down to 1.3.1) or upgrading conditional-buildstep
to 1.4.2 with

diff --git a/pom.xml b/pom.xml
index 3753e57c..e187d4f4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -79,6 +79,11 @@
         <type>pom</type>
         <scope>import</scope>
       </dependency>
+      <dependency>
+        <groupId>org.jenkins-ci.plugins</groupId>
+        <artifactId>conditional-buildstep</artifactId>
+        <version>1.4.2</version>
+      </dependency>
     </dependencies>
   </dependencyManagement>

But a better solution would be to upgrade conditional-buildstep
to 1.4.2 in parameterized-trigger; i.e., releasing
jenkinsci/parameterized-trigger-plugin#252 and then upgrading to that
release in the Git plugin.
  • Loading branch information
MarkEWaite committed Dec 11, 2022
1 parent ede4855 commit fef498d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pom.xml
Expand Up @@ -163,6 +163,17 @@
<version>2.43.1</version>
<optional>true</optional>
</dependency>
<dependency>
<!-- BOM automated tests fail without conditional-buildstep plugin -->
<!-- TODO: Remove this dependency when parameterized trigger plugin dependency fix is released -->
<!-- https://github.com/jenkinsci/bom/pull/1623#issuecomment-1339989438 -->
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>conditional-buildstep</artifactId>
<version>1.4.2</version>
<optional>true</optional>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>token-macro</artifactId>
Expand Down

0 comments on commit fef498d

Please sign in to comment.