Skip to content

Conversation

basil
Copy link
Member

@basil basil commented Mar 26, 2025

When testing this plugin against EE 10, I found the same test-only (not production) issues in GitHubServerConfigIntegrationTest as I did when testing this plugin against EE 9. Rather than continue to adapt this test for every EE version, this PR removes any references to Jetty or Jakarta EE from the test, making the test less fragile. In their place, we substitute references to standard Java Platform functionality.

Testing done

mvn clean verify with Java 21

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@basil basil requested a review from a team as a code owner March 26, 2025 21:38
@basil basil added the test label Mar 26, 2025
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>5.2</version>
<version>5.9</version>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not strictly necessary for this PR, but taking advantage of the build/test cycle to update this plugin's metadata while I am here.

@@ -39,7 +39,7 @@
<connection>scm:git:https://github.com/${gitHubRepo}.git</connection>
<developerConnection>scm:git:git@github.com:${gitHubRepo}.git</developerConnection>
<url>https://github.com/${gitHubRepo}</url>
<tag>v1.42.0</tag>
<tag>${scmTag}</tag>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Matching the archetype, and also needed to get an incremental build for testing.

@@ -52,7 +52,7 @@
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
<!-- https://www.jenkins.io/doc/developer/plugin-development/choosing-jenkins-baseline/ -->
<jenkins.baseline>2.479</jenkins.baseline>
<jenkins.version>${jenkins.baseline}.1</jenkins.version>
<jenkins.version>${jenkins.baseline}.3</jenkins.version>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -206,7 +206,7 @@
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-${jenkins.baseline}.x</artifactId>
<version>3559.vb_5b_81183b_d23</version>
<version>4488.v7fe26526366e</version>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -96,7 +95,6 @@ public static Path getBaseCacheDir() {
*
* @param configs active server configs to exclude caches from cleanup
*/
@SuppressFBWarnings(value = "RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was needed in a previous version of SpotBugs, but it is not needed in the very latest version of SpotBugs (pulled in via the latest plugin parent POM). The latest version actually complains about an unnecessary suppression, so remove it here to fix that warning.

import net.sf.json.JSONObject;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.ee9.servlet.DefaultServlet;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No more references to a specific EE version, making this test robust against future EE upgrades (including EE 10).

@KostyaSha KostyaSha merged commit 0b272ae into jenkinsci:master Mar 26, 2025
17 checks passed
@basil basil deleted the jetty branch March 26, 2025 23:18
@basil
Copy link
Member Author

basil commented Mar 27, 2025

Thanks @KostyaSha! Could this please be released at some point? Eventually (not just yet, though), it will be needed for jenkinsci/bom#4779.

@KostyaSha
Copy link
Member

just ping me and i'll do it

@basil
Copy link
Member Author

basil commented Mar 28, 2025

Thanks @KostyaSha, from my perspective this is ready to release.

@KostyaSha
Copy link
Member

you are welcome, done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants