-
Notifications
You must be signed in to change notification settings - Fork 29
Add schema definition extension plumbing #1200
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
Open
jwils
wants to merge
1
commit into
joshuaw/json-ingestion-gem-shell
Choose a base branch
from
joshuaw/schema-extension-plumbing
base: joshuaw/json-ingestion-gem-shell
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -213,33 +213,6 @@ class RakeTasks < ::Rake::TaskLib | |
| # @dynamic schema_definition_extension_modules, schema_definition_extension_modules= | ||
| attr_accessor :schema_definition_extension_modules | ||
|
|
||
| # Whether or not to enforce the requirement that the JSON schema version is incremented every time | ||
| # dumping the JSON schemas results in a changed artifact. Defaults to `true`. | ||
| # | ||
| # @note Generally speaking, you will want this to be `true` for any ElasticGraph application that is in | ||
| # production as the versioning of JSON schemas is what supports safe schema evolution as it allows | ||
| # ElasticGraph to identify which version of the JSON schema the publishing system was operating on | ||
| # when it published an event. | ||
| # | ||
| # It can be useful to set it to `false` before your application is in production, as you do not want | ||
| # to be forced to bump the version after every single schema change while you are building an initial | ||
| # prototype. | ||
| # | ||
| # @return [Boolean] whether to require `json_schema_version` to be incremented on changes that impact `json_schemas.yaml` | ||
| # @see SchemaDefinition::API#json_schema_version | ||
| # | ||
| # @example Disable enforcement during initial prototyping | ||
| # ElasticGraph::Local::RakeTasks.new( | ||
| # local_config_yaml: "config/settings/local.yaml", | ||
| # path_to_schema: "config/schema.rb" | ||
| # ) do |tasks| | ||
| # # TODO: remove this once we're past the prototyping stage | ||
| # tasks.enforce_json_schema_version = false | ||
| # 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. This is useful API documentation that previously rendered on our website. Can you copy it over to the new |
||
| # | ||
| # @dynamic enforce_json_schema_version, enforce_json_schema_version= | ||
| attr_accessor :enforce_json_schema_version | ||
|
|
||
| # List of Elasticsearch versions you want to be able to boot. Rake tasks will be defined for each version to support booting and | ||
| # halting Elasticsearch locally. If the configuration of `local_config_yaml` only configures `opensearch` as a cluster backend, | ||
| # will default to an empty array. Otherwise, defaults to the versions of Elasticsearch that are exercised by the ElasticGraph test suite, as | ||
|
|
@@ -362,7 +335,6 @@ def initialize(local_config_yaml:, path_to_schema:) | |
| self.type_name_overrides = {} | ||
| self.enum_value_overrides_by_type = {} | ||
| self.schema_definition_extension_modules = [] | ||
| self.enforce_json_schema_version = true | ||
| self.env_port_mapping = {} | ||
| self.output = $stdout | ||
| self.daemon_timeout = 300 | ||
|
|
@@ -394,7 +366,6 @@ def initialize(local_config_yaml:, path_to_schema:) | |
| type_name_overrides: type_name_overrides, | ||
| enum_value_overrides_by_type: enum_value_overrides_by_type, | ||
| extension_modules: schema_definition_extension_modules, | ||
| enforce_json_schema_version: enforce_json_schema_version, | ||
| output: output | ||
| ) | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
For the site examples I think we want this to be
false, as we don't want to ever bump the json schema version on them. The generated schema artifacts are git-ignored so it works fine on CI with eitherfalseortrue, but it may add friction if these examples all inherit the default value oftrue. For example, if I'm iterating on a site example schema the default oftruemay force me to manually delete the schema artifacts between runs ofbe rake site:serve, whereas that was previously not needed.Can you add
schema.enforce_json_schema_version falsenext toschema.json_schema_version 1in the site example schemas?