Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@ All gems follow the pattern: `elasticgraph-[name]/` containing:
- `elasticgraph-elasticsearch`: Elasticsearch client wrapper
- `elasticgraph-opensearch`: OpenSearch client wrapper

**Extensions** (5 gems): Optional functionality
**Extensions** (6 gems): Optional functionality
- `elasticgraph-apollo`: Apollo Federation support
- `elasticgraph-health_check`: Health checks
- `elasticgraph-json_ingestion`: JSON Schema ingestion serializer
- `elasticgraph-query_interceptor`: Query interception
- `elasticgraph-query_registry`: Source-controlled query registry
- `elasticgraph-warehouse`: Data warehouse ingestion
Expand Down
13 changes: 12 additions & 1 deletion CODEBASE_OVERVIEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ graph LR;
rackup["rackup"];
rake["rake"];
webrick["webrick"];
elasticgraph-json_ingestion["eg-json_ingestion"];
elasticgraph-schema_artifacts["eg-schema_artifacts"];
graphql["graphql"];
elasticgraph --> elasticgraph-support;
Expand All @@ -125,6 +126,7 @@ graph LR;
elasticgraph-local --> webrick;
elasticgraph-schema_definition --> elasticgraph-graphql;
elasticgraph-schema_definition --> elasticgraph-indexer;
elasticgraph-schema_definition --> elasticgraph-json_ingestion;
elasticgraph-schema_definition --> elasticgraph-schema_artifacts;
elasticgraph-schema_definition --> elasticgraph-support;
elasticgraph-schema_definition --> graphql;
Expand All @@ -141,6 +143,7 @@ graph LR;
class rackup externalGemCatStyle;
class rake externalGemCatStyle;
class webrick externalGemCatStyle;
class elasticgraph-json_ingestion otherEgGemStyle;
class elasticgraph-schema_artifacts otherEgGemStyle;
class graphql externalGemCatStyle;
click thor href "https://rubygems.org/gems/thor" "Open on RubyGems.org" _blank;
Expand Down Expand Up @@ -192,12 +195,14 @@ graph LR;
click opensearch-ruby href "https://rubygems.org/gems/opensearch-ruby" "Open on RubyGems.org" _blank;
```

### Extensions (5 gems)
### Extensions (7 gems)

These libraries extend ElasticGraph to provide optional but commonly needed functionality.

* [elasticgraph-apollo](elasticgraph-apollo/README.md): Transforms an ElasticGraph project into an Apollo subgraph.
* [elasticgraph-health_check](elasticgraph-health_check/README.md): Provides a health check for high availability ElasticGraph deployments.
* [elasticgraph-json_ingestion](elasticgraph-json_ingestion/README.md): Pluggable JSON Schema ingestion serializer for ElasticGraph.
* [elasticgraph-protobuf](elasticgraph-protobuf/README.md): Generates Protocol Buffers schema artifacts from ElasticGraph schemas.
* [elasticgraph-query_interceptor](elasticgraph-query_interceptor/README.md): Intercepts ElasticGraph datastore queries.
* [elasticgraph-query_registry](elasticgraph-query_registry/README.md): Provides a source-controlled query registry for ElasticGraph applications.
* [elasticgraph-warehouse](elasticgraph-warehouse/README.md): Extends ElasticGraph to support ingestion into a data warehouse.
Expand All @@ -216,6 +221,8 @@ graph LR;
apollo-federation["apollo-federation"];
elasticgraph-health_check["eg-health_check"];
elasticgraph-datastore_core["eg-datastore_core"];
elasticgraph-json_ingestion["eg-json_ingestion"];
elasticgraph-protobuf["eg-protobuf"];
elasticgraph-query_interceptor["eg-query_interceptor"];
elasticgraph-schema_artifacts["eg-schema_artifacts"];
elasticgraph-query_registry["eg-query_registry"];
Expand All @@ -228,6 +235,8 @@ graph LR;
elasticgraph-health_check --> elasticgraph-datastore_core;
elasticgraph-health_check --> elasticgraph-graphql;
elasticgraph-health_check --> elasticgraph-support;
elasticgraph-json_ingestion --> elasticgraph-support;
elasticgraph-protobuf --> elasticgraph-support;
elasticgraph-query_interceptor --> elasticgraph-graphql;
elasticgraph-query_interceptor --> elasticgraph-schema_artifacts;
elasticgraph-query_registry --> elasticgraph-graphql;
Expand All @@ -242,6 +251,8 @@ graph LR;
class apollo-federation externalGemCatStyle;
class elasticgraph-health_check targetGemStyle;
class elasticgraph-datastore_core otherEgGemStyle;
class elasticgraph-json_ingestion targetGemStyle;
class elasticgraph-protobuf targetGemStyle;
class elasticgraph-query_interceptor targetGemStyle;
class elasticgraph-schema_artifacts otherEgGemStyle;
class elasticgraph-query_registry targetGemStyle;
Expand Down
17 changes: 17 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ PATH
elasticgraph-support (= 1.1.1.pre)
hashdiff (~> 1.2, >= 1.2.1)

PATH
remote: elasticgraph-json_ingestion
specs:
elasticgraph-json_ingestion (1.1.1.pre)
elasticgraph-support (= 1.1.1.pre)

PATH
remote: elasticgraph-lambda_support
specs:
Expand Down Expand Up @@ -157,6 +163,12 @@ PATH
faraday-retry (~> 2.4)
opensearch-ruby (~> 3.4)

PATH
remote: elasticgraph-protobuf
specs:
elasticgraph-protobuf (1.1.1.pre)
elasticgraph-support (= 1.1.1.pre)

PATH
remote: elasticgraph-query_interceptor
specs:
Expand Down Expand Up @@ -192,6 +204,7 @@ PATH
elasticgraph-schema_definition (1.1.1.pre)
elasticgraph-graphql (= 1.1.1.pre)
elasticgraph-indexer (= 1.1.1.pre)
elasticgraph-json_ingestion (= 1.1.1.pre)
elasticgraph-schema_artifacts (= 1.1.1.pre)
elasticgraph-support (= 1.1.1.pre)
graphql (~> 2.5.22)
Expand Down Expand Up @@ -696,9 +709,11 @@ DEPENDENCIES
elasticgraph-indexer (= 1.1.1.pre)!
elasticgraph-indexer_autoscaler_lambda (= 1.1.1.pre)!
elasticgraph-indexer_lambda (= 1.1.1.pre)!
elasticgraph-json_ingestion (= 1.1.1.pre)!
elasticgraph-lambda_support (= 1.1.1.pre)!
elasticgraph-local (= 1.1.1.pre)!
elasticgraph-opensearch (= 1.1.1.pre)!
elasticgraph-protobuf (= 1.1.1.pre)!
elasticgraph-query_interceptor (= 1.1.1.pre)!
elasticgraph-query_registry (= 1.1.1.pre)!
elasticgraph-rack (= 1.1.1.pre)!
Expand Down Expand Up @@ -787,9 +802,11 @@ CHECKSUMS
elasticgraph-indexer (1.1.1.pre)
elasticgraph-indexer_autoscaler_lambda (1.1.1.pre)
elasticgraph-indexer_lambda (1.1.1.pre)
elasticgraph-json_ingestion (1.1.1.pre)
elasticgraph-lambda_support (1.1.1.pre)
elasticgraph-local (1.1.1.pre)
elasticgraph-opensearch (1.1.1.pre)
elasticgraph-protobuf (1.1.1.pre)
elasticgraph-query_interceptor (1.1.1.pre)
elasticgraph-query_registry (1.1.1.pre)
elasticgraph-rack (1.1.1.pre)
Expand Down
2 changes: 2 additions & 0 deletions config/docker_demo/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ COPY elasticgraph-datastore_core elasticgraph-datastore_core/
COPY elasticgraph-graphiql elasticgraph-graphiql/
COPY elasticgraph-graphql elasticgraph-graphql/
COPY elasticgraph-indexer elasticgraph-indexer/
COPY elasticgraph-json_ingestion elasticgraph-json_ingestion/
COPY elasticgraph-local elasticgraph-local/
COPY elasticgraph-opensearch elasticgraph-opensearch/
COPY elasticgraph-protobuf elasticgraph-protobuf/
COPY elasticgraph-query_registry elasticgraph-query_registry/
COPY elasticgraph-rack elasticgraph-rack/
COPY elasticgraph-schema_artifacts elasticgraph-schema_artifacts/
Expand Down
8 changes: 6 additions & 2 deletions config/site/support/doctest_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
require "elastic_graph/apollo/schema_definition/api_extension"
require "elastic_graph/schema_artifacts/runtime_metadata/schema_element_names"
require "elastic_graph/schema_definition/api"
require "elastic_graph/schema_definition/extension_module_support"
require "elastic_graph/schema_definition/schema_artifact_manager"
require "elastic_graph/warehouse/schema_definition/api_extension"
require "rspec/mocks"
Expand Down Expand Up @@ -60,7 +61,9 @@ module ElasticGraph
@api = SchemaDefinition::API.new(
SchemaArtifacts::RuntimeMetadata::SchemaElementNames.new(form: :camelCase, overrides: {}),
true,
extension_modules: extension_modules
extension_modules: SchemaDefinition::ExtensionModuleSupport.build_api_extension_modules(
extension_modules: extension_modules
)
)

# This is required in all schemas, but we don't want to have to put in all our examples,
Expand Down Expand Up @@ -95,7 +98,8 @@ module ElasticGraph
ElasticGraph.define_schema do |schema|
# `schema.json_schema_version` raises an error when the version is set more than once.
# By default we set it above. Here we clear it to allow our example to set it.
schema.state.json_schema_version = nil
schema.state.ingestion_serializer_state.delete(:json_schema_version)
schema.state.ingestion_serializer_state.delete(:json_schema_version_setter_location)
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ COPY elasticgraph-elasticsearch /web/elasticgraph-elasticsearch
COPY elasticgraph-graphiql /web/elasticgraph-graphiql
COPY elasticgraph-graphql /web/elasticgraph-graphql
COPY elasticgraph-indexer /web/elasticgraph-indexer
COPY elasticgraph-json_ingestion /web/elasticgraph-json_ingestion
COPY elasticgraph-rack /web/elasticgraph-rack
COPY elasticgraph-schema_artifacts /web/elasticgraph-schema_artifacts
COPY elasticgraph-schema_definition /web/elasticgraph-schema_definition
Expand Down
1 change: 1 addition & 0 deletions elasticgraph-apollo/apollo_tests_implementation/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ source "https://rubygems.org"
graphiql
graphql
indexer
json_ingestion
rack
schema_artifacts
schema_definition
Expand Down
1 change: 1 addition & 0 deletions elasticgraph-json_ingestion/.rspec
1 change: 1 addition & 0 deletions elasticgraph-json_ingestion/.yardopts
1 change: 1 addition & 0 deletions elasticgraph-json_ingestion/Gemfile
21 changes: 21 additions & 0 deletions elasticgraph-json_ingestion/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2024 - 2026 Block, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
27 changes: 27 additions & 0 deletions elasticgraph-json_ingestion/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# ElasticGraph::JSONIngestion

Pluggable JSON Schema ingestion serializer for ElasticGraph.

This gem extracts the JSON Schema generation and validation logic from ElasticGraph's core into a
pluggable extension, following the same pattern as `elasticgraph-warehouse` and `elasticgraph-apollo`.
This is the first step toward supporting alternative ingestion serializers (e.g., Protocol Buffers).

Higher-level schema-definition entry points use the JSON Schema serializer by default for backward
compatibility, so existing users do not need configuration changes.

## Dependency Diagram

```mermaid
graph LR;
classDef targetGemStyle fill:#FADBD8,stroke:#EC7063,color:#000,stroke-width:2px;
classDef otherEgGemStyle fill:#A9DFBF,stroke:#2ECC71,color:#000;
classDef externalGemStyle fill:#E0EFFF,stroke:#70A1D7,color:#2980B9;
elasticgraph-json_ingestion["elasticgraph-json_ingestion"];
class elasticgraph-json_ingestion targetGemStyle;
elasticgraph-support["elasticgraph-support"];
elasticgraph-json_ingestion --> elasticgraph-support;
class elasticgraph-support otherEgGemStyle;
elasticgraph-schema_definition["elasticgraph-schema_definition"];
elasticgraph-schema_definition --> elasticgraph-json_ingestion;
class elasticgraph-schema_definition otherEgGemStyle;
```
41 changes: 41 additions & 0 deletions elasticgraph-json_ingestion/elasticgraph-json_ingestion.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright 2024 - 2026 Block, Inc.
#
# Use of this source code is governed by an MIT-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/MIT.
#
# frozen_string_literal: true

require_relative "../elasticgraph-support/lib/elastic_graph/version"

Gem::Specification.new do |spec|
spec.name = "elasticgraph-json_ingestion"
spec.version = ElasticGraph::VERSION
spec.authors = ["Josh Wilson", "Myron Marston", "Block Engineering"]
spec.email = ["joshuaw@squareup.com"]
spec.homepage = "https://block.github.io/elasticgraph/"
spec.license = "MIT"
spec.summary = "Pluggable JSON Schema ingestion serializer for ElasticGraph."

spec.metadata = {
"bug_tracker_uri" => "https://github.com/block/elasticgraph/issues",
"changelog_uri" => "https://github.com/block/elasticgraph/releases/tag/v#{ElasticGraph::VERSION}",
"documentation_uri" => "https://block.github.io/elasticgraph/api-docs/v#{ElasticGraph::VERSION}/",
"homepage_uri" => "https://block.github.io/elasticgraph/",
"source_code_uri" => "https://github.com/block/elasticgraph/tree/v#{ElasticGraph::VERSION}/#{spec.name}",
"gem_category" => "extension"
}

spec.files = Dir.chdir(File.expand_path(__dir__)) do
`git ls-files -z`.split("\x0").reject do |f|
(f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features|sig)/|\.(?:git|travis|circleci)|appveyor)})
end - [".rspec", "Gemfile", ".yardopts"]
end

spec.required_ruby_version = [">= 3.4", "< 4.1"]

# This extension is loaded by `elasticgraph-schema_definition` at schema-definition time, so we intentionally
# avoid a runtime dependency here to keep the dependency direction acyclic across gems.
spec.add_development_dependency "elasticgraph-schema_definition", ElasticGraph::VERSION
spec.add_dependency "elasticgraph-support", ElasticGraph::VERSION
end
19 changes: 19 additions & 0 deletions elasticgraph-json_ingestion/lib/elastic_graph/json_ingestion.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2024 - 2026 Block, Inc.
#
# Use of this source code is governed by an MIT-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/MIT.
#
# frozen_string_literal: true

module ElasticGraph
# Pluggable JSON Schema ingestion serializer for ElasticGraph.
#
# This gem extracts the JSON Schema generation and validation logic from ElasticGraph's
# core into a pluggable extension, following the same pattern as `elasticgraph-warehouse`
# and `elasticgraph-apollo`. This is the first step toward supporting alternative ingestion
# serializers (e.g., Protocol Buffers). Higher-level schema-definition entry points use it by
# default for backward compatibility.
module JSONIngestion
end
end
Loading
Loading