Skip to content

Commit 0fb0195

Browse files
committed
Merge branch 'master' into copilot/add-jspecify-annotations-another-one
2 parents b63b21c + 89b4446 commit 0fb0195

File tree

317 files changed

+723885
-184
lines changed

Some content is hidden

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

317 files changed

+723885
-184
lines changed

.claude/commands/jspecify-annotate.md

Lines changed: 4 additions & 5 deletions

.githooks/pre-commit

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
#!/bin/bash
2+
3+
# Pre-commit hook to enforce Windows compatibility and file size limits
4+
#
5+
# 1. Windows filenames: prevents characters that are reserved on Windows (< > : " | ? * \)
6+
# so the repo can be cloned on Windows systems.
7+
# 2. File size: rejects files larger than 10 MB. Many enterprise users mirror graphql-java
8+
# into internal repositories that enforce file size limits.
9+
10+
# ANSI color codes for better output readability
11+
RED='\033[0;31m'
12+
YELLOW='\033[1;33m'
13+
NC='\033[0m' # No Color
14+
15+
# Track if we found any errors
16+
ERRORS_FOUND=0
17+
18+
echo "Running pre-commit checks..."
19+
20+
# Check 1: Windows-incompatible filenames
21+
echo " Checking for Windows-incompatible filenames..."
22+
23+
# Windows reserved characters: < > : " | ? * \
24+
# Note: We escape the backslash in the regex pattern
25+
INVALID_CHARS='[<>:"|?*\\]'
26+
27+
# Get list of staged files
28+
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACR)
29+
30+
if [ -n "$STAGED_FILES" ]; then
31+
# Check each staged file for invalid characters
32+
INVALID_FILES=$(echo "$STAGED_FILES" | grep -E "$INVALID_CHARS" || true)
33+
34+
if [ -n "$INVALID_FILES" ]; then
35+
echo -e "${RED}Error: The following files have Windows-incompatible characters in their names:${NC}"
36+
echo "$INVALID_FILES" | while read -r file; do
37+
echo " - $file"
38+
done
39+
echo -e "${YELLOW}Please rename these files to remove characters: < > : \" | ? * \\${NC}"
40+
echo -e "${YELLOW}For ISO timestamps, replace colons with hyphens (e.g., 08:40:24 -> 08-40-24)${NC}"
41+
ERRORS_FOUND=1
42+
fi
43+
fi
44+
45+
# Check 2: Files larger than 10MB
46+
echo " Checking for files larger than 10MB..."
47+
48+
MAX_SIZE=$((10 * 1024 * 1024)) # 10 MB in bytes
49+
LARGE_FILES=""
50+
51+
if [ -n "$STAGED_FILES" ]; then
52+
while IFS= read -r file; do
53+
if [ -f "$file" ]; then
54+
# Try to get file size with cross-platform compatibility
55+
size=$(stat -c%s "$file" 2>/dev/null || stat -f%z "$file" 2>/dev/null)
56+
if [ -z "$size" ]; then
57+
echo -e "${YELLOW}Warning: Could not determine size of $file, skipping size check${NC}"
58+
continue
59+
fi
60+
if [ "$size" -gt "$MAX_SIZE" ]; then
61+
# Format size in human-readable format using awk (more portable than bc)
62+
size_mb=$(awk "BEGIN {printf \"%.2f\", $size/1024/1024}")
63+
LARGE_FILES="${LARGE_FILES} - $file (${size_mb} MB)\n"
64+
fi
65+
fi
66+
done <<< "$STAGED_FILES"
67+
fi
68+
69+
if [ -n "$LARGE_FILES" ]; then
70+
echo -e "${RED}Error: The following files exceed 10MB:${NC}"
71+
echo -e "$LARGE_FILES"
72+
echo -e "${YELLOW}Please consider one of these options:${NC}"
73+
echo -e "${YELLOW} 1. Split the file into smaller parts with suffixes .part1, .part2, etc.${NC}"
74+
echo -e "${YELLOW} 2. Remove unnecessary content from the file${NC}"
75+
ERRORS_FOUND=1
76+
fi
77+
78+
# Exit with error if any checks failed
79+
if [ "$ERRORS_FOUND" -eq 1 ]; then
80+
echo -e "${RED}Pre-commit checks failed. Please fix the issues above and try again.${NC}"
81+
exit 1
82+
fi
83+
84+
echo " All pre-commit checks passed!"
85+
exit 0

