Skip to content

Upgrade the GraphQL gem to 2.6.11 and fix pre-1.0 CI - #1414

Merged
bsorbo merged 10 commits into
pre-1.0from
bsorbo/pre-1.0-graphql-2-6
Sep 30, 2026
Merged

bsorbo merged 10 commits into
pre-1.0from
bsorbo/pre-1.0-graphql-2-6

Conversation

@bsorbo

@bsorbo bsorbo commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Why

The pre-1.0 branch pins the graphql gem to 2.5.4. This PR moves it to the 2.6 line that main already uses. The bump breaks some specs, and it also breaks SDL generation for schemas with interface hierarchies. main has already fixed all of these.

CI on pre-1.0 has not run since June 2025, and several other checks broke in that time. They would fail on any pre-1.0 PR, so this PR fixes them too. Each fix backports a change from main.

What

How

Apollo tracing. Since graphql 2.5.12, the execute_query_lazy hook runs only when a query has lazy values. apollo-federation 3.10.1 records the trace end time only in that hook. So the end time stays nil, and tracing raises undefined method 'nsec' for nil. Version 3.10.3 also records the end time in execute_multiplex. main made the same bump in #906.

Nested relationships spec. The 2.6 dataloader can send the same 6 searches in 5 _msearch requests instead of 6. The results and shard routing do not change. The spec now checks the 6 searches and their routing, and no longer counts _msearch requests.

Transitive interfaces. The GraphQL spec says a type must list every interface it implements, including ones it inherits through another interface. graphql 2.6 enforces this when it parses SDL. Our generated SDL listed only direct interfaces, so a schema where Company implements an interface that implements Inventor fails to load. ImplementsInterfaces#to_sdl now lists all ancestor interfaces, deduplicated and sorted. main's version depends on recursively_resolve_supertypes from #1067, which pre-1.0 lacks. So this adds a small helper that walks only interfaces. It follows the shape of #1084's helper but drops the cycle check, because on pre-1.0 cyclic interfaces fail earlier in HasSubtypes. A new spec covers a supertype shared by 2 interfaces (A implements B & C & D, not D & D).

