-
Notifications
You must be signed in to change notification settings - Fork 116
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
Fix matching of leaf fields for objects #2054
Fix matching of leaf fields for objects #2054
Conversation
Pending to confirm if this is actually needed or a regression in latest main, because this was not failing before in dailies. |
test integrations |
Created or updated PR in integrations repository to test this version. Check elastic/integrations#10922 |
0d0c33d
to
40bdac2
Compare
test integrations |
Created or updated PR in integrations repository to test this version. Check elastic/integrations#10922 |
test integrations |
Created or updated PR in integrations repository to test this version. Check elastic/integrations#10922 |
test integrations |
Created or updated PR in integrations repository to test this version. Check elastic/integrations#10922 |
This reverts commit 4304621.
18ffb90
to
fe15ae8
Compare
Changes related to unexpected types moved to #2065 and elastic/package-spec#791. |
test integrations |
Created or updated PR in integrations repository to test this version. Check elastic/integrations#10922 |
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.
LGTM!
internal/fields/validate.go
Outdated
definition.ObjectType = "" | ||
return v.parseSingleElementValue(key, definition, val, doc) | ||
case definition.Type == "object" && definition.ObjectType == "": | ||
// Legacy mapping, abiguous definition not allowed by recent versions of the spec, ignore it. |
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.
// Legacy mapping, abiguous definition not allowed by recent versions of the spec, ignore it. | |
// Legacy mapping, ambiguous definition not allowed by recent versions of the spec, ignore it. |
💚 Build Succeeded
History
cc @jsoriano |
Validation of objects was happening only depending of the format. If there were no subobjects, the validation was happening, and if there were objects with subfields, the validation was not happening for the subfields. This leads to different results with different mapping settings for the same data. For example depending if synthetics source or
subobjects: false
is used.Additionally, for subfields that should match the definition of the parent object, there were cases where this match was not happening, so the test could unexpectedly fail.
Even if usually it is recommended to add explicit wildcards in dynamic mappings, definitions like the following one are expected to match subfields, but currently they aren't.
The definition above would not match for
user.names.db
.Seen for several packages in https://buildkite.com/elastic/integrations/builds/15135 (elastic/integrations#10919).