Skip to content

Commit

Permalink
[JENKINS-73135] Require Jenkins 2.472, adapt tests for Jetty 12 EE 8 (#…
Browse files Browse the repository at this point in the history
…1678)

* [JENKINS-73135] adapt gitlab-plugin for jetty12

* Format with spotless

* Use newer Jenkins LTS baseline for BOM

Also include a TODO comment to restore the jenkins.version based on jenkins.baseline once an LTS baseline is available that includes 2.472.

---------

Co-authored-by: Mark Waite <mark.earl.waite@gmail.com>
  • Loading branch information
ampuscas and MarkEWaite authored Aug 13, 2024
1 parent aee213f commit 68a2f37
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
8 changes: 6 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,18 @@
<properties>
<revision>1.8.2</revision>
<changelist>-SNAPSHOT</changelist>
<jenkins.baseline>2.440</jenkins.baseline>
<jenkins.version>${jenkins.baseline}.3</jenkins.version>
<jenkins.baseline>2.462</jenkins.baseline>
<!-- <jenkins.version>${jenkins.baseline}.3</jenkins.version> -->
<!-- TODO: Remove when 2.472 is available in LTS -->
<jenkins.version>2.472</jenkins.version>
<spotbugs.effort>Max</spotbugs.effort>
<spotbugs.threshold>Low</spotbugs.threshold>
<gitHubRepo>jenkinsci/${project.artifactId}</gitHubRepo>
<hpi.compatibleSinceVersion>1.4.0</hpi.compatibleSinceVersion>
<mockserver.version>5.15.0</mockserver.version>
<spotless.check.skip>false</spotless.check.skip>
<jenkins-test-harness.version>2250.v03a_1295b_0a_30</jenkins-test-harness.version>
<maven.compiler.release>17</maven.compiler.release>
</properties>

<dependencyManagement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,20 @@
import hudson.util.Secret;
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jenkins.model.Jenkins;
import org.eclipse.jetty.http.HttpStatus;
import org.eclipse.jetty.http.HttpVersion;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.HttpConfiguration;
import org.eclipse.jetty.server.HttpConnectionFactory;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.Response;
import org.eclipse.jetty.server.SecureRequestCustomizer;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.server.SslConnectionFactory;
import org.eclipse.jetty.server.handler.AbstractHandler;
import org.eclipse.jetty.server.handler.HandlerCollection;
import org.eclipse.jetty.util.Callback;
import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.jenkinsci.plugins.plaincredentials.impl.StringCredentialsImpl;
import org.junit.AfterClass;
Expand Down Expand Up @@ -128,18 +126,13 @@ public static void startJetty() throws Exception {
// Set the connectors
server.setConnectors(new Connector[] {http, https});

HandlerCollection handlerCollection = new HandlerCollection();
handlerCollection.setHandlers(new Handler[] {
new AbstractHandler() {
public void handle(
String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
response.setStatus(HttpServletResponse.SC_OK);
baseRequest.setHandled(true);
}
server.setHandler(new Handler.Abstract() {
@Override
public boolean handle(Request request, Response response, Callback callback) throws IOException {
response.setStatus(HttpStatus.OK_200);
return true;
}
});
server.setHandler(handlerCollection);
server.start();
}

Expand Down

0 comments on commit 68a2f37

Please sign in to comment.