Skip to content

Commit 5defbdd

Browse files
committed
Merge latest master into merged-field complexity limits
Preserve iterative validation and fragment expansion while recording occurrence totals in traversal frames. Update fragment stack-safety tests to check merged fields and expanded occurrences separately.
2 parents c5e3cec + 5b1a5f4 commit 5defbdd

63 files changed

Lines changed: 3104 additions & 1182 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/workflows/master.yml‎

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ jobs:
1414
include:
1515
- gradle-argument: 'assemble && ./gradlew check -x test -x testng'
1616
label: 'check'
17-
- gradle-argument: 'testWithJava11 testngWithJava11'
18-
label: 'java11'
19-
test-results-dirs: 'testWithJava11 testngWithJava11'
2017
- gradle-argument: 'testWithJava17 testngWithJava17'
2118
label: 'java17'
2219
test-results-dirs: 'testWithJava17 testngWithJava17'
@@ -32,7 +29,7 @@ jobs:
3229
- uses: actions/checkout@v6.0.2
3330
- uses: gradle/actions/wrapper-validation@v6
3431
- name: Set up JDK 25
35-
uses: actions/setup-java@v6.0.1
32+
uses: actions/setup-java@v6.1.0
3633
with:
3734
java-version: '25'
3835
distribution: 'corretto'
@@ -125,7 +122,7 @@ jobs:
125122
const path = require('path');
126123
const { parseJacocoXml } = require('./.github/scripts/parse-jacoco.js');
127124
128-
const versions = ['java11', 'java17', 'java21', 'java25', 'jcstress'];
125+
const versions = ['java17', 'java21', 'java25', 'jcstress'];
129126
const zeroTest = { total: 0, passed: 0, failed: 0, errors: 0, skipped: 0 };
130127
131128
// Read current baseline
@@ -136,13 +133,14 @@ jobs:
136133
}
137134
138135
// Update test stats from artifacts
139-
const tests = baseline.tests || {};
136+
const previousTests = baseline.tests || {};
137+
const tests = {};
140138
for (const v of versions) {
141139
const file = path.join('test-stats', `${v}.json`);
142140
if (fs.existsSync(file)) {
143141
tests[v] = JSON.parse(fs.readFileSync(file, 'utf8'));
144142
} else {
145-
tests[v] = tests[v] || zeroTest;
143+
tests[v] = previousTests[v] || zeroTest;
146144
}
147145
}
148146
@@ -167,7 +165,7 @@ jobs:
167165
- uses: actions/checkout@v6.0.2
168166
- uses: gradle/actions/wrapper-validation@v6
169167
- name: Set up JDK 25
170-
uses: actions/setup-java@v6.0.1
168+
uses: actions/setup-java@v6.1.0
171169
with:
172170
java-version: '25'
173171
distribution: 'corretto'
@@ -215,7 +213,7 @@ jobs:
215213
- uses: actions/checkout@v6.0.2
216214
- uses: gradle/actions/wrapper-validation@v6
217215
- name: Set up JDK 25
218-
uses: actions/setup-java@v6.0.1
216+
uses: actions/setup-java@v6.1.0
219217
with:
220218
java-version: '25'
221219
distribution: 'corretto'

‎.github/workflows/pr-report.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
6767
const { parseJacocoXml, pct, zeroCov, isRegression } = require('./.github/scripts/parse-jacoco.js');
6868
69-
const versions = ['java11', 'java17', 'java21', 'java25', 'jcstress'];
69+
const versions = ['java17', 'java21', 'java25', 'jcstress'];
7070
const zeroTest = { total: 0, passed: 0, failed: 0, errors: 0, skipped: 0 };
7171
7272
// --- Read current test stats from artifacts ---

‎.github/workflows/pull_request.yml‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ jobs:
2222
include:
2323
- gradle-argument: 'assemble && ./gradlew check -x test -x testng'
2424
label: 'check'
25-
- gradle-argument: 'testWithJava11 testngWithJava11'
26-
label: 'java11'
27-
test-results-dirs: 'testWithJava11 testngWithJava11'
2825
- gradle-argument: 'testWithJava17 testngWithJava17'
2926
label: 'java17'
3027
test-results-dirs: 'testWithJava17 testngWithJava17'
@@ -40,7 +37,7 @@ jobs:
4037
- uses: actions/checkout@v6.0.2
4138
- uses: gradle/actions/wrapper-validation@v6
4239
- name: Set up JDK 25
43-
uses: actions/setup-java@v6.0.1
40+
uses: actions/setup-java@v6.1.0
4441
with:
4542
java-version: '25'
4643
distribution: 'corretto'
@@ -219,7 +216,7 @@ jobs:
219216
- uses: actions/checkout@v6.0.2
220217
- uses: gradle/actions/wrapper-validation@v6
221218
- name: Set up JDK 25
222-
uses: actions/setup-java@v6.0.1
219+
uses: actions/setup-java@v6.1.0
223220
with:
224221
java-version: '25'
225222
distribution: 'corretto'

