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.
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
Validate fields using ECS JSON schema when all stack versions support ecs@mappings #1711
Validate fields using ECS JSON schema when all stack versions support ecs@mappings #1711
Changes from 6 commits
4395eb3
91c9085
02c8e9c
96f3418
edc0bf9
1eb3df1
bb16985
bb05a75
cf82a7d
e279d80
cb9f689
e8f0bae
151c527
f15fd18
f0a1ee1
15f2529
9e333ac
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Please, add or modify a test package so we have a test case with a package that uses ECS fields, but doesn't embeds the 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.
If we want to test the scenario where the package uses the ECS in Elasticsearch, we need a stack version 8.13.0.
@mrodm, which version of the stack the tests run on? Can we have stack version 8.13.0 (for all tests or just one)?
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.
Currently, the steps in the CI to test packages run with the default version. IIRC that version now should be 8.12.0.
If this needs to be changed, it needs to be updated
scripts/test-check-packages.sh
to allow define--version
flag in theelastic-package stack up
command through an environment variable or so. This will require also updateIn this implementation, the ECS fields are imported before validation by the test runners (e.g. kibana version condition is
^8.13.0
), so there should not be errors related to field definitions. Is it required to start an Elastic stack ^8.13.0 too? @zmoogThere 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.
Correct!
elastic-package validates the ECS fields using the JSON schema during the static checks, so it does not need to run on Elastic stack ^8.13.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.
This is a simpler implementation that checks the Kibana constraints agains the latest known stack version that does NOT support
ecs@mappings
.This check works under the assumption the constraints are not limited upwards (for example,
^8.10.0
or^7.14.0 || ^8.0.0
).I plan to remove at the end of the review process, but I want to mention it as an option.
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 option is actually not bad, but yeah, let's go with the other one that looks safer.