Skip to content
Merged
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
6 changes: 5 additions & 1 deletion CODEBASE_OVERVIEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,14 @@ graph LR;
click opensearch-ruby href "https://rubygems.org/gems/opensearch-ruby" "Open on RubyGems.org" _blank;
```

### Extensions (6 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): JSON Schema ingestion support for ElasticGraph.
* [elasticgraph-proto_ingestion](elasticgraph-proto_ingestion/README.md): Supports ingesting Protocol Buffer data into ElasticGraph.
* [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 @@ -218,6 +219,7 @@ graph LR;
elasticgraph-health_check["eg-health_check"];
elasticgraph-datastore_core["eg-datastore_core"];
elasticgraph-json_ingestion["eg-json_ingestion"];
elasticgraph-proto_ingestion["eg-proto_ingestion"];
elasticgraph-query_interceptor["eg-query_interceptor"];
elasticgraph-schema_artifacts["eg-schema_artifacts"];
elasticgraph-query_registry["eg-query_registry"];
Expand All @@ -231,6 +233,7 @@ graph LR;
elasticgraph-health_check --> elasticgraph-graphql;
elasticgraph-health_check --> elasticgraph-support;
elasticgraph-json_ingestion --> elasticgraph-support;
elasticgraph-proto_ingestion --> elasticgraph-support;
elasticgraph-query_interceptor --> elasticgraph-graphql;
elasticgraph-query_interceptor --> elasticgraph-schema_artifacts;
elasticgraph-query_registry --> elasticgraph-graphql;
Expand All @@ -246,6 +249,7 @@ graph LR;
class elasticgraph-health_check targetGemStyle;
class elasticgraph-datastore_core otherEgGemStyle;
class elasticgraph-json_ingestion targetGemStyle;
class elasticgraph-proto_ingestion targetGemStyle;
class elasticgraph-query_interceptor targetGemStyle;
class elasticgraph-schema_artifacts otherEgGemStyle;
class elasticgraph-query_registry targetGemStyle;
Expand Down
8 changes: 8 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ PATH
faraday-retry (~> 2.4)
opensearch-ruby (~> 3.4)

PATH
remote: elasticgraph-proto_ingestion
specs:
elasticgraph-proto_ingestion (1.2.1.pre)
elasticgraph-support (= 1.2.1.pre)

PATH
remote: elasticgraph-query_interceptor
specs:
Expand Down Expand Up @@ -688,6 +694,7 @@ DEPENDENCIES
elasticgraph-lambda_support (= 1.2.1.pre)!
elasticgraph-local (= 1.2.1.pre)!
elasticgraph-opensearch (= 1.2.1.pre)!
elasticgraph-proto_ingestion (= 1.2.1.pre)!
elasticgraph-query_interceptor (= 1.2.1.pre)!
elasticgraph-query_registry (= 1.2.1.pre)!
elasticgraph-rack (= 1.2.1.pre)!
Expand Down Expand Up @@ -779,6 +786,7 @@ CHECKSUMS
elasticgraph-lambda_support (1.2.1.pre)
elasticgraph-local (1.2.1.pre)
elasticgraph-opensearch (1.2.1.pre)
elasticgraph-proto_ingestion (1.2.1.pre)
elasticgraph-query_interceptor (1.2.1.pre)
elasticgraph-query_registry (1.2.1.pre)
elasticgraph-rack (1.2.1.pre)
Expand Down
1 change: 1 addition & 0 deletions config/docker_demo/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ COPY elasticgraph-indexer elasticgraph-indexer/
COPY elasticgraph-json_ingestion elasticgraph-json_ingestion/
COPY elasticgraph-local elasticgraph-local/
COPY elasticgraph-opensearch elasticgraph-opensearch/
COPY elasticgraph-proto_ingestion elasticgraph-proto_ingestion/
COPY elasticgraph-query_registry elasticgraph-query_registry/
COPY elasticgraph-rack elasticgraph-rack/
COPY elasticgraph-schema_artifacts elasticgraph-schema_artifacts/
Expand Down
2 changes: 2 additions & 0 deletions config/site/support/doctest_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

require "elastic_graph/apollo/schema_definition/api_extension"
require "elastic_graph/json_ingestion/schema_definition/api_extension"
require "elastic_graph/proto_ingestion/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/schema_artifact_manager"
Expand Down Expand Up @@ -53,6 +54,7 @@ module ElasticGraph
"ElasticGraph.define_schema" => [],
"ElasticGraph::Apollo::SchemaDefinition" => [Apollo::SchemaDefinition::APIExtension],
"ElasticGraph::JSONIngestion::SchemaDefinition" => [JSONIngestion::SchemaDefinition::APIExtension],
"ElasticGraph::ProtoIngestion::SchemaDefinition" => [ProtoIngestion::SchemaDefinition::APIExtension],
"ElasticGraph::SchemaDefinition" => [],
"ElasticGraph::Warehouse::SchemaDefinition" => [Warehouse::SchemaDefinition::APIExtension]
}
Expand Down
1 change: 1 addition & 0 deletions elasticgraph-proto_ingestion/.rspec
1 change: 1 addition & 0 deletions elasticgraph-proto_ingestion/.yardopts
1 change: 1 addition & 0 deletions elasticgraph-proto_ingestion/Gemfile
21 changes: 21 additions & 0 deletions elasticgraph-proto_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.
17 changes: 17 additions & 0 deletions elasticgraph-proto_ingestion/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# ElasticGraph::ProtoIngestion

An ElasticGraph extension that supports ingesting Protocol Buffer data into ElasticGraph.

## 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-proto_ingestion["elasticgraph-proto_ingestion"];
class elasticgraph-proto_ingestion targetGemStyle;
elasticgraph-support["elasticgraph-support"];
elasticgraph-proto_ingestion --> elasticgraph-support;
class elasticgraph-support otherEgGemStyle;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# 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-proto_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 = "Supports ingesting Protocol Buffer data into 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"]

spec.add_dependency "elasticgraph-support", ElasticGraph::VERSION

spec.add_development_dependency "elasticgraph-schema_definition", ElasticGraph::VERSION
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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
# Namespace for Protocol Buffers schema artifact generation extensions.
module ProtoIngestion
# The name of the generated Protocol Buffers schema file.
PROTO_SCHEMA_FILE = "schema.proto"

# The name of the generated proto field-number mapping file.
PROTO_FIELD_NUMBERS_FILE = "proto_field_numbers.yaml"
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 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 "elastic_graph/proto_ingestion"

module ElasticGraph
module ProtoIngestion
# Namespace for all protobuf schema definition support.
#
# {SchemaDefinition::APIExtension} is the primary entry point and should be used as a schema definition extension module.
module SchemaDefinition
# Module designed to be extended onto an {ElasticGraph::SchemaDefinition::API} instance
# to enable protobuf schema artifact generation.
#
# @note The protobuf schema artifact generation logic has not been implemented yet, so
# extending this module is currently a no-op.
module APIExtension
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module ElasticGraph
module ProtoIngestion
PROTO_SCHEMA_FILE: ::String
PROTO_FIELD_NUMBERS_FILE: ::String
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module ElasticGraph
module ProtoIngestion
module SchemaDefinition
module APIExtension
end
end
end
end
10 changes: 10 additions & 0 deletions elasticgraph-proto_ingestion/spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# 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

# This file contains RSpec configuration for `elasticgraph-proto_ingestion`.
# It is loaded by the shared spec helper at `spec_support/spec_helper.rb`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# 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 "elastic_graph/proto_ingestion/schema_definition/api_extension"
require "elastic_graph/spec_support/schema_definition_helpers"

module ElasticGraph
module ProtoIngestion
module SchemaDefinition
RSpec.describe APIExtension do
include_context "SchemaDefinitionHelpers"

it "can be used as a schema definition extension module, without customizing the schema definition yet" do
Comment thread
jwils marked this conversation as resolved.
with_extension, without_extension = [[APIExtension], []].map do |extension_modules|
define_schema(schema_element_name_form: "snake_case", extension_modules: extension_modules) do |schema|
schema.object_type "Widget" do |t|
t.field "id", "ID!"
t.index "widgets"
end
end.graphql_schema_string
end

expect(with_extension).to eq(without_extension)
end
end
end
end
end
Comment thread
jwils marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 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 "elastic_graph/proto_ingestion"

module ElasticGraph
RSpec.describe ProtoIngestion do
it "defines the PROTO_SCHEMA_FILE constant" do
expect(ProtoIngestion::PROTO_SCHEMA_FILE).to eq("schema.proto")
end

it "defines the PROTO_FIELD_NUMBERS_FILE constant" do
expect(ProtoIngestion::PROTO_FIELD_NUMBERS_FILE).to eq("proto_field_numbers.yaml")
end
end
end
3 changes: 3 additions & 0 deletions elasticgraph-support/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ graph LR;
elasticgraph-opensearch["elasticgraph-opensearch"];
elasticgraph-opensearch --> elasticgraph-support;
class elasticgraph-opensearch otherEgGemStyle;
elasticgraph-proto_ingestion["elasticgraph-proto_ingestion"];
elasticgraph-proto_ingestion --> elasticgraph-support;
class elasticgraph-proto_ingestion otherEgGemStyle;
elasticgraph-query_registry["elasticgraph-query_registry"];
elasticgraph-query_registry --> elasticgraph-support;
class elasticgraph-query_registry otherEgGemStyle;
Expand Down
2 changes: 2 additions & 0 deletions rbs_collection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ gems:
ignore: true
- name: elasticgraph-opensearch
ignore: true
- name: elasticgraph-proto_ingestion
ignore: true
- name: elasticgraph-query_interceptor
ignore: true
- name: elasticgraph-query_registry
Expand Down