-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Move runtime fields to server #69223
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
Move runtime fields to server #69223
Conversation
Except the whitelists around grok and dissect which stay for now separate as they depend on grok and dissect
Pinging @elastic/es-search (Team:Search) |
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.
I scanned it and it looks like a good step! I'm not 10% sure what we want the grok and dissect extension to be in the end, but this does seem useful. And it is nice to zap the weird extension to the dynamic: runtime
.
@@ -259,7 +259,7 @@ public String getType() { | |||
|
|||
@Override | |||
public Set<ScriptContext<?>> getSupportedContexts() { | |||
return Set.of(DoubleFieldScript.CONTEXT); | |||
return Set.of(); |
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.
I'm kind of surprised this passes without this.
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.
I poked a bit with this and I think this is because all the runtime fields contexts are now built-in and applied by ScriptModule by default.
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.
Weird! I thought the scripting infra wouldn't send a Script
to an engine that didn't support the context. But it looks like that isn't how it works. It more like script engines can make new contexts with this thing.
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! I can already see some common interfaces to extract for calculated fields here as well, looking good.
@@ -219,10 +219,6 @@ protected static boolean parseObjectOrDocumentTypeProperties(String fieldName, O | |||
if (value.equalsIgnoreCase("strict")) { | |||
builder.dynamic(Dynamic.STRICT); | |||
} else if (value.equalsIgnoreCase("runtime")) { | |||
if (parserContext.supportsDynamicRuntimeMappings() == false) { |
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.
So good to see this gone!
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.
yes that is what I thought too. There is more to do to simplify the abstractions here, but removing the extension point and some of the shenanigans around it feels good.
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.
Painless side LGTM! Thanks for changing this.
This commit makes a start on moving runtime fields to server. The runtime field types are now built-in. The dynamic fields builder extension (needed to make dynamic:runtime work) is removed: further simplifications are needed but are left for a follow-up. It is still possible to plug in custom runtime field types through the same extension point that the xpack plugin used to use. The runtime fields script contexts are now also moved to server, and the corresponding whitelists are part of painless-lang with the exception of grok and dissect which will require additional work. The runtime fields xpack plugin still exists to hold the grok and dissect extensions needed, which depend on grok and dissect lib and we will address as a follow-up. Also, the qa tests and yaml tests are yet to be moved. Despite the need for additional work, runtime fields are fully functional and users should not be impacted by this change.
This commit makes a start on moving runtime fields to server. The runtime field types are now built-in. The dynamic fields builder extension (needed to make dynamic:runtime work) is removed: further simplifications are needed but are left for a follow-up. It is still possible to plug in custom runtime field types through the same extension point that the xpack plugin used to use. The runtime fields script contexts are now also moved to server, and the corresponding whitelists are part of painless-lang with the exception of grok and dissect which will require additional work. The runtime fields xpack plugin still exists to hold the grok and dissect extensions needed, which depend on grok and dissect lib and we will address as a follow-up. Also, the qa tests and yaml tests are yet to be moved. Despite the need for additional work, runtime fields are fully functional and users should not be impacted by this change.
This PR makes a start on moving runtime fields to server.
The runtime field types are now built-in. The dynamic fields builder extension (needed to make dynamic:runtime) work is removed: further simplifications are needed but are left for a follow-up. It is still possible to plug in custom runtime field types through the same extension point that the xpack plugin used to use.
The runtime fields script contexts are now also moved to server, and the corresponding whitelists are part of painless-lang with the exception of grok and dissect which will require additional work.
The runtime fields xpack plugin still exists to hold the grok and dissect extensions needed, which depend on grok and dissect lib and we will address as a follow-up. Also, the qa tests and yaml tests are yet to be moved.
Despite the need for additional work, runtime fields are fully functional and users should not be impacted by this change.