Skip to content

Commit ea5defc

Browse files
committed
Merge remote-tracking branch 'origin/master' into instrumentation-callback-after-reactive-publishers-finish
# Conflicts: # src/test/groovy/graphql/TestUtil.groovy # src/test/groovy/graphql/execution/SubscriptionExecutionStrategyTest.groovy # src/test/groovy/graphql/execution/instrumentation/InstrumentationTest.groovy
2 parents d064c7f + dcafe23 commit ea5defc

117 files changed

Lines changed: 49775 additions & 884 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/copilot-instructions.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# GitHub Copilot Instructions
2+
3+
## Code Style and Conventions
4+
5+
- Don't use fully qualified names for Java, Kotlin, or Groovy. Instead, add imports.
6+
- Don't use wildcard imports. Please import items one by one instead. You can disable wildcard imports in your IDE
7+
- Follow the code style defined in `graphql-java-code-style.xml`.
8+
9+
## Pull Request Review Guidelines
10+
11+
### Testing
12+
- If you add new functionality, or correct a bug, you must also write a test so we can ensure your code works in the future
13+
- If your pull request includes a performance improvement, please check in a JMH test to verify this. We'll then run a test on our isolated performance environment to verify the results
14+
-
15+
### Breaking Changes
16+
- Flag any breaking changes in public APIs so we can call this out in documentation

.github/workflows/commit_performance_result.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
commitPerformanceResults:
1818
runs-on: ubuntu-latest
1919
steps:
20-
- uses: aws-actions/configure-aws-credentials@v4
20+
- uses: aws-actions/configure-aws-credentials@v5
2121
with:
2222
role-to-assume: arn:aws:iam::637423498965:role/GitHubActionGrahQLJava
2323
aws-region: "ap-southeast-2"

.github/workflows/master.yml

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,21 @@ on:
77
permissions: # For test summary bot
88
checks: write
99
jobs:
10-
buildAndPublish:
10+
buildAndTest:
1111
runs-on: ubuntu-latest
12-
env:
13-
MAVEN_CENTRAL_USER: ${{ secrets.MAVEN_CENTRAL_USER }}
14-
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
15-
MAVEN_CENTRAL_USER_NEW: ${{ secrets.MAVEN_CENTRAL_USER_NEW }}
16-
MAVEN_CENTRAL_PASSWORD_NEW: ${{ secrets.MAVEN_CENTRAL_PASSWORD_NEW }}
17-
MAVEN_CENTRAL_PGP_KEY: ${{ secrets.MAVEN_CENTRAL_PGP_KEY }}
18-
12+
strategy:
13+
matrix:
14+
gradle-argument: [ 'assemble && ./gradlew check -x test','testWithJava11', 'testWithJava17', 'test -x testWithJava11 -x testWithJava17' ]
1915
steps:
2016
- uses: actions/checkout@v5
21-
- uses: gradle/actions/wrapper-validation@v4
17+
- uses: gradle/actions/wrapper-validation@v5
2218
- name: Set up JDK 21
23-
uses: actions/setup-java@v4
19+
uses: actions/setup-java@v5
2420
with:
2521
java-version: '21'
2622
distribution: 'corretto'
27-
- name: build test and publish
28-
run: ./gradlew assemble && ./gradlew check --info && ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository -x check --info --stacktrace
23+
- name: build and test
24+
run: ./gradlew ${{matrix.gradle-argument}} --info --stacktrace
2925
- name: Publish Test Results
3026
uses: EnricoMi/publish-unit-test-result-action@v2.20.0
3127
if: always()
@@ -34,3 +30,23 @@ jobs:
3430
**/build/test-results/test/TEST-*.xml
3531
**/build/test-results/testWithJava11/TEST-*.xml
3632
**/build/test-results/testWithJava17/TEST-*.xml
33+
publishToMavenCentral:
34+
needs: buildAndTest
35+
runs-on: ubuntu-latest
36+
env:
37+
MAVEN_CENTRAL_USER: ${{ secrets.MAVEN_CENTRAL_USER }}
38+
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
39+
MAVEN_CENTRAL_USER_NEW: ${{ secrets.MAVEN_CENTRAL_USER_NEW }}
40+
MAVEN_CENTRAL_PASSWORD_NEW: ${{ secrets.MAVEN_CENTRAL_PASSWORD_NEW }}
41+
MAVEN_CENTRAL_PGP_KEY: ${{ secrets.MAVEN_CENTRAL_PGP_KEY }}
42+
43+
steps:
44+
- uses: actions/checkout@v5
45+
- uses: gradle/actions/wrapper-validation@v5
46+
- name: Set up JDK 21
47+
uses: actions/setup-java@v5
48+
with:
49+
java-version: '21'
50+
distribution: 'corretto'
51+
- name: publishToMavenCentral
52+
run: ./gradlew assemble && ./gradlew check -x test -x testng --info && ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository -x check --info --stacktrace

