[KQL] Moves KQL related code to a separate plugin#246674
Conversation
aa2f23b to
dfa176f
Compare
🔍 Preview links for changed docs |
sabarasaba
left a comment
There was a problem hiding this comment.
kibana management changes (transform plugin) lgtm
maxcold
left a comment
There was a problem hiding this comment.
cloud_security_posture changes lgtm
kdelemme
left a comment
There was a problem hiding this comment.
actionable-obs code changes lgtm
| # Time in milliseconds to wait for autocomplete suggestions from Elasticsearch. | ||
| # This value must be a whole number greater than zero. Defaults to 1000ms | ||
| #unifiedSearch.autocomplete.valueSuggestions.timeout: 1000 | ||
| unifiedSearch.autocomplete.valueSuggestions.timeout: 1000 |
There was a problem hiding this comment.
this is not a needed change, since 1000ms is a default, right?
There was a problem hiding this comment.
yes Marta, nice catch. I was testing the settings and forgot to comment out again. Done!
mbondyra
left a comment
There was a problem hiding this comment.
Nice, 337 files modified 😅
I reviewed the code and tested - let's wait for the bundle to pass, hopefully moving the useMemoCss didn't change anything for the worse. Approved!
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Module Count
Public APIs missing comments
Any counts in public APIs
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
async chunk count
ESLint disabled line counts
References to deprecated APIs
Total ESLint disabled count
|
## Summary Part of elastic#247265 Moves KQL to a separate plugin in order to be reused more easily and not create circular dependencies. Specifically this moves: - KQL autocomplete server side code - QueryStringInput ui component The circular dependencies problem is caused because: - unified search is using the ES|QL editor (esql plugin) - we want to give kql autocomplete capabilities to the esql editor autocomplete + the ES|QL editor visor (smart search) needs to use the KQL search bar The above were not possible as the unified search plugin references the esql plugin and to achieve the above we will need to import to esql plugin the unified search (causing circular dependencies) ### Testing As a code owner I am testing that if my applications are using KQL and/or unified search that everything works as expected ### Checklist - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [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 - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Rudolf Meijering <skaapgif@gmail.com> Co-authored-by: mbondyra <marta.bondyra@elastic.co>
#250044) It closes #249869 Related to: #246674 ## Summary - Fixes KQL autocomplete not working in the custom threshold rule creation/editing form - The `kql` service is now injected directly into the rule expression component via a factory function - This ensures KQL autocomplete works regardless of which plugin opens the rule form (e.g., infra, triggers_actions_ui, stack_alerts) — consumers no longer need to have `kql` in their plugin dependencies - Moves `kql` from optional to required plugins in the observability plugin manifest ## Technical details ### Problem The custom threshold rule can be opened from multiple plugins (observability, infra, triggers_actions_ui). Previously, the rule expression component tried to get the `kql` service from the Kibana context, but this failed when the rule form was opened from plugins that don't have `kql` in their dependencies. Additionally, rule types are registered during the **setup phase**, but `KqlPluginStart` is only available during the **start phase**. ### Solution The `kql` service is now directly injected into the custom threshold rule expression component using a factory function. This approach: 1. **Ensures consistency**: The `kql` service always comes from the observability plugin (which owns the rule type), not from the consumer plugin 2. **Avoids breaking other plugins**: Plugins like infra, triggers_actions_ui, or stack_alerts don't need to add `kql` to their dependencies just to use the custom threshold rule 3. **Handles the setup/start lifecycle**: Uses `dynamic()` with `getStartServices()` to defer fetching the `kql` service until the component is actually rendered **E2E test:** - Added new Scout test to verify KQL autocomplete works in custom threshold rule creation Before: https://github.com/user-attachments/assets/150c22f0-f619-4f5f-bae6-0986ea319b65 After: https://github.com/user-attachments/assets/1cb9fa30-ac16-4ac3-b960-3d87d1b0f313 --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary It looks like [this conversation](#246674 (comment)) had a misunderstanding: it focused on the `unifiedSearch` -> `kql` change, but it forgot the pre-existing rename from `data.autocomplete` to `unifiedSearch.autocomplete`. We've seen some customers hitting this old path, so this PR brings it back. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary It looks like [this conversation](elastic#246674 (comment)) had a misunderstanding: it focused on the `unifiedSearch` -> `kql` change, but it forgot the pre-existing rename from `data.autocomplete` to `unifiedSearch.autocomplete`. We've seen some customers hitting this old path, so this PR brings it back. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary It looks like [this conversation](elastic#246674 (comment)) had a misunderstanding: it focused on the `unifiedSearch` -> `kql` change, but it forgot the pre-existing rename from `data.autocomplete` to `unifiedSearch.autocomplete`. We've seen some customers hitting this old path, so this PR brings it back. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
…269868) ## Summary This PR addresses elastic/docs-content#6511. The page [General settings in Kibana](https://www.elastic.co/docs/reference/kibana/configuration-reference/general-settings) lists \`data.autocomplete.valueSuggestions.terminateAfter\` and \`data.autocomplete.valueSuggestions.timeout\` without any deprecation indicator, making them appear as valid current settings. These settings were deprecated in Kibana 8.3.0 when the autocomplete logic was moved from the \`data\` plugin to the \`unified_search\` plugin (now \`kql\`) via [#129977](#129977). The canonical settings since 8.3.0 are \`unifiedSearch.autocomplete.valueSuggestions.terminateAfter\` and \`unifiedSearch.autocomplete.valueSuggestions.timeout\`. The backward-compatible deprecation handler (which remaps the old keys to the new ones with a warning) was accidentally removed in [#246674](#246674) and restored in [#268872](#268872) (backported to v9.4.2 and v9.5.0). During the window between 9.4.0 and 9.4.1, customers using \`data.autocomplete.*\` in \`kibana.yml\` experienced startup failures. All three generations of the settings (\`kibana.*\`, \`data.*\`, \`unifiedSearch.*\`) are explicitly allowlisted in ECH and work for users on ECH deployments. ## Changes - **\`docs/reference/configuration-reference/general-settings.yml\`**: - Marks \`data.autocomplete.valueSuggestions.terminateAfter\` and \`data.autocomplete.valueSuggestions.timeout\` as \`deprecated 8.3\` on stack, with \`deprecation_details\` pointing to the \`unifiedSearch.*\` replacements. - Adds an inline note on both deprecated settings warning that using them in Kibana 9.4.0–9.4.1 causes a startup failure, and advising users to migrate or upgrade. - Adds \`unifiedSearch.autocomplete.valueSuggestions.timeout\` and \`unifiedSearch.autocomplete.valueSuggestions.terminateAfter\` as \`stack: ga 8.3\` entries so the canonical settings are properly documented. ## Resolves Closes elastic/docs-content#6511 --- > **AI-assisted draft** — created with Claude Sonnet 4.6 in Cursor. > Review all generated content for factual accuracy before merging. --------- Co-authored-by: Cursor <cursoragent@cursor.com>
…lastic#269868) ## Summary This PR addresses elastic/docs-content#6511. The page [General settings in Kibana](https://www.elastic.co/docs/reference/kibana/configuration-reference/general-settings) lists \`data.autocomplete.valueSuggestions.terminateAfter\` and \`data.autocomplete.valueSuggestions.timeout\` without any deprecation indicator, making them appear as valid current settings. These settings were deprecated in Kibana 8.3.0 when the autocomplete logic was moved from the \`data\` plugin to the \`unified_search\` plugin (now \`kql\`) via [elastic#129977](elastic#129977). The canonical settings since 8.3.0 are \`unifiedSearch.autocomplete.valueSuggestions.terminateAfter\` and \`unifiedSearch.autocomplete.valueSuggestions.timeout\`. The backward-compatible deprecation handler (which remaps the old keys to the new ones with a warning) was accidentally removed in [elastic#246674](elastic#246674) and restored in [elastic#268872](elastic#268872) (backported to v9.4.2 and v9.5.0). During the window between 9.4.0 and 9.4.1, customers using \`data.autocomplete.*\` in \`kibana.yml\` experienced startup failures. All three generations of the settings (\`kibana.*\`, \`data.*\`, \`unifiedSearch.*\`) are explicitly allowlisted in ECH and work for users on ECH deployments. ## Changes - **\`docs/reference/configuration-reference/general-settings.yml\`**: - Marks \`data.autocomplete.valueSuggestions.terminateAfter\` and \`data.autocomplete.valueSuggestions.timeout\` as \`deprecated 8.3\` on stack, with \`deprecation_details\` pointing to the \`unifiedSearch.*\` replacements. - Adds an inline note on both deprecated settings warning that using them in Kibana 9.4.0–9.4.1 causes a startup failure, and advising users to migrate or upgrade. - Adds \`unifiedSearch.autocomplete.valueSuggestions.timeout\` and \`unifiedSearch.autocomplete.valueSuggestions.terminateAfter\` as \`stack: ga 8.3\` entries so the canonical settings are properly documented. ## Resolves Closes elastic/docs-content#6511 --- > **AI-assisted draft** — created with Claude Sonnet 4.6 in Cursor. > Review all generated content for factual accuracy before merging. --------- Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
Part of #247265
Moves KQL to a separate plugin in order to be reused more easily and not create circular dependencies. Specifically this moves:
The circular dependencies problem is caused because:
The above were not possible as the unified search plugin references the esql plugin and to achieve the above we will need to import to esql plugin the unified search (causing circular dependencies)
Testing
As a code owner I am testing that if my applications are using KQL and/or unified search that everything works as expected
Checklist
release_note:breakinglabel should be applied in these situations.release_note:*label is applied per the guidelines