Repository navigation
Fix schema directory ordering in Gradle cache keys - #981
Merged
Merged
Conversation
iuliiasobolevska
force-pushed
the
fix/schema-directory-cache-order
branch
from
October 7, 2026 19:52
aebe587 to
8b34d84
Compare
iuliiasobolevska
force-pushed
the
fix/schema-directory-cache-order
branch
from
October 7, 2026 20:14
8b34d84 to
6a335f1
Compare
iuliiasobolevska
marked this pull request as ready for review
October 8, 2026 17:05
iuliiasobolevska
requested review from
asibross,
iparadiso,
jjacobs44,
kilink,
kzwang,
paulbakker and
srinivasankavitha
as code owners
October 8, 2026 17:05
jiholee17
approved these changes
Oct 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Schema directories named
x.graphqlsandx.graphqls!can share a Gradle build cache key with an ordinary directory layout even though fresh generation produces a different field and constructor parameter order.Restoring the wrong classes can silently exchange values in positional constructor calls when the affected parameters have the same type.
Add a scalar
schemaRootOrderinput that records the root permutation using the actual directory types.Gradle evaluates this input after producer tasks run, so roots created by earlier tasks are classified correctly without making their initial absence a configuration cache input.
The existing
orderedSchemaRootsproperty and8.7.0generation order are preserved.The KDoc distinguishes the name-based
orderedSchemaRootsheuristic from execution-time directory classification inschemaRootOrder.Verification
FROM_CACHEwhere execution is required..graphqland.graphqls, existing and producer-created roots, field order, constructor parameter order, fresh output equivalence and correct restoration with configuration cache reuse.expected SUCCESS but was FROM_CACHE.expected FROM_CACHE but was SUCCESS.expected FROM_CACHE but was SUCCESS.GenerateJavaTaskBuildCacheTestpass with the fix.validatePluginspass.Windows validation
OpenJDK 17's Windows
File.compareToimplementation was inspected:WinNTFileSystem.compareusesString.compareToIgnoreCase.CodeGen.discoverSchemaSourcessortsFilevalues, while both the existingorderedSchemaRootsheuristic and the newschemaRootOrderinput sort strings case-sensitively.This comparator difference predates this PR.
The cache tests ran on macOS; no Windows build or cache restoration test was run.