-
Notifications
You must be signed in to change notification settings - Fork 29
Add JSON ingestion gem shell #1199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../spec_support/subdir_dot_rspec |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../config/site/yardopts |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../Gemfile |
| 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. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # ElasticGraph::JSONIngestion | ||
|
|
||
| JSON Schema ingestion support for ElasticGraph. | ||
|
|
||
| This gem provides the schema-definition extension that generates JSON Schema artifacts for indexing | ||
| events and validates JSON-ingestion-specific schema options. | ||
|
|
||
| ## 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; | ||
| ``` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| # 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 = "JSON Schema ingestion support 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 gem `prepend`s/`extend`s modules onto `ElasticGraph::SchemaDefinition::API` at runtime, so its | ||
| # code requires `elasticgraph-schema_definition` to be loaded. We declare that as a *development* | ||
| # dependency rather than a runtime dependency to keep the gem-spec dep direction acyclic: | ||
| # `elasticgraph-schema_definition` runtime-depends on this gem (so installing `schema_definition` | ||
| # always pulls in this serializer by default), and this gem's code references `schema_definition` only | ||
| # via paths that are always already loaded by the time this gem is required. | ||
| spec.add_development_dependency "elasticgraph-schema_definition", ElasticGraph::VERSION | ||
| spec.add_dependency "elasticgraph-support", ElasticGraph::VERSION | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IIRC we put |
||
| end | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. /nit I'm not sure we need this file. There's nothing further in this file in #1205...will there ever be? Gems's don't have to have a "root" file like this. Can we drop it entirely? (If something in our build require it to exist, feel free to leave it). |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # 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 | ||
| # JSON ingestion support for ElasticGraph. | ||
| module JSONIngestion | ||
| end | ||
| end |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Long term, I think it'll make sense to move some JSON logic out of
elasticgraph-indexerinto here. Essentially, this gem should provide all logic related to ingesting JSON data. Stuff that is only used by the indexer when we ingest JSON events should not remain inelasticgraph-indexeras it won't be used by an alternate ingestion library (e.g. the proto one).....but for now let's leave this as you've written it since the schema-definition stuff is what you are focused on with this PR stack.