Repository navigation
Make easy removable OSS→X-Pack plugin deps optional - #305876
gsoldevila wants to merge 6 commits into
Conversation
|
🤖 Jobs for this PR can be triggered through checkboxes. 🚧
ℹ️ To trigger the CI, please tick the checkbox below 👇
|
60177cc to
b30e8b5
Compare
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
b30e8b5 to
d701d73
Compare
| // Task Manager is a required dependency of Security. Without it, privilege checks on the | ||
| // FTR Saved Objects routes are not enforced — keep those routes unregistered (same as when | ||
| // ftrApis itself used to be disabled by a required taskManager edge). | ||
| if (this.config.disableApis || !taskManager) { |
There was a problem hiding this comment.
Severity: P3 (Low)
Add a setup regression test that omits Task Manager while disableApis is false and verifies that no routes are registered. This branch is now what keeps the FTR Saved Objects routes off when Security cannot enforce their required privilege; tests that run with Task Manager enabled would not catch the guard being removed.
Generated by Libra. React with 👍 or 👎 to give feedback on this comment.
|
|
||
| // Load after the inference guard: @kbn/agent-builder-genai-utils pulls in | ||
| // inference-plugin code and must not run when that package is omitted. | ||
| const { generateEsql, generateEsqlCompletion } = await import( |
There was a problem hiding this comment.
Severity: P3 (Low)
The NL-to-ES|QL and suggest-fix 503 tests would still pass if either route went back to importing the AI utilities at startup: both suites preload a working mock. Add coverage that makes the package fail to load, then verifies that both routes can register and return 503 without inference. That would catch the startup regression this lazy import is meant to prevent.
Generated by Libra. React with 👍 or 👎 to give feedback on this comment.
stratoula
left a comment
There was a problem hiding this comment.
Thanks Gerard! Just a small thingy
| export interface EsqlPluginStart { | ||
| variablesService: EsqlVariablesService; | ||
| isServerless: boolean; | ||
| /** True when the optional inference plugin is available for NL / suggest-fix features. */ |
There was a problem hiding this comment.
Do we need an extra flag here Gerard? We can only send the inference and then check in the hook if it is avaiable or not (to avoid 2 props)
There was a problem hiding this comment.
Good call — dropped isInferenceAvailable and now pass through optional inference?: InferencePublicStart on the esql start contract. useNlToEsqlCheck gates on Boolean(esql?.inference) (plus the existing Enterprise license check). Editor side uses a type-only import of InferencePublicStart.
There was a problem hiding this comment.
I've just noticed that by doing that we force the @kbn/esql-editor to know the type of the inference plugin contract, thus introducing a type dependency oss => xpack.
The editor does not directly depend on the inference contract (only on its APIs being available), so exposing / gating it on a simple boolean seems cleaner.
Kibana Exploratory Testing — execution reportRun Metadata
Findings01_hierarchy_and_data_flow - ERRORSeverity: warning 02_routing_rule_lifecycle - ERRORSeverity: warning 03_processing_pipeline - ERRORSeverity: warning 04_schema_evolution - ERRORSeverity: warning 05_ai_suggestions - ERRORSeverity: warning 06_significant_events - ERRORSeverity: warning 07_retention_and_lifecycle - ERRORSeverity: warning 08_cross_feature_workflow - ERRORSeverity: warning Additional detailsScreenshotsScreenshots are available in the workflow artifacts. Workflow run: View workflow run |
Move three required dependencies that only back optional features to optionalPlugins so OSS can keep the owning plugins enabled: - ftrApis → taskManager (types; routes already 503 when absent) - aiAssistantManagementSelection → licensing (types; already guarded) - esql → inference (503 from NL/suggest/explain routes when absent) Intentionally leaves esql → fileUpload required: the index-editor / file-upload boundary needs a separate strategy discussion. Refs elastic/kibana-team#4575 Co-authored-by: Gerard Soldevila <gsoldevila@users.noreply.github.com>
- ftrApis: register SO/TM routes only when taskManager is present at setup (Security depends on TM); lazy-load TM routes to avoid TaskCost import when the package is omitted - esql: dynamically import agent-builder-genai-utils after the inference availability guard - esql editor: gate NL-to-ES|QL / suggest-fix UI on isInferenceAvailable as well as the Enterprise license Co-authored-by: Gerard Soldevila <gsoldevila@users.noreply.github.com>
Drop isInferenceAvailable and expose inference?: InferencePublicStart on the public start contract. useNlToEsqlCheck gates on Boolean(esql?.inference) plus the Enterprise license check. Co-authored-by: Gerard Soldevila <gsoldevila@users.noreply.github.com>
Pass-through of inference?: InferencePublicStart only fed a presence check in useNlToEsqlCheck and pulled @kbn/inference-plugin into the OSS kbn-esql-editor package. Restore the boolean on esql start and drop the editor type dependency (tsconfig / moon.yml). Co-authored-by: Gerard Soldevila <gsoldevila@users.noreply.github.com>
133756f to
f3d2c21
Compare
|
Project deployed, see credentials at: https://buildkite.com/elastic/kibana-deploy-project-from-pr/builds/1818 |
💚 Build Succeeded
History
cc @gsoldevila |
💛 Build succeeded, but was flaky
Failed CI Steps
Metrics [docs]Page load bundle
Unknown metric groupsshared async chunks total size
total optimizer output size
warm start memory
workflow yaml validation
Test Failures
History
cc @gsoldevila |
Summary
Part of elastic/kibana-team#4575 (parent #4515).
Moves three required OSS → X-Pack dependencies that only back optional features into
optionalPlugins, so OSS can keep the owning plugins enabled:ftrApistaskManageraiAssistantManagementSelectionlicensingstart())esqlinferenceIntentionally excluded
esql→fileUploadstays required for now. Making it optional pulls in the@kbn/index-editor/@kbn/file-uploadboundary (runtime imports beyond the plugin manifest), which needs a separate strategy discussion before changing.Owners for review:
@elastic/kibana-core(ftrApis),@elastic/search-ml-ux(aiAssistantManagementSelection),@elastic/kibana-discover(esql).Checklist
release_note:*type label (orrelease_note:skip) is appliedbackport:*labelsIdentify risks
inferenceinstead of failing at boot; UI already gates on Enterprise license.