.github/workflows/publish_commit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
if: github.event.pull_request.merged == true
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: aws-actions/configure-aws-credentials@v4
18+
- uses: aws-actions/configure-aws-credentials@v5
1919
with:
2020
role-to-assume: arn:aws:iam::637423498965:role/GitHubActionGrahQLJava
2121
aws-region: "ap-southeast-2"

.github/workflows/pull_request.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,24 @@ permissions: # For test comment bot
1818
jobs:
1919
buildAndTest:
2020
runs-on: ubuntu-latest
21+
strategy:
22+
matrix:
23+
gradle-argument: [ 'assemble && ./gradlew check -x test','testWithJava11', 'testWithJava17', 'test -x testWithJava11 -x testWithJava17' ]
2124
steps:
2225
- uses: actions/checkout@v5
23-
- uses: gradle/actions/wrapper-validation@v4
26+
- uses: gradle/actions/wrapper-validation@v5
2427
- name: Set up JDK 21
25-
uses: actions/setup-java@v4
28+
uses: actions/setup-java@v5
2629
with:
2730
java-version: '21'
2831
distribution: 'corretto'
2932
- name: build and test
30-
run: ./gradlew assemble && ./gradlew check --info --stacktrace
33+
run: ./gradlew ${{matrix.gradle-argument}} --info --stacktrace
3134
- name: Publish Test Results
3235
uses: EnricoMi/publish-unit-test-result-action@v2.20.0
3336
if: always()
3437
with:
35-
files: '**/build/test-results/test/TEST-*.xml'
36-
38+
files: |
39+
**/build/test-results/test/TEST-*.xml
40+
**/build/test-results/testWithJava11/TEST-*.xml
41+
**/build/test-results/testWithJava17/TEST-*.xml

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ jobs:
2020

2121
steps:
2222
- uses: actions/checkout@v5
23-
- uses: gradle/actions/wrapper-validation@v4
23+
- uses: gradle/actions/wrapper-validation@v5
2424
- name: Set up JDK 21
25-
uses: actions/setup-java@v4
25+
uses: actions/setup-java@v5
2626
with:
2727
java-version: '21'
2828
distribution: 'corretto'

.github/workflows/stale-pr-issue.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
close-pending:
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/stale@v9
19+
- uses: actions/stale@v10
2020
with:
2121
# GLOBAL ------------------------------------------------------------
2222
# Exempt any PRs or issues already added to a milestone

build.gradle

Lines changed: 51 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ plugins {
1010
id 'maven-publish'
1111
id 'antlr'
1212
id 'signing'
13-
id "com.gradleup.shadow" version "9.0.1"
13+
id "com.gradleup.shadow" version "8.3.8"
1414
id "biz.aQute.bnd.builder" version "6.4.0"
1515
id "io.github.gradle-nexus.publish-plugin" version "2.0.0"
1616
id "groovy"
1717
id "me.champeau.jmh" version "0.7.3"
1818
id "net.ltgt.errorprone" version '4.3.0'
1919
//
2020
// Kotlin just for tests - not production code
21-
id 'org.jetbrains.kotlin.jvm' version '2.2.0'
21+
id 'org.jetbrains.kotlin.jvm' version '2.2.21'
2222
}
2323

