-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[ES|QL] Separate ENRICH
autocomplete routine
#211657
Conversation
867924a
to
20105dd
Compare
Pinging @elastic/kibana-esql (Team:ESQL) |
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.
Seems great, I also did a brief testing to ensure that it works as expected!
(astContext.type === 'option' && astContext.command?.name === 'join') || | ||
(astContext.type === 'option' && astContext.command?.name === 'dissect') || | ||
(astContext.type === 'option' && astContext.command?.name === 'from') | ||
(astContext.type === 'option' && astContext.command?.name === 'from') || | ||
(astContext.type === 'option' && astContext.command?.name === 'enrich') |
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 know that this is temporary but maybe it makes sense for now to create an array with the converted commands and have one check here
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.
Good point, I can do this!
command: TRIGGER_SUGGESTION_COMMAND, | ||
})); | ||
|
||
/** @deprecated — options will be removed */ |
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.
Why will we remove options? 🤔
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... what is an "option?"
It is a construct in our code with no grounding anywhere in the grammar or in Elasticsearch (that I know of anyway...). It essentially means any capitalized keyword after the command name. For example STATS... >BY<
, DISSECT... >APPEND_SEPARATOR<
There's this idea in the current architecture that these are uniform enough to deserve to be their own special first-class citizen. But it breaks...
For example APPEND_SEPARATOR
is not a keyword with an expression after it... it is a variable APPEND_SEPARATOR=":"
... or filtering in stats.... STATS AVG(bytes) >WHERE< ....
so is WHERE an option now?
Don't even start on FORK
...
So basically, I don't think it deserves to be treated as anything other than part of a command. That's why I'm gradually gutting the getSuggestionsForOption
function... it will all happen within the command.
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.
Aaaaah it makes sense +++ Thanx for explaining!
Starting backport for target branches: 8.x |
💚 Build Succeeded
Metrics [docs]Module Count
Page load bundle
History
|
## Summary Part of elastic#195418 Gives `ENRICH` autocomplete logic its own home 🏡 ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios ### Identify risks - [ ] As with any refactor, there's a possibility this will introduce a regression in the behavior of commands. However, all automated tests are passing and I have tested the behavior manually and can detect no regression. --------- Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co> (cherry picked from commit f2a9173)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
# Backport This will backport the following commits from `main` to `8.x`: - [[ES|QL] Separate `ENRICH` autocomplete routine (#211657)](#211657) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Drew Tate","email":"drew.tate@elastic.co"},"sourceCommit":{"committedDate":"2025-03-03T20:24:23Z","message":"[ES|QL] Separate `ENRICH` autocomplete routine (#211657)\n\n## Summary\n\nPart of https://github.com/elastic/kibana/issues/195418\n\nGives `ENRICH` autocomplete logic its own home 🏡\n\n### Checklist\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n\n### Identify risks\n\n- [ ] As with any refactor, there's a possibility this will introduce a\nregression in the behavior of commands. However, all automated tests are\npassing and I have tested the behavior manually and can detect no\nregression.\n\n---------\n\nCo-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>","sha":"f2a91732d8f8d20a22bf761bfe9ec85e8a8e1c0c","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Feature:ES|QL","Team:ESQL","backport:version","v9.1.0","v8.19.0"],"title":"[ES|QL] Separate `ENRICH` autocomplete routine","number":211657,"url":"https://github.com/elastic/kibana/pull/211657","mergeCommit":{"message":"[ES|QL] Separate `ENRICH` autocomplete routine (#211657)\n\n## Summary\n\nPart of https://github.com/elastic/kibana/issues/195418\n\nGives `ENRICH` autocomplete logic its own home 🏡\n\n### Checklist\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n\n### Identify risks\n\n- [ ] As with any refactor, there's a possibility this will introduce a\nregression in the behavior of commands. However, all automated tests are\npassing and I have tested the behavior manually and can detect no\nregression.\n\n---------\n\nCo-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>","sha":"f2a91732d8f8d20a22bf761bfe9ec85e8a8e1c0c"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/211657","number":211657,"mergeCommit":{"message":"[ES|QL] Separate `ENRICH` autocomplete routine (#211657)\n\n## Summary\n\nPart of https://github.com/elastic/kibana/issues/195418\n\nGives `ENRICH` autocomplete logic its own home 🏡\n\n### Checklist\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n\n### Identify risks\n\n- [ ] As with any refactor, there's a possibility this will introduce a\nregression in the behavior of commands. However, all automated tests are\npassing and I have tested the behavior manually and can detect no\nregression.\n\n---------\n\nCo-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>","sha":"f2a91732d8f8d20a22bf761bfe9ec85e8a8e1c0c"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Drew Tate <drew.tate@elastic.co>
…elastic#212979) # Backport This will backport the following commits from `main` to `8.x`: - [[ES|QL] Separate `ENRICH` autocomplete routine (elastic#211657)](elastic#211657) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Drew Tate","email":"drew.tate@elastic.co"},"sourceCommit":{"committedDate":"2025-03-03T20:24:23Z","message":"[ES|QL] Separate `ENRICH` autocomplete routine (elastic#211657)\n\n## Summary\n\nPart of https://github.com/elastic/kibana/issues/195418\n\nGives `ENRICH` autocomplete logic its own home 🏡\n\n### Checklist\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n\n### Identify risks\n\n- [ ] As with any refactor, there's a possibility this will introduce a\nregression in the behavior of commands. However, all automated tests are\npassing and I have tested the behavior manually and can detect no\nregression.\n\n---------\n\nCo-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>","sha":"f2a91732d8f8d20a22bf761bfe9ec85e8a8e1c0c","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Feature:ES|QL","Team:ESQL","backport:version","v9.1.0","v8.19.0"],"title":"[ES|QL] Separate `ENRICH` autocomplete routine","number":211657,"url":"https://github.com/elastic/kibana/pull/211657","mergeCommit":{"message":"[ES|QL] Separate `ENRICH` autocomplete routine (elastic#211657)\n\n## Summary\n\nPart of https://github.com/elastic/kibana/issues/195418\n\nGives `ENRICH` autocomplete logic its own home 🏡\n\n### Checklist\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n\n### Identify risks\n\n- [ ] As with any refactor, there's a possibility this will introduce a\nregression in the behavior of commands. However, all automated tests are\npassing and I have tested the behavior manually and can detect no\nregression.\n\n---------\n\nCo-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>","sha":"f2a91732d8f8d20a22bf761bfe9ec85e8a8e1c0c"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/211657","number":211657,"mergeCommit":{"message":"[ES|QL] Separate `ENRICH` autocomplete routine (elastic#211657)\n\n## Summary\n\nPart of https://github.com/elastic/kibana/issues/195418\n\nGives `ENRICH` autocomplete logic its own home 🏡\n\n### Checklist\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n\n### Identify risks\n\n- [ ] As with any refactor, there's a possibility this will introduce a\nregression in the behavior of commands. However, all automated tests are\npassing and I have tested the behavior manually and can detect no\nregression.\n\n---------\n\nCo-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>","sha":"f2a91732d8f8d20a22bf761bfe9ec85e8a8e1c0c"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Drew Tate <drew.tate@elastic.co>
Summary
Part of #195418
Gives
ENRICH
autocomplete logic its own home 🏡Checklist
Identify risks