Skip to content

Conversation

@juliaElastic
Copy link
Contributor

@juliaElastic juliaElastic commented Dec 3, 2025

Summary

Closes https://github.com/elastic/ingest-dev/issues/6276

WIP: add test coverage

  • Enable feature flag installIntegrationsKnowledge by default
  • Added setting integration_knowledge_enabled to ingest_manager_settings SO to save the UI setting
  • When the integration knowledge user setting is turned off, new package installations will skip the knowledge base indexing step
  • When the integration knowledge user setting is turned on again, there is a one-time async task scheduled that reindexes knowledge base for installed packages

The Manage integration knowledge action is added to Installed integrations table.

image

Clicking the action opens the flyout about the Knowledge base information and the switch to be able to opt out.
image

UX design follows Figma

To verify:

  • Open the flyout and verify that the switch is on by default
  • Turn the switch off and click Save on the flyout
  • Install a new package and verify that the knowledge_base ES asset is not created
  • Go back to the flyout and switch the setting on again
  • Verify that the previously installed package has now an ES asset type knowledge_base
GET .kibana_ingest/_doc/epm-packages:apache

"installed_es": [
...
        {
          "id": "apache-README.md",
          "type": "knowledge_base"
        }
      ],

Kibana logs


[2025-12-03T13:30:34.253+01:00][INFO ][plugins.fleet] Scheduling task to reindex integration knowledge for installed packages

[2025-12-03T13:30:36.584+01:00][DEBUG][plugins.fleet] Successfully indexed 1 knowledge base documents for package apache. Document IDs: apache-README.md
[2025-12-03T13:30:36.585+01:00][DEBUG][plugins.fleet] Knowledge base step: Saved 1 documents to index for package [email protected]
[2025-12-03T13:30:36.587+01:00][DEBUG][plugins.fleet] Successfully indexed 1 knowledge base documents for package system. Document IDs: system-README.md
[2025-12-03T13:30:36.587+01:00][DEBUG][plugins.fleet] Knowledge base step: Saved 1 documents to index for package [email protected]

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

  • Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests 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
  • 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.
  • Flaky Test Runner was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
  • Review the backport guidelines and apply applicable backport:* labels.

Identify risks

Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging.

@juliaElastic juliaElastic added release_note:feature Makes this part of the condensed release notes backport:version Backport to applied version labels v9.3.0 labels Dec 3, 2025
}
];

if (selectedItems.length > 0) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Previously the Actions button was disabled if there were no integrations selected.
Now the new Manage integration knowledge is available even if there are no selected items.

await pMap(
installedPackages.saved_objects,
async ({ attributes: installation }) => {
// TODO archiveIterator is different if `install_source !== 'registry'`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is a different way to create archiveIterator for packages depending on install source, which makes this logic a little complex.
Alternatively we could call reinstallPackageForInstallation which would call all package install steps.

Or skip the reindex if the package is not installed from registry.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Solved this for bundled packages and skipping other types (uploaded, custom).

This is similar to who the reinstall logic works: https://github.com/elastic/kibana/blob/main/x-pack/platform/plugins/shared/fleet/server/services/epm/packages/reinstall.ts#L29

…atus --include-path /api/alerting/rule/ --include-path /api/alerting/rules --include-path /api/actions --include-path /api/security/role --include-path /api/spaces --include-path /api/streams --include-path /api/fleet --include-path /api/saved_objects/_import --include-path /api/saved_objects/_export --include-path /api/maintenance_window --include-path /api/agent_builder --update
installation.version,
{ useStreaming: true }
);
await indexKnowledgeBase(
Copy link
Contributor Author

@juliaElastic juliaElastic Dec 3, 2025

Choose a reason for hiding this comment

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

Is there a way to determine if an installed package already has the latest knowledge base assets created?
If so, we could skip the reindexing for those packages.
@Supplementing You might now this?

We could check the existence of any knowledge_base type assets, but it's not guaranteed it belongs to the latest package version.

{
    "id": "apache-README.md",
    "type": "knowledge_base"
  }

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, theres an internal endpoint that will return the indexed KB docs for the package, along with the current version for each asset.

GET /internal/fleet/epm/packages/{pkgName}/knowledge_base

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I could use this to check if knowledge base items exist for the currently installed package version, and if so, skip the reindexing.

[2025-12-03T16:28:40.479+01:00][DEBUG][plugins.fleet] Skipping reindexing knowledge base for package [email protected] - already indexed

</EuiButtonEmpty>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButton
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently the setting is changed only when the Save button is clicked.
I'm wondering if it would be simpler to change the setting when the switch is clicked, and get rid of the Save button.
cc @sileschristian

@juliaElastic juliaElastic marked this pull request as ready for review December 3, 2025 16:00
@juliaElastic juliaElastic requested review from a team as code owners December 3, 2025 16:00
@elasticmachine
Copy link
Contributor

elasticmachine commented Dec 3, 2025

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #21 / EPM Endpoints updates all assets when updating a package to a different version should have updated the saved object
  • [job] [logs] FTR Configs #21 / EPM Endpoints updates all assets when updating a package to a different version should have updated the saved object
  • [job] [logs] FTR Configs #105 / Machine Learning model management GET model_management/nodes_overview returns nodes overview
  • [job] [logs] FTR Configs #105 / Machine Learning model management GET model_management/nodes_overview returns nodes overview
  • [job] [logs] FTR Configs #62 / Maps endpoints apis search ES|QL should return getValues response in expected shape
  • [job] [logs] FTR Configs #62 / Maps endpoints apis search ES|QL should return getValues response in expected shape
  • [job] [logs] FTR Configs #1 / Package policies Package Policy - upgrade when upgrading from an integration package to an input package where no required variable has been added upgrade upgrades the package policy and creates the correct templates
  • [job] [logs] FTR Configs #1 / Package policies Package Policy - upgrade when upgrading from an integration package to an input package where no required variable has been added upgrade upgrades the package policy and creates the correct templates
  • [job] [logs] FTR Configs #98 / serverless security UI Security ML Trained models list page navigation renders trained models list
  • [job] [logs] FTR Configs #98 / serverless security UI Security ML Trained models list page navigation renders trained models list
  • [job] [logs] FTR Configs #57 / task_manager check_registered_task_types should check changes on all registered task types
  • [job] [logs] FTR Configs #57 / task_manager check_registered_task_types should check changes on all registered task types

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
fleet 1371 1372 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
fleet 2.1MB 2.1MB +4.0KB

History

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

Labels

backport:version Backport to applied version labels release_note:feature Makes this part of the condensed release notes v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants