Stricter validation of data stream settings#587
Conversation
|
test integrations |
|
test integrations |
| type: | ||
| $ref: "./fields/fields.spec.yml#/items/properties/type" | ||
| scaling_factor: | ||
| $ref: "./fields/fields.spec.yml#/items/properties/scaling_factor" | ||
| metrics: | ||
| $ref: "./fields/fields.spec.yml#/items/properties/metrics" | ||
| default_metric: | ||
| $ref: "./fields/fields.spec.yml#/items/properties/default_metric" | ||
| ignore_above: | ||
| $ref: "./fields/fields.spec.yml#/items/properties/ignore_above" |
There was a problem hiding this comment.
Looking at this mapping definition, when import_mappings is true in _dev/build/build.yml in a package, all the mappings defined in this file are added in the built package:
https://github.com/elastic/elastic-package/blob/9d80c6cc282d04f521cd763abd42d529f9679cce/internal/builder/_static/ecs_mappings.yaml#L19
Checking those mappings, at least match, path_match and fields fields are defined under mapping key too. Some examples:
- https://github.com/elastic/elastic-package/blob/9d80c6cc282d04f521cd763abd42d529f9679cce/internal/builder/_static/ecs_mappings.yaml#L290-L296
- https://github.com/elastic/elastic-package/blob/9d80c6cc282d04f521cd763abd42d529f9679cce/internal/builder/_static/ecs_mappings.yaml#L356
These definitions would be in the built package, and this built package is going to be checked by our publishing CI jobs to validate them before publishing them.
So I guess more fields would be needed here, wouldn't it?
| type: array | ||
| items: | ||
| type: object | ||
| # maxProperties: 1 # No idea why this doesn't work. But this will be also checked by Elasticsearch. |
There was a problem hiding this comment.
Tried to use this value, but I get this error:
could not read root folder spec file: could not load spec for "integration/data_stream/spec.yml": could not load schema for "integration/data_stream": failed to load schema for "integration/data_stream/manifest.spec.yml": maxProperties must be of an integer
I didn't find why it could be detected as a different type than integer :/
💚 Build Succeeded
History
|
What does this PR do?
Limit the index settings that can be defined in data stream manifests.
Why is it important?
Package compatibility with the stack is going to be controlled by the package spec version. Each version of Kibana will support a range of versions of the spec, so the spec needs to be specific about the features each package can use.
Checklist
test/packagesthat prove my change is effective.spec/changelog.yml.Related issues