-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Breaking][data.indexPatterns] Remove expression-based scripted fields from Kibana. #77669
Comments
Pinging @elastic/kibana-app-arch (Team:AppArch) |
Hi @lukeelmers! Would you mind including some steps on how we can test this? |
Sure @alisonelizabeth! To manually test:
To programmatically determine whether this is an issue for users, you'd need to retrieve all index patterns, filter down to scripted fields, and check for any scripted fields with Pseudocode for doing this with the index patterns service would look something like this: const { indexPatterns } = data;
const ids = await indexPatterns.getIds();
const hasDeprecatedScriptField = async (id: string): boolean => {
const scriptedFields = await indexPatterns.get(id).getScriptedFields();
return scriptedFields.some(f => f.lang === 'expression');
};
// untested, but you get the idea
const results = await Promise.all(ids.map(async (id) => await hasDeprecatedScriptField(id))); |
@lukeelmers do we know how many users will be affected by this breaking change? If we don't have data to support this, a guess is better than nothing :) |
@kobelb We don't have numbers. In my nearly two years of supporting index patterns I've gotten zero questions about expression based scripted fields. |
++ there's no data on this, but anecdotally, I never once had this question come up either. Considering that we've had the deprecation notice since the beginning of 7.x, and have disabled the ability to create new expression scripted fields or edit existing ones, this would only affect users who:
The users meeting the above criteria are the only ones who should be affected by this change. For them, it's admittedly annoying because they need to rewrite those scripts. However, anyone else who had an expression field would have already been forced to convert to painless the first time they tried to edit it (assuming they did so via the UI and not by mucking around in the saved objects) |
Pinging @elastic/kibana-app-services (Team:AppServices) |
I'm going to remove the |
Closing this as scripted fields are deprecated and will eventually be removed all together. It no longer makes sense to have a separate deprecation process for expression scripted fields. |
Summary
There are a few remaining traces of support for scripted fields using Lucene's
expression
language floating around Kibana. Since we have already deprecated expression-based scripted fields in7.0
, we should clean up the remaining traces in8.0
and create a clear migration path for users.A History Lesson
In
7.0
, we removed support for expression-based scripted fields after Elasticsearch stopped supporting expression scripts in filters.The changes made at the time essentially did the following:
expression
languageexpression
scripted field, it forces you to change topainless
expression
scripted field as you will get errors back from ESexpression
scripted field as you will get errors back from ESHowever, these changes did not entirely remove expression scripts:
6.x
, your index pattern stays the same in7.0
/api/kibana/scripts/languages
endpoint that always returns['painless', 'expression']
, while we have hardcodedpainless
as the only "supported" language in index patterns UI.ui/scripting_languages
directory.Tasks
In
8.0
we should remove the remaining pieces supporting expression-based scripted fields, which should help simplify some code and will prevent confusion among users by providing a more consistent experience.Currently there are only two ways you would know that you are using a deprecated expression scripted field:
As a result, it's possible we have users who still have expression script fields from
6.x
and haven't noticed any changes in7.x
. We need to make sure they are aware that these will break starting in8.0
before they upgrade.There are a few things we can do to make this transition as smooth as possible for users.
1. Write a migration that throws an error (cc @elastic/kibana-platform)
We can't write a migration to update these fields because each script's
source
will need to be rewritten in painless. However, we can still write a migration that simply checks each index pattern and throws an error if it detects an expression scripted field. This will fail the migration, and require users to take action to address the problematic index patterns.2. Add a check to the Upgrade Assistant (cc @elastic/es-ui)
This way users can be made aware if they have any index patterns using expression script fields before attempting an upgrade. It will also provide a better experience for Cloud users, since Cloud checks the assistant before allowing users to perform an upgrade. This item would ideally be done as early as possible so that folks can already be made aware so they have more time to make updates.
3. ...then remove what's left
/api/kibana/scripts/languages
routeindex_pattern_management/public/scripting_languages
that performs checks on available/supported languageslang: 'expression'
The text was updated successfully, but these errors were encountered: