-
Notifications
You must be signed in to change notification settings - Fork 74
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
Add elasticsearch mappings definitions into input packages and a key to opt-in to import common definitions #455
Conversation
…and properties from ECS Remove elasticsearch field in input manifest from <2.3.0 versions
🌐 Coverage report
|
@@ -28,6 +28,7 @@ func TestValidateFile(t *testing.T) { | |||
}{ | |||
"good": {}, | |||
"good_v2": {}, | |||
"good_input": {}, |
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.
Added a new good_input
package to add these keys. It is copied from the sql_input
test package.
@@ -1,4 +1,4 @@ | |||
format_version: 2.0.0 |
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.
Update version in good_v2 to allow adding the new field in _dev/build/build.yml
patch: | ||
- op: remove | ||
path: "/properties/dependencies/properties/ecs/properties/import_common_dynamic_mappings" |
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.
👍 this will encourage users of this to update the format of their packages 🙂
@@ -20,7 +20,17 @@ spec: | |||
type: string | |||
description: Source reference | |||
pattern: '^git@.+' | |||
import_common_dynamic_mappings: |
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.
Nit. common
looks redundant here.
import_common_dynamic_mappings: | |
import_dynamic_mappings: |
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.
And maybe dynamic
too, this feature imports mappings for this schema, they happen to be mostly dynamic, but could be static too.
import_common_dynamic_mappings: | |
import_mappings: |
Or:
import_common_dynamic_mappings: | |
import_template: |
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.
I was not totally sure about this name. Agreed that common
does not provide any value to the name.
I will update this field to be import_mappings
Thanks!
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.
Addition of the elasticsearch
key at the top level of input packages looks good to me 👍 Thanks for this Mario!
What does this PR do?
This PR adds support in input packages to include under
elasticsearch
key dynamic templates and properties (mappings). This PR allows to defineelasticsearch.index_template.*
keys. It uses the same definition as the data_stream manifests in integration packages.This PR also adds a new field under
_dev/build/build.yml
namedimport_common_dynamic_mappings
(other optionsimport_common_mappings
?). The aim of this field is to allow developers to opt in to be added automatically byelastic-package
some common definitions needed.
This support would be introduced in package-spec versions >= 2.3.0.
Additional notes:
.gitignore
to just ignore build folder at the root directory. There are severalbuild
folders used in our specs, and git raises some errors because of this:Why is it important?
This would allow to
elastic-package
to add the most common mapping definitions needed to avoid conflicts in mappings for both input and integrations (data_strreams) packages.Checklist
test/packages
that prove my change is effective.spec/changelog.yml
.Related issues