.github/workflows/master.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: build and test
2424
run: ./gradlew ${{matrix.gradle-argument}} --info --stacktrace
2525
- name: Publish Test Results
26-
uses: EnricoMi/publish-unit-test-result-action@v2.21.0
26+
uses: EnricoMi/publish-unit-test-result-action@v2.22.0
2727
if: always()
2828
with:
2929
files: |

.github/workflows/pull_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: build and test
3333
run: ./gradlew ${{matrix.gradle-argument}} --info --stacktrace
3434
- name: Publish Test Results
35-
uses: EnricoMi/publish-unit-test-result-action@v2.21.0
35+
uses: EnricoMi/publish-unit-test-result-action@v2.22.0
3636
if: always()
3737
with:
3838
files: |
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Validate Files
2+
3+
# This workflow validates that all files in the repository comply with:
4+
# 1. Windows filename compatibility — no reserved characters (< > : " | ? * \)
5+
# so the repo can be cloned on Windows systems.
6+
# 2. File size limits — no files larger than 10 MB. Many enterprise users mirror
7+
# graphql-java into internal repositories that enforce file size limits.
8+
9+
on:
10+
push:
11+
branches:
12+
- master
13+
- '**'
14+
pull_request:
15+
branches:
16+
- master
17+
- 23.x
18+
- 22.x
19+
- 21.x
20+
- 20.x
21+
- 19.x
22+
23+
jobs:
24+
validate-filenames-and-size:
25+
runs-on: ubuntu-latest
26+
name: Validate Windows Compatibility and File Sizes
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v6
30+
with:
31+
fetch-depth: 0 # Fetch all history to check all files
32+
33+
- name: Check for Windows-incompatible filenames
34+
run: |
35+
echo "Checking for Windows-incompatible filenames..."
36+
37+
# Windows reserved characters: < > : " | ? * \
38+
INVALID_CHARS='[<>:"|?*\\]'
39+
40+
# Get all files in the repository (excluding .git directory)
41+
ALL_FILES=$(git ls-files)
42+
43+
# Check each file for invalid characters
44+
INVALID_FILES=$(echo "$ALL_FILES" | grep -E "$INVALID_CHARS" || true)
45+
46+
if [ -n "$INVALID_FILES" ]; then
47+
echo "::error::The following files have Windows-incompatible characters in their names:"
48+
echo "$INVALID_FILES" | while read -r file; do
49+
echo "::error file=${file}::File contains Windows-incompatible characters"
50+
echo " - $file"
51+
done
52+
echo ""
53+
echo "Please rename these files to remove characters: < > : \" | ? * \\"
54+
echo "For ISO timestamps, replace colons with hyphens (e.g., 08:40:24 -> 08-40-24)"
55+
exit 1
56+
else
57+
echo "✓ All filenames are Windows-compatible"
58+
fi
59+
60+
- name: Check for files larger than 10MB
61+
run: |
62+
echo "Checking for files larger than 10MB..."
63+
64+
MAX_SIZE=$((10 * 1024 * 1024)) # 10 MB in bytes
65+
LARGE_FILES=""
66+
67+
# Get all files in the repository (excluding .git directory)
68+
ALL_FILES=$(git ls-files)
69+
70+
# Check each file's size
71+
while IFS= read -r file; do
72+
if [ -f "$file" ]; then
73+
size=$(stat -c%s "$file" 2>/dev/null || stat -f%z "$file" 2>/dev/null)
74+
if [ -z "$size" ]; then
75+
echo "::warning file=${file}::Could not determine size of file"
76+
continue
77+
fi
78+
if [ "$size" -gt "$MAX_SIZE" ]; then
79+
size_mb=$(awk "BEGIN {printf \"%.2f\", $size/1024/1024}")
80+
echo "::error file=${file}::File size (${size_mb} MB) exceeds 10MB limit"
81+
LARGE_FILES="${LARGE_FILES}${file} (${size_mb} MB)\n"
82+
fi
83+
fi
84+
done <<< "$ALL_FILES"
85+
86+
if [ -n "$LARGE_FILES" ]; then
87+
echo ""
88+
echo "The following files exceed 10MB:"
89+
echo -e "$LARGE_FILES"
90+
echo ""
91+
echo "Please consider one of these options:"
92+
echo " 1. Split the file into smaller parts with suffixes .part1, .part2, etc."
93+
echo " 2. Remove unnecessary content from the file"
94+
exit 1
95+
else
96+
echo "✓ All files are within the 10MB size limit"
97+
fi

