Skip to content

Namespace JSON schema helpers under JSON ingestion#1203

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

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
require "elastic_graph/json_ingestion"

module ElasticGraph
module ElasticGraph::JSONIngestion
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.

I'd encourage you to do the typical nesting thing:

module ElasticGraph
  module JSONIngestion
    # ...
  end
end

It'll require you to indent every line but I can just ignore whitespace when reviewing and it'll hide lines with indentation-only changes. (Note: ignoring white space doesn't help when moving files as it appears that git's whitespace-ignoring feature doesn't apply to its file movement detection. That's why it's so nice to defer changing the indentation until the files have already moved.)

Besides being in line with how we write code everywhere else, it allows the code in the module to directly reference ElasticGraph:: constants, removing the need to prefix them with ::ElasticGraph as you've done here. That in turn leads to a smaller whitespace-ignored diff to review, and creates nicer code in the long run.

"type" => {
"description" => "The type of object present in `record`.",
"type" => "string",
# Sorting doesn't really matter here, but it's nice for the output in the schema artifact to be consistent.
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.

Would be nice to not remove comments unless they are inaccurate.

@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
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