2424
java {
@@ -119,7 +119,7 @@ jar {
119119
}
120120

121121
dependencies {
122-
api 'com.graphql-java:java-dataloader:5.0.2'
122+
api 'com.graphql-java:java-dataloader:5.0.3'
123123
api 'org.reactivestreams:reactive-streams:' + reactiveStreamsVersion
124124
api "org.jspecify:jspecify:1.0.0"
125125

@@ -128,19 +128,19 @@ dependencies {
128128

129129
testImplementation group: 'junit', name: 'junit', version: '4.13.2'
130130
testImplementation 'org.spockframework:spock-core:2.3-groovy-4.0'
131-
testImplementation 'net.bytebuddy:byte-buddy:1.17.6'
131+
testImplementation 'net.bytebuddy:byte-buddy:1.17.8'
132132
testImplementation 'org.objenesis:objenesis:3.4'
133133
testImplementation 'org.apache.groovy:groovy:4.0.28"'
134134
testImplementation 'org.apache.groovy:groovy-json:4.0.28'
135-
testImplementation 'com.google.code.gson:gson:2.13.1'
136-
testImplementation 'org.eclipse.jetty:jetty-server:11.0.25'
137-
testImplementation 'com.fasterxml.jackson.core:jackson-databind:2.19.2'
135+
testImplementation 'com.google.code.gson:gson:2.13.2'
136+
testImplementation 'org.eclipse.jetty:jetty-server:11.0.26'
137+
testImplementation 'com.fasterxml.jackson.core:jackson-databind:2.20.0'
138138
testImplementation 'org.awaitility:awaitility-groovy:4.3.0'
139139
testImplementation 'com.github.javafaker:javafaker:1.0.2'
140140

141141
testImplementation 'org.reactivestreams:reactive-streams-tck:' + reactiveStreamsVersion
142142
testImplementation "io.reactivex.rxjava2:rxjava:2.2.21"
143-
testImplementation "io.projectreactor:reactor-core:3.7.8"
143+
testImplementation "io.projectreactor:reactor-core:3.7.12"
144144

145145
testImplementation 'org.testng:testng:7.11.0' // use for reactive streams test inheritance
146146
testImplementation "com.tngtech.archunit:archunit-junit5:1.4.1"
@@ -155,11 +155,11 @@ dependencies {
155155
// comment this in if you want to run JMH benchmarks from idea
156156
// jmhAnnotationProcessor 'org.openjdk.jmh:jmh-generator-annprocess:1.37'
157157

158-
errorprone 'com.uber.nullaway:nullaway:0.12.8'
159-
errorprone 'com.google.errorprone:error_prone_core:2.41.0'
158+
errorprone 'com.uber.nullaway:nullaway:0.12.10'
159+
errorprone 'com.google.errorprone:error_prone_core:2.43.0'
160160

161161
// just tests - no Kotlin otherwise
162-
testCompileOnly 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
162+
testImplementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
163163
}
164164

165165
shadowJar {
@@ -309,6 +309,10 @@ artifacts {
309309
}
310310

311311
List<TestDescriptor> failedTests = []
312+
Map<String, Integer> testsAndTime = [:]
313+
Map<String, Integer> testClassesAndTime = [:]
314+
int testCount = 0
315+
long testTime = 0L
312316

313317
tasks.withType(Test) {
314318
useJUnitPlatform()
@@ -322,9 +326,19 @@ tasks.withType(Test) {
322326
dependsOn "jmhClasses"
323327

324328
afterTest { TestDescriptor descriptor, TestResult result ->
329+
testCount++
325330
if (result.getFailedTestCount() > 0) {
326331
failedTests.add(descriptor)
327332
}
333+
def ms = (int) (result.endTime - result.startTime)
334+
testTime += ms
335+
String className = descriptor.className ?: "unknown"
336+
String name = className + "." + descriptor.displayName
337+
if (ms > 500) {
338+
testsAndTime[name] = ms
339+
testClassesAndTime.compute(className) { k, v -> v == null ? ms : v + ms }
340+
println "\tTest '$name' took ${ms}ms"
341+
}
328342
}
329343
}
330344

@@ -349,6 +363,10 @@ test.dependsOn testWithJava11
349363
* See https://github.com/gradle/gradle/issues/20151
350364
*/
351365
gradle.buildFinished {
366+
println "\n\n"
367+
println "============================"
368+
println "$testCount tests run in $testTime ms"
369+
println "============================"
352370
if (!failedTests.isEmpty()) {
353371
println "\n\n"
354372
println "============================"
@@ -359,6 +377,28 @@ gradle.buildFinished {
359377
}
360378
println "============================"
361379
}
380+
// slowest tests
381+
println "\n\n"
382+
println "============================"
383+
println "Top 20 slowest test classes"
384+
println "============================"
385+
showTestResults(testClassesAndTime,20) { e ->
386+
println "\tTest class ${e.key} took ${e.value}ms"
387+
}
388+
println "\n\n"
389+
println "============================"
390+
println "Top 50 slowest tests"
391+
println "============================"
392+
showTestResults(testsAndTime,50) { e ->
393+
println "\tTest ${e.key} took ${e.value}ms"
394+
}
395+
}
396+
397+
static private showTestResults(Map<String, Integer> testMap, int limit, Closure closure) {
398+
testMap.entrySet().stream()
399+
.sorted { e1, e2 -> e2.getValue() - e1.getValue() }
400+
.limit(limit)
401+
.forEach(closure)
362402
}
363403

364404

gradle.properties

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,9 @@ org.gradle.caching=true
22
org.gradle.daemon=true
33
org.gradle.parallel=true
44
org.gradle.jvmargs=-Dfile.encoding=UTF-8
5+
6+
7+
# Prevents the Kotlin stdlib being a POM dependency
8+
#
9+
# https://kotlinlang.org/docs/gradle-configure-project.html#dependency-on-the-standard-library
10+
kotlin.stdlib.default.dependency=false

0 commit comments

Comments
 (0)