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

[Change Proposal] Relax validations on required fields #843

Open
jsoriano opened this issue Dec 11, 2024 · 0 comments
Open

[Change Proposal] Relax validations on required fields #843

jsoriano opened this issue Dec 11, 2024 · 0 comments
Labels
discuss Issue needs discussion

Comments

@jsoriano
Copy link
Member

jsoriano commented Dec 11, 2024

We currently check at the spec level that some fields are required, here:

// ValidateRequiredFields validates that required fields are present and have the expected
// types.
func ValidateRequiredFields(fsys fspath.FS) specerrors.ValidationErrors {
requiredFields := map[string]string{
"data_stream.type": "constant_keyword",
"data_stream.dataset": "constant_keyword",
"data_stream.namespace": "constant_keyword",
"@timestamp": "date",
}
return validateRequiredFields(fsys, requiredFields)
}

The definition of these fields is already provided in many cases by ecs@mappings, and its definition doesn't grant that they are correctly used, this can be only checked with system tests. Current implementation forces packages developers to include this boilerplate fields.

So maybe we should remove the expectation on these fields from the spec, and ensure that elastic-package can detect misuses or absence of these fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss Issue needs discussion
Projects
None yet
Development

No branches or pull requests

1 participant