Skip to content

Commit a6fa217

Browse files
Switch to Revapi and Matrix JDK builds for all current JDK LTS (#2149)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 4168dd1 commit a6fa217

File tree

6 files changed

+145
-43
lines changed

6 files changed

+145
-43
lines changed

.github/dependabot.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "maven"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"
7+
groups:
8+
dependencies:
9+
patterns:
10+
- "*"
11+
12+
- package-ecosystem: "github-actions"
13+
directory: "/"
14+
schedule:
15+
interval: "monthly"
16+
groups:
17+
actions:
18+
patterns:
19+
- "*"

.github/workflows/maven.yml

Lines changed: 38 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
# This workflow is designed to build PRs for AHC. Note that it does not actually publish AHC, just builds and test it.
1+
# This workflow builds and tests PRs for AHC.
22
# Docs: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
33

44
name: Build PR
5+
permissions:
6+
contents: read
57

68
on:
79
push:
@@ -17,39 +19,51 @@ on:
1719
default: 'Github Actions'
1820

1921
jobs:
20-
RunOnLinux:
22+
compile-and-check:
2123
runs-on: ubuntu-latest
2224
steps:
2325
- uses: actions/checkout@v4
24-
- name: Grant Permission
25-
run: sudo chmod +x ./mvnw
2626
- uses: actions/setup-java@v4
2727
with:
2828
distribution: 'corretto'
2929
java-version: '11'
30-
- name: Run Tests (force Docker tests)
31-
run: ./mvnw -B -ntp clean test -Ddocker.tests=true
32-
33-
RunOnMacOs:
34-
runs-on: macos-latest
35-
steps:
36-
- uses: actions/checkout@v4
3730
- name: Grant Permission
38-
run: sudo chmod +x ./mvnw
39-
- uses: actions/setup-java@v4
40-
with:
41-
distribution: 'corretto'
42-
java-version: '11'
43-
- name: Run Tests (force Docker tests)
44-
run: ./mvnw -B -ntp clean test -Ddocker.tests=true
31+
run: chmod +x ./mvnw
32+
- name: Compile and API compatibility check
33+
run: ./mvnw -B -ntp clean verify -DskipTests -Dgpg.skip=true
4534

46-
RunOnWindows:
47-
runs-on: windows-latest
35+
test:
36+
needs: compile-and-check
37+
strategy:
38+
fail-fast: false
39+
matrix:
40+
os: [ubuntu-latest, macos-latest, windows-latest]
41+
jdk: [11, 17, 21, 25]
42+
include:
43+
- jdk: 11
44+
distribution: corretto
45+
- jdk: 17
46+
distribution: corretto
47+
- jdk: 21
48+
distribution: corretto
49+
- jdk: 25
50+
distribution: corretto
51+
runs-on: ${{ matrix.os }}
4852
steps:
4953
- uses: actions/checkout@v4
5054
- uses: actions/setup-java@v4
5155
with:
52-
distribution: 'corretto'
53-
java-version: '11'
54-
- name: Run Tests
55-
run: ./mvnw.cmd -B -ntp clean test
56+
distribution: ${{ matrix.distribution }}
57+
java-version: ${{ matrix.jdk }}
58+
- name: Grant Permission
59+
if: runner.os != 'Windows'
60+
run: chmod +x ./mvnw
61+
- name: Run Tests (Linux)
62+
if: runner.os == 'Linux'
63+
run: ./mvnw -B -ntp clean test -Ddocker.tests=true
64+
- name: Run Tests (macOS)
65+
if: runner.os == 'macOS'
66+
run: ./mvnw -B -ntp clean test -Dno.docker.tests=true
67+
- name: Run Tests (Windows)
68+
if: runner.os == 'Windows'
69+
run: ./mvnw.cmd -B -ntp clean test "-Dno.docker.tests=true"

client/pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,13 @@
180180
<scope>test</scope>
181181
</dependency>
182182

183+
<dependency>
184+
<groupId>io.netty</groupId>
185+
<artifactId>netty-pkitesting</artifactId>
186+
<version>${netty.version}</version>
187+
<scope>test</scope>
188+
</dependency>
189+
183190
<!-- Testcontainers for Docker-based integration tests -->
184191
<dependency>
185192
<groupId>org.testcontainers</groupId>

client/src/test/java/org/asynchttpclient/BasicHttp2Test.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@
4545
import io.netty.handler.ssl.ApplicationProtocolNames;
4646
import io.netty.handler.ssl.SslContext;
4747
import io.netty.handler.ssl.SslContextBuilder;
48-
import io.netty.handler.ssl.util.SelfSignedCertificate;
48+
import io.netty.pkitesting.CertificateBuilder;
49+
import io.netty.pkitesting.X509Bundle;
4950
import io.netty.util.concurrent.GlobalEventExecutor;
5051
import org.asynchttpclient.test.EventCollectingHandler;
5152
import org.junit.jupiter.api.AfterEach;
@@ -335,9 +336,12 @@ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
335336

336337
@BeforeEach
337338
public void startServer() throws Exception {
338-
SelfSignedCertificate ssc = new SelfSignedCertificate();
339+
X509Bundle bundle = new CertificateBuilder()
340+
.subject("CN=localhost")
341+
.setIsCertificateAuthority(true)
342+
.buildSelfSigned();
339343

340-
serverSslCtx = SslContextBuilder.forServer(ssc.certificate(), ssc.privateKey())
344+
serverSslCtx = SslContextBuilder.forServer(bundle.toKeyManagerFactory())
341345
.applicationProtocolConfig(new ApplicationProtocolConfig(
342346
ApplicationProtocolConfig.Protocol.ALPN,
343347
ApplicationProtocolConfig.SelectorFailureBehavior.NO_ADVERTISE,

client/src/test/java/org/asynchttpclient/request/body/multipart/MultipartBasicAuthTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public AbstractHandler configureHandler() throws Exception {
6262
}
6363

6464
private void expectHttpResponse(Function<BoundRequestBuilder, BoundRequestBuilder> f, int expectedResponseCode) throws Throwable {
65-
File file = createTempFile(1024 * 1024);
65+
File file = createTempFile(1024);
6666

6767
try (AsyncHttpClient client = asyncHttpClient()) {
6868
Response response = f.apply(client.preparePut(getTargetUrl()).addBodyPart(new FilePart("test", file, APPLICATION_OCTET_STREAM.toString(), UTF_8)))

pom.xml

Lines changed: 73 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -429,31 +429,89 @@
429429
</plugin>
430430

431431
<plugin>
432-
<groupId>com.github.siom79.japicmp</groupId>
433-
<artifactId>japicmp-maven-plugin</artifactId>
434-
<version>0.23.1</version>
432+
<groupId>org.revapi</groupId>
433+
<artifactId>revapi-maven-plugin</artifactId>
434+
<version>0.15.0</version>
435+
<dependencies>
436+
<dependency>
437+
<groupId>org.revapi</groupId>
438+
<artifactId>revapi-java</artifactId>
439+
<version>0.28.1</version>
440+
</dependency>
441+
</dependencies>
435442
<configuration>
436-
<version>
437-
<old>RELEASE</old>
438-
<new>${project.version}</new>
439-
</version>
440-
<parameter>
441-
<onlyModified>true</onlyModified>
442-
<breakBuildOnBinaryIncompatibleModifications>true</breakBuildOnBinaryIncompatibleModifications>
443-
<breakBuildOnSourceIncompatibleModifications>true</breakBuildOnSourceIncompatibleModifications>
444-
<includeSynthetic>false</includeSynthetic>
445-
<accessModifier>public</accessModifier>
446-
</parameter>
443+
<oldArtifacts>
444+
<artifact>org.asynchttpclient:async-http-client:RELEASE</artifact>
445+
</oldArtifacts>
446+
<newArtifacts>
447+
<artifact>${project.groupId}:${project.artifactId}:${project.version}</artifact>
448+
</newArtifacts>
449+
<analysisConfiguration>
450+
<![CDATA[
451+
[
452+
{
453+
"extension": "revapi.differences",
454+
"configuration": {
455+
"ignore": true,
456+
"differences": [
457+
{
458+
"code": "java.class.externalClassExposedInAPI",
459+
"justification": "Netty types are part of the public API by design"
460+
},
461+
{
462+
"code": "java.class.nonPublicPartOfAPI",
463+
"justification": "Internal classes exposed via public methods are intentional"
464+
}
465+
]
466+
}
467+
}
468+
]
469+
]]>
470+
</analysisConfiguration>
447471
</configuration>
448472
<executions>
449473
<execution>
450474
<goals>
451-
<goal>cmp</goal>
475+
<goal>check</goal>
452476
</goals>
453477
<phase>verify</phase>
454478
</execution>
455479
</executions>
456480
</plugin>
457481
</plugins>
458482
</build>
483+
484+
<profiles>
485+
<profile>
486+
<id>errorprone-jdk25</id>
487+
<activation>
488+
<jdk>[25,)</jdk>
489+
</activation>
490+
<build>
491+
<plugins>
492+
<plugin>
493+
<groupId>org.apache.maven.plugins</groupId>
494+
<artifactId>maven-compiler-plugin</artifactId>
495+
<configuration>
496+
<compilerArgs combine.children="append">
497+
<arg>--should-stop=ifError=FLOW</arg>
498+
</compilerArgs>
499+
<annotationProcessorPaths combine.self="override">
500+
<path>
501+
<groupId>com.google.errorprone</groupId>
502+
<artifactId>error_prone_core</artifactId>
503+
<version>2.48.0</version>
504+
</path>
505+
<path>
506+
<groupId>com.uber.nullaway</groupId>
507+
<artifactId>nullaway</artifactId>
508+
<version>0.13.1</version>
509+
</path>
510+
</annotationProcessorPaths>
511+
</configuration>
512+
</plugin>
513+
</plugins>
514+
</build>
515+
</profile>
516+
</profiles>
459517
</project>

0 commit comments

Comments
 (0)