‎.github/workflows/release.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- uses: actions/checkout@v6.0.2
2424
- uses: gradle/actions/wrapper-validation@v6
2525
- name: Set up JDK 25
26-
uses: actions/setup-java@v6.0.1
26+
uses: actions/setup-java@v6.1.0
2727
with:
2828
java-version: '25'
2929
distribution: 'corretto'

‎.github/workflows/static.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Checkout
3232
uses: actions/checkout@v6.0.2
3333
- name: Set up JDK 25
34-
uses: actions/setup-java@v6.0.1
34+
uses: actions/setup-java@v6.1.0
3535
with:
3636
distribution: 'corretto'
3737
java-version: '25'

‎AGENTS.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@
1818
./gradlew test
1919
```
2020

21-
This runs tests on Java 25 only. Other JVM versions (11, 17, 21) require explicit tasks (e.g. `testWithJava11`).
21+
The library requires Java 17 or later; the build toolchain uses Java 25.
22+
This runs tests on Java 25 only. Other supported JVM versions (17, 21) require explicit tasks (e.g. `testWithJava17`).

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Discuss and ask questions in our Discussions: https://github.com/graphql-java/gr
44

55
This is a [GraphQL](https://github.com/graphql/graphql-spec) Java implementation.
66

7+
The current development version requires **Java 17 or later** to run. The Gradle build uses a JDK 25 toolchain.
8+
79
Latest build in Maven central: https://repo1.maven.org/maven2/com/graphql-java/graphql-java/
810

911
[![Build](https://github.com/graphql-java/graphql-java/actions/workflows/master.yml/badge.svg)](https://github.com/graphql-java/graphql-java/actions/workflows/master.yml)

‎README.zh_cn.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
该组件是 [GraphQL 规范](https://github.com/graphql/graphql-spec) 的 Java 实现。
66

7+
当前开发版本需要 **Java 17 或更高版本**才能运行。Gradle 构建使用 JDK 25 工具链。
8+
79
[![Build](https://github.com/graphql-java/graphql-java/actions/workflows/master.yml/badge.svg)](https://github.com/graphql-java/graphql-java/actions/workflows/master.yml)
810
[![Latest Release](https://img.shields.io/maven-central/v/com.graphql-java/graphql-java?versionPrefix=24.)](https://maven-badges.herokuapp.com/maven-central/com.graphql-java/graphql-java/)
911
[![Latest Snapshot](https://img.shields.io/maven-central/v/com.graphql-java/graphql-java?label=maven-central%20snapshot&versionPrefix=0)](https://maven-badges.herokuapp.com/maven-central/com.graphql-java/graphql-java/)

‎build.gradle‎

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ plugins {
2222
id 'maven-publish'
2323
id 'antlr'
2424
id 'signing'
25-
id "com.gradleup.shadow" version "9.4.2"
25+
id "com.gradleup.shadow" version "9.6.1"
2626
id "biz.aQute.bnd.builder" version "7.1.0"
2727
id "io.github.gradle-nexus.publish-plugin" version "2.0.0"
2828
id "groovy"
@@ -37,15 +37,15 @@ plugins {
3737

3838
java {
3939
toolchain {
40-
languageVersion = JavaLanguageVersion.of(25) // build on 25 - release on 11
40+
languageVersion = JavaLanguageVersion.of(25) // build on 25 - release on 17
4141
}
4242
}
4343

4444
kotlin {
4545
compilerOptions {
4646
apiVersion = KotlinVersion.KOTLIN_2_0
4747
languageVersion = KotlinVersion.KOTLIN_2_0
48-
jvmTarget = JvmTarget.JVM_11
48+
jvmTarget = JvmTarget.JVM_17
4949
javaParameters = true
5050
freeCompilerArgs = [
5151
'-Xemit-jvm-type-annotations',
@@ -176,7 +176,7 @@ def getDevelopmentVersion() {
176176
def reactiveStreamsVersion = '1.0.3'
177177
def releaseVersion = System.env.RELEASE_VERSION
178178
def antlrVersion = '4.13.2' // https://mvnrepository.com/artifact/org.antlr/antlr4-runtime
179-
def guavaVersion = '33.7.2-jre'
179+
def guavaVersion = '33.8.0-jre'
180180
version = releaseVersion ? releaseVersion : getDevelopmentVersion()
181181
group = 'com.graphql-java'
182182

@@ -568,7 +568,7 @@ def verifyShadedClassAnnotations = tasks.register('verifyShadedClassAnnotations'
568568
}
569569

570570
/**
571-
* Compiles a small Java 11 consumer against only the completed shaded JAR.
571+
* Compiles a small Java 17 consumer against only the completed shaded JAR.
572572
* Resolving {@code ExecutionContext.getOperationDirectives()} forces javac to
573573
* inspect the shaded ImmutableList signature; {@code -Xlint:classfile -Werror}
574574
* turns dangling annotation references into a build failure.
@@ -583,7 +583,7 @@ def compileShadedJarConsumer = tasks.register('compileShadedJarConsumer', JavaCo
583583
}
584584
classpath = files(buildFinalJar.flatMap { it.archiveFile })
585585
destinationDirectory = layout.buildDirectory.dir('classes/shaded-jar-consumer')
586-
options.release = 11
586+
options.release = 17
587587
options.compilerArgs.addAll(['-Xlint:classfile', '-Werror'])
588588
}
589589

@@ -695,13 +695,13 @@ tasks.withType(GroovyCompile) {
695695
// Options when compiling Java using the Groovy plugin.
696696
// (Groovy itself defaults to UTF-8 for Groovy code)
697697
options.encoding = 'UTF-8'
698-
sourceCompatibility = '11'
699-
targetCompatibility = '11'
698+
sourceCompatibility = '17'
699+
targetCompatibility = '17'
700700
groovyOptions.forkOptions.memoryMaximumSize = "4g"
701701
}
702702

703703
tasks.withType(JavaCompile) {
704-
options.release = 11
704+
options.release = 17
705705
options.errorprone {
706706
disableAllChecks = true
707707
check("NullAway", CheckSeverity.ERROR)
@@ -812,21 +812,7 @@ tasks.register('testWithJava17', Test) {
812812

813813
}
814814

815-
tasks.register('testWithJava11', Test) {
816-
javaLauncher = javaToolchains.launcherFor {
817-
languageVersion = JavaLanguageVersion.of(11)
818-
}
819-
testClassesDirs = sourceSets.test.output.classesDirs
820-
classpath = sourceSets.test.runtimeClasspath
821-
822-
dependsOn tasks.named('testClasses')
823-
824-
classpath += sourceSets.jmh.output
825-
dependsOn "jmhClasses"
826-
827-
}
828-
829-
['11', '17', '21'].each { ver ->
815+
['17', '21'].each { ver ->
830816
tasks.register("testngWithJava${ver}", Test) {
831817
useTestNG()
832818
javaLauncher = javaToolchains.launcherFor {

‎src/jmh/java/benchmark/GoodFaithValidationBenchmark.java‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
@Measurement(iterations = 8, time = 1)
3333
@Fork(2)
3434
public class GoodFaithValidationBenchmark {
35-
@Param({"tiny", "minimal", "simple", "fragments", "wideScalars", "wide", "wideLarge", "fragmentHeavy", "deep", "multiOperation", "mixedAbstract", "introspection"})
35+
@Param({"tiny", "minimal", "simple", "fragments", "wideScalars", "wide", "wideLarge", "fragmentHeavy", "deep", "multiOperation", "mixedAbstract", "introspection", "fragmentChain"})
3636
public String scenario;
3737

3838
private GraphQLSchema schema;
@@ -79,6 +79,8 @@ private String query() {
7979
case "mixedAbstract":
8080
return repeatedFields(200, "node { name child { name } "
8181
+ "... on A { name child { name extraA } } ... on B { name child { name extraB } } }");
82+
case "fragmentChain":
83+
return fragmentChain();
8284
case "introspection":
8385
return IntrospectionQuery.INTROSPECTION_QUERY;
8486
default:
@@ -107,6 +109,14 @@ private String fragments() {
107109
return "fragment F on Node { name child { ...G } } fragment G on Node { name }";
108110
}
109111

112+
private String fragmentChain() {
113+
StringBuilder query = new StringBuilder("{ node { ...F0 } }");
114+
for (int index = 0; index < 1500; index++) {
115+
query.append("fragment F").append(index).append(" on Node { ...F").append(index + 1).append(" } ");
116+
}
117+
return query.append("fragment F1500 on Node { name }").toString();
118+
}
119+
110120
@Benchmark
111121
public List<ValidationError> validate() {
112122
return new Validator().validateDocument(schema, document, Locale.ENGLISH);

0 commit comments

Comments
 (0)