CONTRIBUTING.md

Lines changed: 27 additions & 0 deletions

build.gradle

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ plugins {
1111
id 'maven-publish'
1212
id 'antlr'
1313
id 'signing'
14-
id "com.gradleup.shadow" version "9.0.0"
14+
id "com.gradleup.shadow" version "9.3.1"
1515
id "biz.aQute.bnd.builder" version "7.1.0"
1616
id "io.github.gradle-nexus.publish-plugin" version "2.0.0"
1717
id "groovy"
1818
id "me.champeau.jmh" version "0.7.3"
1919
id "net.ltgt.errorprone" version '4.3.0'
2020
//
2121
// Kotlin just for tests - not production code
22-
id 'org.jetbrains.kotlin.jvm' version '2.2.21'
22+
id 'org.jetbrains.kotlin.jvm' version '2.3.0'
2323
}
2424

2525
java {
@@ -129,11 +129,11 @@ dependencies {
129129

130130
testImplementation 'org.junit.jupiter:junit-jupiter:5.14.1'
131131

132-
testImplementation 'org.spockframework:spock-core:2.3-groovy-4.0'
132+
testImplementation 'org.spockframework:spock-core:2.4-groovy-5.0'
133133
testImplementation 'net.bytebuddy:byte-buddy:1.18.1'
134-
testImplementation 'org.objenesis:objenesis:3.4'
135-
testImplementation 'org.apache.groovy:groovy:4.0.28"'
136-
testImplementation 'org.apache.groovy:groovy-json:4.0.28'
134+
testImplementation 'org.objenesis:objenesis:3.5'
135+
testImplementation 'org.apache.groovy:groovy:5.0.4'
136+
testImplementation 'org.apache.groovy:groovy-json:5.0.4'
137137
testImplementation 'com.google.code.gson:gson:2.13.2'
138138
testImplementation 'org.eclipse.jetty:jetty-server:11.0.26'
139139
testImplementation 'com.fasterxml.jackson.core:jackson-databind:2.20.1'
@@ -223,6 +223,15 @@ tasks.named('jmhJar') {
223223
}
224224
}
225225

226+
jmh {
227+
if (project.hasProperty('jmhInclude')) {
228+
includes = [project.property('jmhInclude')]
229+
}
230+
if (project.hasProperty('jmhProfilers')) {
231+
profilers = [project.property('jmhProfilers')]
232+
}
233+
}
234+
226235

227236
task extractWithoutGuava(type: Copy) {
228237
from({ zipTree({ "build/libs/graphql-java-${project.version}.jar" }) }) {
@@ -361,6 +370,11 @@ tasks.register('testWithJava21', Test) {
361370
javaLauncher = javaToolchains.launcherFor {
362371
languageVersion = JavaLanguageVersion.of(21)
363372
}
373+
testClassesDirs = sourceSets.test.output.classesDirs
374+
classpath = sourceSets.test.runtimeClasspath
375+
classpath += sourceSets.jmh.output
376+
dependsOn "jmhClasses"
377+
dependsOn tasks.named('testClasses')
364378
}
365379

366380
tasks.register('testWithJava17', Test) {

gradle/wrapper/gradle-wrapper.jar

542 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

performance-results/2024-11-28T01:53:48Z-1d50c655aaf1a907b65f39e2eba310f3463ba5d5-jdk17.json renamed to performance-results/2024-11-28T01-53-48Z-1d50c655aaf1a907b65f39e2eba310f3463ba5d5-jdk17.json

File renamed without changes.

0 commit comments

Comments
 (0)