Skip to content

Namespace JSON schema helpers under JSON ingestion#1203

Open
jwils wants to merge 1 commit into
joshuaw/json-ingestion-extensionfrom
joshuaw/json-ingestion-helper-namespace
Open

Namespace JSON schema helpers under JSON ingestion#1203
jwils wants to merge 1 commit into
joshuaw/json-ingestion-extensionfrom
joshuaw/json-ingestion-helper-namespace

Conversation

@jwils
Copy link
Copy Markdown
Collaborator

@jwils jwils commented May 20, 2026

Why

After the move-only PR preserves rename detection, put the moved helper constants under the ElasticGraph::JSONIngestion namespace.

What

  • Namespace the moved JSON Schema helper classes and RBS signatures
  • Update schema_definition references and tests to use the new qualified constants

Risk Assessment

Medium - namespace-only behavior should be unchanged, but it updates call sites across schema_definition.

References

@jwils jwils force-pushed the joshuaw/json-ingestion-helper-namespace branch from 7bc0045 to 6267113 Compare May 20, 2026 20:03
@jwils jwils force-pushed the joshuaw/json-ingestion-extension branch from 461ba24 to 64ff2af Compare May 20, 2026 20:03
@jwils jwils force-pushed the joshuaw/json-ingestion-helper-namespace branch from 6267113 to 040cea2 Compare May 20, 2026 20:15
@jwils jwils force-pushed the joshuaw/json-ingestion-helper-namespace branch from 040cea2 to e6a4787 Compare May 21, 2026 02:49
@jwils jwils force-pushed the joshuaw/json-ingestion-extension branch from 64ff2af to 7d4becc Compare May 21, 2026 02:49
@jwils jwils force-pushed the joshuaw/json-ingestion-helper-namespace branch from e6a4787 to eb21230 Compare May 21, 2026 13:43
@jwils jwils marked this pull request as ready for review May 22, 2026 18:23
"id" => {
"description" => "The unique identifier of the record.",
"type" => "string",
"maxLength" => ElasticGraph::DEFAULT_MAX_KEYWORD_LENGTH
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.

Suggested change
"maxLength" => ElasticGraph::DEFAULT_MAX_KEYWORD_LENGTH
"maxLength" => DEFAULT_MAX_KEYWORD_LENGTH

Now that the outer module is ElasticGraph and not ElasticGraph::JSONIngestion, this can resolve without the ElasticGraph prefix.

Can you apply this throughout the PR?

:missing_necessary_fields
)
def json_schema_version
json_schema.fetch(ElasticGraph::JSON_SCHEMA_VERSION_KEY)
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.

Suggested change
json_schema.fetch(ElasticGraph::JSON_SCHEMA_VERSION_KEY)
json_schema.fetch(JSON_SCHEMA_VERSION_KEY)

old_type_name_by_current_name = {} # : ::Hash[::String, ::String]

defs = json_schema.fetch("$defs").to_h do |type_name, type_def|
if type_name != ElasticGraph::EVENT_ENVELOPE_JSON_SCHEMA_NAME && (properties = type_def["properties"])
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.

Suggested change
if type_name != ElasticGraph::EVENT_ENVELOPE_JSON_SCHEMA_NAME && (properties = type_def["properties"])
if type_name != EVENT_ENVELOPE_JSON_SCHEMA_NAME && (properties = type_def["properties"])

field_type: field_type,
fully_qualified_path: field_path.fully_qualified_path_in_index
)
def identify_missing_necessary_fields_for_index_def(object_type, index_def, json_schema_resolver)
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.

Funny that we had this unused argument...

private

def json_schema_with_metadata_merger: () -> Indexing::JSONSchemaWithMetadata::Merger
def json_schema_with_metadata_merger: () -> ::ElasticGraph::JSONIngestion::SchemaDefinition::Indexing::JSONSchemaWithMetadata::Merger
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.

Suggested change
def json_schema_with_metadata_merger: () -> ::ElasticGraph::JSONIngestion::SchemaDefinition::Indexing::JSONSchemaWithMetadata::Merger
def json_schema_with_metadata_merger: () -> JSONIngestion::SchemaDefinition::Indexing::JSONSchemaWithMetadata::Merger

@current_public_json_schema: ::Hash[::String, untyped]?
@latest_versioned_json_schema: ::Hash[::String, untyped]?
@json_schema_with_metadata_merger: Indexing::JSONSchemaWithMetadata::Merger?
@json_schema_with_metadata_merger: ::ElasticGraph::JSONIngestion::SchemaDefinition::Indexing::JSONSchemaWithMetadata::Merger?
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.

Suggested change
@json_schema_with_metadata_merger: ::ElasticGraph::JSONIngestion::SchemaDefinition::Indexing::JSONSchemaWithMetadata::Merger?
@json_schema_with_metadata_merger: JSONIngestion::SchemaDefinition::Indexing::JSONSchemaWithMetadata::Merger?

def mapping: () -> ::Hash[::String, untyped]
def json_schema: () -> ::Hash[::String, untyped]
def json_schema_metadata: () -> JSONSchemaFieldMetadata
def json_schema_metadata: () -> ::ElasticGraph::JSONIngestion::SchemaDefinition::Indexing::JSONSchemaFieldMetadata
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.

Suggested change
def json_schema_metadata: () -> ::ElasticGraph::JSONIngestion::SchemaDefinition::Indexing::JSONSchemaFieldMetadata
def json_schema_metadata: () -> JSONIngestion::SchemaDefinition::Indexing::JSONSchemaFieldMetadata

The ::ElasticGraph:: prefix shouldn't be needed in any of these RBS files since you're within module ElasticGraph. Can you apply this to all the RBS files?

Comment on lines +241 to +244
# @private
class MissingNecessaryField < ::Data
# @dynamic initialize, with, field_type, fully_qualified_path
end
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.

Suggested change
# @private
class MissingNecessaryField < ::Data
# @dynamic initialize, with, field_type, fully_qualified_path
end

Doesn't seem like this is needed?

@jwils jwils force-pushed the joshuaw/json-ingestion-extension branch from 7d4becc to e64b589 Compare May 22, 2026 22:41
@jwils jwils force-pushed the joshuaw/json-ingestion-helper-namespace branch from eb21230 to 2afdcd4 Compare May 22, 2026 22:41
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