Skip to content

Make easy removable OSS→X-Pack plugin deps optional - #305876

Open
gsoldevila wants to merge 6 commits into
mainfrom
cursor/optional-plugin-deps-4575-ae5b
Open

gsoldevila wants to merge 6 commits into
mainfrom
cursor/optional-plugin-deps-4575-ae5b

Conversation

@gsoldevila

@gsoldevila gsoldevila commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

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:

OSS plugin Dependency Change
ftrApis taskManager Optional in manifest + types (routes already return 503 when absent)
aiAssistantManagementSelection licensing Optional in manifest + types (already guarded in start())
esql inference Optional; NL / suggest-fix / explain-error routes return 503 when absent

Intentionally excluded

esql → fileUpload stays required for now. Making it optional pulls in the @kbn/index-editor / @kbn/file-upload boundary (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

  • Unit tests updated for the three ES|QL inference routes when the plugin is missing
  • The correct release_note:* type label (or release_note:skip) is applied
  • Review the backport guidelines and apply applicable backport:* labels

Identify risks

  • Low: AI / NL-to-ES|QL / suggest-fix / explain-error HTTP APIs return 503 without inference instead of failing at boot; UI already gates on Enterprise license.
  • No config / HTTP contract renames; no data-loss risk.

@gsoldevila gsoldevila added Team:Core Platform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t// release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting labels Nov 17, 2026
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown
Contributor
🤖 Jobs for this PR can be triggered through checkboxes. 🚧

ℹ️ To trigger the CI, please tick the checkbox below 👇

  • Click to trigger kibana-pull-request for this PR!
  • Click to trigger kibana-deploy-project-from-pr for this PR!
  • Click to trigger kibana-deploy-cloud-from-pr for this PR!
  • Click to trigger kibana-entity-store-performance-from-pr for this PR!
  • Click to trigger kibana-storybooks-from-pr for this PR!
  • Click to trigger kibana-static-checks for this PR!

@gsoldevila
gsoldevila force-pushed the cursor/optional-plugin-deps-4575-ae5b branch from 60177cc to b30e8b5 Compare November 20, 2026 10:24
@gsoldevila gsoldevila changed the title Make removable OSS→X-Pack plugin dependencies optional Make easy removable OSS→X-Pack plugin deps optional Nov 20, 2026
@gsoldevila
gsoldevila marked this pull request as ready for review November 20, 2026 10:28
@gsoldevila
gsoldevila requested review from a team as code owners November 20, 2026 10:28
@botelastic botelastic Bot added the ci:project-deploy-observability Create an Observability project label Nov 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@gsoldevila gsoldevila self-assigned this Nov 20, 2026
@gsoldevila
gsoldevila force-pushed the cursor/optional-plugin-deps-4575-ae5b branch from b30e8b5 to d701d73 Compare November 20, 2026 11:13
// 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) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 stratoula left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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. */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Booooh, ok

@elastic-vault-github-plugin-prod

elastic-vault-github-plugin-prod Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Kibana Exploratory Testing — execution report

Run Metadata

  • Triggered by: Issue #2375
  • Elasticsearch image tag: 9.7.0-SNAPSHOT
  • Kibana image: docker.elastic.co/kibana-ci/kibana-serverless-pr:pr-305876-f3d2c2194940
  • Date: 2026-11-20
  • PR: elastic/kibana#305876 — Make easy removable OSS→X-Pack plugin deps optional
  • Mode: PR-targeted (journeys generated from PR diff)
  • Journeys executed: 8
  • Passed: 0
  • Errored: 8
  • Findings: 0 bugs, 8 warnings, 0 info

Findings

01_hierarchy_and_data_flow - ERROR

Severity: warning
Description: Journey failed with exit code 1.

02_routing_rule_lifecycle - ERROR

Severity: warning
Description: Journey failed with exit code 1.

03_processing_pipeline - ERROR

Severity: warning
Description: Journey failed with exit code 1.

04_schema_evolution - ERROR

Severity: warning
Description: Journey failed with exit code 1.

05_ai_suggestions - ERROR

Severity: warning
Description: Journey failed with exit code 1.

06_significant_events - ERROR

Severity: warning
Description: Journey failed with exit code 1.

07_retention_and_lifecycle - ERROR

Severity: warning
Description: Journey failed with exit code 1.

08_cross_feature_workflow - ERROR

Severity: warning
Description: Journey failed with exit code 1.

Additional details

Screenshots

Screenshots are available in the workflow artifacts.

Workflow run: View workflow run

gsoldevila and others added 6 commits November 20, 2026 14:22
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>
@gsoldevila
gsoldevila force-pushed the cursor/optional-plugin-deps-4575-ae5b branch from 133756f to f3d2c21 Compare November 20, 2026 13:22
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

Project deployed, see credentials at: https://buildkite.com/elastic/kibana-deploy-project-from-pr/builds/1818

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown
Contributor

💚 Build Succeeded

  • Buildkite Build
  • Commit: f3d2c21
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless-pr:pr-305876-f3d2c2194940

History

cc @gsoldevila

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
kbnUiSharedDeps-srcJs 5.5MB 5.5MB +4.0B
shared-plugins 12.4MB 12.4MB +37.0B
vendors-heavy 2.0MB 2.0MB +8.0B
total +49.0B
Unknown metric groups

shared async chunks total size

id before after diff
all 16.7MB 16.7MB +43.0B

total optimizer output size

id before after diff
all 69.2MB 69.2MB +88.0B

warm start memory

id before after diff
post forced gc heap baseline - 631521586 +631521586
post forced gc heap delta - -5272690 -5272690
post forced gc heap delta standard deviation - 3137399 +3137399
post forced gc heap target - 626248896 +626248896
tail heap delta - -5917409 -5917409
total +1249717782

workflow yaml validation

id before after diff
case_response.yaml (27 steps, 66 vars)/e2e/total 13 12 -1
case_response.yaml (27 steps, 66 vars)/validateVariables (66 vars) 2 1 -1
infosec_demo.yaml (150 steps, 270 vars)/e2e/performComputation 52 44 -8
infosec_demo.yaml (150 steps, 270 vars)/e2e/total 158 104 -54
infosec_demo.yaml (150 steps, 270 vars)/e2e/validateIfConditions 5 4 -1
infosec_demo.yaml (150 steps, 270 vars)/e2e/validateLiquidTemplate 2 1 -1
infosec_demo.yaml (150 steps, 270 vars)/e2e/validateStepNameUniqueness 2 1 -1
infosec_demo.yaml (150 steps, 270 vars)/e2e/validateVariables 53 39 -14
infosec_demo.yaml (150 steps, 270 vars)/validateStepNameUniqueness 2 1 -1
infosec_demo.yaml (150 steps, 270 vars)/validateVariables (270 vars) 40 37 -3
total -85

Test Failures

  • [job] [logs] FTR Configs #21 / Alerting executionStatus should eventually be "ok" for no-op alert
  • [job] [logs] Scout Lane #17 - stateful-classic / default / local-stateful-classic - Maps - Lens choropleth chart - should allow creation of choropleth chart
  • [job] [logs] Scout Lane #17 - stateful-classic / default / local-stateful-classic - Maps - Lens choropleth chart - should create choropleth chart from suggestion
  • [job] [logs] Scout Lane #15 - stateful-classic / default / local-stateful-classic - Network flyout v2 - clicking the source.ip value in the alerts table opens the network flyout v2

History

cc @gsoldevila

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting ci:project-deploy-observability Create an Observability project release_note:skip Skip the PR/issue when compiling release notes Team:Core Platform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t//

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants