Skip to content

Provide path_to_schema to schema definition state - #1316

Merged
jwils merged 1 commit into
mainfrom
joshuaw/artifact-manager-schema-path
Jul 31, 2026
Merged

Provide path_to_schema to schema definition state#1316
jwils merged 1 commit into
mainfrom
joshuaw/artifact-manager-schema-path

Conversation

@jwils

@jwils jwils commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

Today, every schema artifact is a pure function of the schema definition: the schema artifacts directory can safely be deleted and regenerated at any time. In #1304 (comment), @myronmarston pointed out that proto_field_numbers.yaml doesn't fit that model--it's an input to schema.proto generation, not a pure output--and suggested treating it as part of the schema definition, stored as a sibling of path_to_schema, rather than as a schema artifact.

For an extension to maintain a file there, schema definition state needs to know where the schema definition lives. RakeTasks already knows (it's how the schema gets loaded) but never passed it into the API. This PR stores path_to_schema on SchemaDefinition::State, allowing extensions to access it without expanding SchemaArtifactManager's dependencies.

Nothing in core uses the value yet, so there are no behavior changes to the core artifacts. #1304 builds on this to relocate proto_field_numbers.yaml.

Update — 2026-07-29

After review, the path is carried by schema definition state rather than an extension-only SchemaArtifactManager instance variable. The manager continues to accept the narrower schema-definition results object.

@jwils
jwils force-pushed the joshuaw/artifact-manager-schema-path branch from 20d16fd to 41f7655 Compare July 29, 2026 19:13

@myronmarston myronmarston left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM apart from a suggestion below and one other thing: the PR description is no longer accurate. Worth updating before you merge?

Comment thread config/site/support/doctest_helper.rb Outdated
@jwils jwils changed the title Provide path_to_schema to SchemaArtifactManager Provide to schema definition state Jul 29, 2026
@jwils jwils changed the title Provide to schema definition state Provide path_to_schema to schema definition state Jul 29, 2026
jwils added a commit that referenced this pull request Jul 31, 2026
## Why
Nested relationship acceptance tests assumed that each logical search
would use a separate `_msearch` transport request. Fiber scheduling can
batch the same six searches into five requests, causing unrelated
changes such as #1316 to fail despite correct results and routing.

## What
- Stop asserting the transport request count in the bi-directional
nested relationship test
- Continue asserting six logical datastore searches and their exact
shard routing

## Risk Assessment
Low — this is a test-only change that preserves the result, query-count,
and routing coverage.

## References
- Reproduced in the Ruby 3.4 and 4.0 `run_each_gem_spec` jobs on #1316
- `bundle exec rspec
elasticgraph-graphql/spec/acceptance/nested_relationships_spec.rb`
- `script/lint`
@jwils
jwils force-pushed the joshuaw/artifact-manager-schema-path branch from 41f7655 to 33db237 Compare July 31, 2026 01:54
@jwils
jwils enabled auto-merge (squash) July 31, 2026 02:21
Schema definition extensions may need to maintain inputs alongside the schema file. Carry the configured path on State so extensions can access it without expanding SchemaArtifactManager dependencies.
@jwils
jwils force-pushed the joshuaw/artifact-manager-schema-path branch from 33db237 to c4f0213 Compare July 31, 2026 02:38
@jwils
jwils merged commit dec2021 into main Jul 31, 2026
24 checks passed
@jwils
jwils deleted the joshuaw/artifact-manager-schema-path branch July 31, 2026 03:25
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.

2 participants