Skip to content
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 support for multifields added by ecs@mappings #2035

Merged
merged 9 commits into from
Aug 27, 2024

Conversation

jsoriano
Copy link
Member

@jsoriano jsoriano commented Aug 23, 2024

ecs@mappings component template adds multifields that are not defined in ECS or in packages using these mappings. These fields are present in the ingested documents and cannot be validated by elastic-package.

Add the definitions for these multifields when ecs@mappings is used and no other definition is present.

Also, improve the error reported when there is no definition for a possible multifield.

Closes #1971

@jsoriano jsoriano self-assigned this Aug 23, 2024
@jsoriano jsoriano marked this pull request as draft August 23, 2024 09:49
internal/stack/resources.go Outdated Show resolved Hide resolved
@jsoriano
Copy link
Member Author

test integrations

@elastic-vault-github-plugin-prod

Created or updated PR in integrations repository to test this version. Check elastic/integrations#10859

@jsoriano
Copy link
Member Author

test integrations

@elastic-vault-github-plugin-prod

Created or updated PR in integrations repository to test this version. Check elastic/integrations#10859

@jsoriano
Copy link
Member Author

test integrations

@jsoriano
Copy link
Member Author

test integrations

@elastic-vault-github-plugin-prod

Created or updated PR in integrations repository to test this version. Check elastic/integrations#10859

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @jsoriano

@jsoriano
Copy link
Member Author

Reverting the change to enable logsdb by default, to see what would be the current status of failures by applying only the changes for the multifields added by ecs@mappings.

@jsoriano
Copy link
Member Author

test integrations

@elastic-vault-github-plugin-prod

Created or updated PR in integrations repository to test this version. Check elastic/integrations#10859

@jsoriano jsoriano marked this pull request as ready for review August 26, 2024 15:05
@@ -383,6 +389,86 @@ func allVersionsIncludeECS(kibanaConstraints *semver.Constraints) bool {
// return !kibanaConstraints.Check(lastStackVersionWithoutEcsMappings)
}

func ecsPathWithMultifieldsMatch(name string) bool {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, I'd like to avoid hard coding things from ecs@mappings here as changing that component template will cause tests to fail somewhere else.

While we're figuring the right path of whether to adapt ecs@mappings or ECS itself (elastic/ecs#2353), could we make the validation less strict and not fail if the mapping contains additional sub-fields?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, I'd like to avoid hard coding things from ecs@mappings here as changing that component template will cause tests to fail somewhere else.

If ecs@mappings doesn't differ further from ECS we should be fine, and hopefully this should be the case.

While we're figuring the right path of whether to adapt ecs@mappings or ECS itself (elastic/ecs#2353), could we make the validation less strict and not fail if the mapping contains additional sub-fields?

The problem is that if we relax a constraint it is difficult to put it back later. This is why I would keep this to the minimum we know.

Copy link
Contributor

@mrodm mrodm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jsoriano jsoriano merged commit 296eaa9 into elastic:main Aug 27, 2024
3 checks passed
@jsoriano jsoriano deleted the text-multifields-ecs-mappings branch August 27, 2024 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect validation of documents with arrays of strings in multi-fields
4 participants