CI fixes. There is one commit per fix:

  • LoggerPatch (every run_each_gem_spec job). Each gem's bundle resolves fresh in CI. On newer runner images, aws_lambda_ric 3.0 skips its Logger patch without raising, and our assertion fails. The 3.2 API applies the patch without any IO.
  • lint-workflows. asdf-vm/actions v3.0.2 clones asdf master, which no longer ships the asdf script the action runs.
  • Copyright years (run_misc_checks). script/update_licenses --verify and the RequireStandardCommentHeader cop both require the current year. The commit touches 718 files, and every change is a copyright line except one. The exception is a sadscan:disable comment on the fake SSN (123-45-6789) in misc_spec.rb, because the pre-commit secret scanner blocked commits that touch that file.
  • Time zones. The runners' JDKs now ship tzdata 2025b, which adds America/Coyhaique. Like main, the spec ignores it until every Elasticsearch/OpenSearch version we support has it.
  • Doc links (site:validate). Goose docs moved to goose-docs.ai (d05ce51, Fix broken Goose doc links #1116). The Elastic cluster status page lost the anchor we linked to. The README's GraphiQL link pointed at main, which moved those files into elasticgraph-graphiql, so it now points at pre-1.0.
  • Doc examples (site:doctest). @policy and @requiresScopes take a list of lists ([[...!]!]!). Our examples passed a flat list and a bare string. graphql 2.5.13+ no longer coerces the flat list, so the @policy doctest raised NoMethodError: undefined method 'map' for an instance of String.
  • Datastore versions. CI tested only Elasticsearch 9.0.0 and OpenSearch 2.19.1 and 2.7.0. It skipped Elasticsearch 9.4 and every OpenSearch 3.x release. This copies main's list and adds OpenSearch 3.3.0. It also brings over main's OpenSearch Dockerfile, which removes plugins that newer OpenSearch images bundle, and main's one-word fix to an error message expectation in for_index_spec.rb.
  • Range queries (OpenSearch 3.6.0 jobs). ElasticGraph merges all range operators on a field into one range clause, so {gt: 10, gte: 20} went to the datastore as-is. OpenSearch 3.6.0 rejects that with invalid lower bound for [range] query. Older versions accepted it but silently used whichever key came last, which could be the looser bound. RangeQuery now keeps only the stricter operator on each side. pre-1.0 has no split between client and internal filters, so Resolve range query filter bugs #912's new integration specs pass both filters in one filters: list.

Risk

Medium. This is a minor-version bump of graphql, the core dependency of elasticgraph-graphql, on a release branch. main has run on graphql 2.6 since #1158. The apollo-federation bump is a patch release that changes only the tracer.

The transitive-interfaces change alters generated schema.graphql artifacts for schemas where an interface implements another interface. Those users will see extra names in implements clauses and need to re-dump their artifacts. Schemas without interface hierarchies are unchanged, including this repo's own artifacts. apollo_policy callers that pass a flat list, as our old doc example did, will now get that same NoMethodError when they dump schema artifacts. They need to pass a list of lists, such as policies: [["Policy1", "Policy2"]]. main has behaved this way since graphql 2.5.13.

The other CI fixes change only tests, CI config, docs and comments, plus the aws_lambda_ric bump, which is a development dependency. The range query change can return fewer results than before for a filter that bounds one side twice, such as {gt: 10, gte: 20}. The old result came from whichever bound the datastore read last, so it could be too broad. CI no longer tests OpenSearch 2.7.0, matching main, where 2.19.0 is the lowest supported version. The run_each_gem_spec matrix grows from 9 to 15 jobs.

Testing

VALIDATE_GRAPHQL_SCHEMAS=1 ./script/run_specs (the run_specs_with_vcr setup) passes locally: 4648 examples, 0 failures. VALIDATE_GRAPHQL_SCHEMAS=1 script/run_gem_specs elasticgraph-schema_definition passes with 100% line and branch coverage.

These also passed locally: update_licenses --verify, update_ci_yaml --verify, update_codebase_overview --verify, standardrb, rspec config/linting, schema_artifacts:check and type_check. Every site:validate sub-task passes locally: doctest (127 runs, 0 failures), docs_coverage, validate_page_frontmatter and validate_no_empty_code_snippets. The one exception is the link check, where opensource.org returns 403 to my machine. CI already got past the link checks on the previous commit. elasticgraph-apollo/script/test_compatibility 2.6 passes all 15 checks. The OpenSearch Docker image builds locally for 3.6.0, 3.3.0 and 2.19.0.

🤖 Generated with Claude Code

bsorbo and others added 4 commits September 29, 2026 15:56
graphql-ruby 2.5.12+ only fires `execute_query_lazy` when a query has
lazy values, which breaks Apollo tracing in apollo-federation 3.10.1.
Require apollo-federation >= 3.10.3, which records trace end times in
`execute_multiplex` as a fallback.

Also backport cc58401 from main: the 2.6 dataloader can batch the six
nested relationship searches into five `_msearch` requests, so the
spec now asserts the logical search count and routing instead.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Newer GitHub Actions runner images make `IO.new(fd, 'wb')` raise
`Errno::EBADF` in forked subprocesses. `TelemetryLogger#initialize`
silently rescues that and skips applying `LoggerPatch`, which fails our
compatibility assertion. Use the 3.2 `TelemetryLogger.from_env` API,
which applies the patch without any IO. Backports ad16d62 from main.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
v3.0.2 clones asdf's `master` branch, which no longer ships the `asdf`
script it expects, so `lint-workflows` fails. Uses the same pinned SHA
as main.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Our license check and `RequireStandardCommentHeader` cop require the
copyright range to end in the current year. Generated with
`script/update_licenses` and `standardrb --fix`, plus manual updates to
`script/dump_time_zones` (which writes this header into
`valid_time_zones.rb`) and one `.rbs` file. Backports 66c7efe from main.

Also adds a `sadscan:disable` comment to the fake SSN in `misc_spec.rb`
so the pre-commit secret scanner doesn't block commits touching it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@bsorbo bsorbo changed the title Upgrade the GraphQL gem to 2.6.11 Upgrade the GraphQL gem to 2.6.11 and fix pre-1.0 CI Sep 30, 2026
bsorbo and others added 4 commits September 30, 2026 09:39
The JDKs on GitHub Actions runners now ship tzdata 2025b, which adds
this zone, so the spec fails. We hold off on adding it until all the
Elasticsearch/OpenSearch versions we support know about it. Backports
0411859 from main.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The GraphQL spec requires a type to list every interface it implements,
including ones inherited through other interfaces. graphql 2.6 enforces
this when parsing SDL, so schemas with interface hierarchies fail to
load. `ImplementsInterfaces#to_sdl` now lists all ancestor interfaces,
deduplicated and sorted alphabetically.

Backports f4e6b70 (#1081) from main. main's version relies on
`recursively_resolve_supertypes` from #1067, which pre-1.0 lacks, so
this adds a small interface-only helper (the shape of the one from
#1084, without its cycle check: on pre-1.0, cyclic interfaces fail
earlier in `HasSubtypes`, so that branch could never run). Also adds a
spec for a supertype shared by two interfaces.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
`site:validate` fails on three dead links:

- Goose docs moved from block.github.io/goose to goose-docs.ai.
  Backports d05ce51 (#1116) from main.
- The Elastic cluster status page no longer has the anchor we linked to.
- The README's GraphiQL link pointed at `main`, which has since moved
  those files into `elasticgraph-graphiql`. Point it at `pre-1.0`.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Both directives take a `[[...!]!]!` argument, but our examples passed a
flat list (`@policy`) or a bare string (`@requiresScopes`). graphql
2.5.13+ no longer coerces the flat list, so the `@policy` doctest
raises `NoMethodError: undefined method 'map' for an instance of
String`. Backports the doc changes from 34c409d (#919) on main.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@bsorbo
bsorbo marked this pull request as ready for review September 30, 2026 17:30
@bsorbo
bsorbo enabled auto-merge (squash) September 30, 2026 17:35
bsorbo and others added 2 commits September 30, 2026 10:46
Elasticsearch 9.4.2 and 9.0.0; OpenSearch 3.6.0, 3.3.0, and 2.19.0.
Also brings over main's OpenSearch Dockerfile (which removes plugins
that newer OpenSearch images bundle) and main's tweak to the
non-dynamic settings error message expectation in `for_index_spec`.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
OpenSearch 3.4+ rejects a `range` query that has both `gt` and `gte`
(or both `lt` and `lte`) with "invalid lower bound for [range] query".
`RangeQuery` now keeps only the stricter operator on each side.

Adapted from 723aacb: `pre-1.0` has no client/internal filter split,
so the new integration specs pass both filters in one `filters:` list.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@bsorbo
bsorbo merged commit 54f0c4a into pre-1.0 Sep 30, 2026
34 checks passed
@bsorbo
bsorbo deleted the bsorbo/pre-1.0-graphql-2-6 branch September 30, 2026 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants