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

Update painless autocomplete definitions #85464

Conversation

alisonelizabeth
Copy link
Contributor

@alisonelizabeth alisonelizabeth commented Dec 9, 2020

This PR updates the painless autocomplete definitions.

Note: the script was run against ES master; the generated context definitions in ES are currently the same in master and 7.x, so it should not need to be run again against 7.x for this release.

Related to elastic/elasticsearch#66050, elastic/elasticsearch#66120

Background

Each painless context has a set of shared classes that previously was represented in each context definition. This created large autocomplete definition files (~1MB) per context (more info around this here: #80577 (comment)). With the support of elastic/elasticsearch#66050, there is now a "common" file with common classes, and each context only contains the specialized classes associated with it. The UI code concats the common classes with context-specific classes to form the autocomplete suggestions list.

Screen Shot 2020-12-09 at 6 01 22 PM

Other changes to note:
The generated definition files now exclude primitive types (e.g., boolean, int, char). We already have defined these values in the lexer_rules, so we grab the values from there to populate the autocomplete suggestions.

How to test

I don't expect all classes and contexts to be tested 😄, but if you can do a quick smoke test of the autocomplete functionality that would be helpful. There is existing test coverage to verify the suggestions are still in the correct format.

@alisonelizabeth alisonelizabeth added v8.0.0 Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more release_note:skip Skip the PR/issue when compiling release notes Feature:Painless Lab Dev tool for learning Painless v7.11.0 Project:RuntimeFields labels Dec 9, 2020
@alisonelizabeth alisonelizabeth marked this pull request as ready for review December 9, 2020 20:53
@alisonelizabeth alisonelizabeth requested a review from a team as a code owner December 9, 2020 20:53
@elasticmachine
Copy link
Contributor

Pinging @elastic/es-ui (Team:Elasticsearch UI)

@alisonelizabeth
Copy link
Contributor Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Distributable file count

id before after diff
default 46986 47746 +760
Unknown metric groups

@kbn/ui-shared-deps asset size

id before after diff
kbn-ui-shared-deps.js 14.8MB 7.0MB -7.8MB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@jloleysens jloleysens left a comment

Choose a reason for hiding this comment

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

This is a fantastic change! Great job @alisonelizabeth .

Tested locally and confirmed that painless autocomplete still works as expected.

@alisonelizabeth alisonelizabeth merged commit 404d846 into elastic:master Dec 10, 2020
@alisonelizabeth alisonelizabeth deleted the painless/update_autocomplete_defs branch December 10, 2020 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Painless Lab Dev tool for learning Painless Project:RuntimeFields release_note:skip Skip the PR/issue when compiling release notes Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants