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
|
| }{ | ||
| "good": {}, | ||
| "good_v2": {}, | ||
| "good_input": {}, |
There was a problem hiding this comment.
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.
Update version in good_v2 to allow adding the new field in _dev/build/build.yml
| - before: 2.3.0 | ||
| patch: | ||
| - op: remove | ||
| path: "/properties/dependencies/properties/ecs/properties/import_common_dynamic_mappings" No newline at end of file |
There was a problem hiding this comment.
👍 this will encourage users of this to update the format of their packages 🙂
| type: string | ||
| description: Source reference | ||
| pattern: '^git@.+' | ||
| import_common_dynamic_mappings: |
There was a problem hiding this comment.
Nit. common looks redundant here.
| import_common_dynamic_mappings: | |
| import_dynamic_mappings: |
There was a problem hiding this comment.
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.
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!
hop-dev
left a comment
There was a problem hiding this comment.
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
elasticsearchkey 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.ymlnamedimport_common_dynamic_mappings(other optionsimport_common_mappings?). The aim of this field is to allow developers to opt in to be added automatically byelastic-packagesome common definitions needed.
This support would be introduced in package-spec versions >= 2.3.0.
Additional notes:
.gitignoreto just ignore build folder at the root directory. There are severalbuildfolders used in our specs, and git raises some errors because of this:Why is it important?
This would allow to
elastic-packageto add the most common mapping definitions needed to avoid conflicts in mappings for both input and integrations (data_strreams) packages.Checklist
test/packagesthat prove my change is effective.spec/changelog.yml.Related issues