Skip to content

[SecuritySolution] [Bug] Fix Manage data sources page index import #226099

Merged
machadoum merged 9 commits intoelastic:mainfrom
machadoum:siem-ea-12915
Jul 7, 2025
Merged

[SecuritySolution] [Bug] Fix Manage data sources page index import #226099
machadoum merged 9 commits intoelastic:mainfrom
machadoum:siem-ea-12915

Conversation

@machadoum
Copy link
Member

@machadoum machadoum commented Jul 2, 2025

Fix the Manage Data Sources page index import by implementing the creation, updating, deletion, and retrieval of entity source configurations. It includes updates to the TypeScript definitions, API schema, and client-side API methods to support these operations.

After this change, the user will be able to create only one data source using the UI.

API and types changes

  • Added new types (CreateMonitoringEntitySource, UpdatedMonitoringEntitySource, MonitoringEntitySource) with expanded fields for entity source configurations, such as indexPattern, enabled, error, and matchers. [1] [2] [3]

  • Updated the API schema (monitoring_entity_source.schema.yaml) to reflect new entity source operations, including CreateEntitySource, UpdateEntitySource, DeleteEntitySource, GetEntitySource, and ListEntitySources. Added support for query parameters and refined response schema definitions. [1] [2] [3] [4] [5] [6] [7]

  • Add a uniqueness assertion for the data source name.

  • Create the data source 'PUT' API that allows updates

  • Force the managed to be consistently defined by default

  • Update list data sources API to support filter params

UI changes

  • Extract IndexImportManageDataSource component to its file.
  • Stop calling the init API on updates
  • Implement the edit mode instead of creating a new data source on every save
    • Load the already added indices when editing
  • Fix the displayed added indices message to show the right value

Video

Screen.Recording.2025-07-02.at.10.16.15.mov

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

@machadoum machadoum changed the title Siem ea 12915 [SecuritySolution] [Bug] Fix Manage data sources page index import Jul 2, 2025
@machadoum machadoum self-assigned this Jul 2, 2025
@machadoum machadoum added release_note:skip Skip the PR/issue when compiling release notes Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Theme: entity_analytics Feature:Entity Analytics Security Solution Entity Analytics features Team:Entity Analytics Security Entity Analytics Team backport:version Backport to applied version labels v9.1.0 bug Fixes for quality problems that affect the customer experience labels Jul 2, 2025
@machadoum machadoum marked this pull request as ready for review July 2, 2025 11:33
@machadoum machadoum requested review from a team as code owners July 2, 2025 11:33
@machadoum machadoum requested a review from tiansivive July 2, 2025 11:33
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-entity-analytics (Team:Entity Analytics)


defaultOpts.soClient.update.mockResolvedValue({
id: `temp-id`, // TODO: https://github.com/elastic/security-team/issues/12851
id: 'entity-analytics-monitoring-entity-source-test-namespace-test-type-test-index-pattern', // TODO: https://github.com/elastic/security-team/issues/12851
Copy link
Contributor

Choose a reason for hiding this comment

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

We can move this comment out with the id here now - thank you for this Pablo 🙇

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure. Just to be 100% clear. This PR doesn't fix the issue described here https://github.com/elastic/security-team/issues/12851

It just ensures the create and update methods use the same ID. And the if is still based on the initial index pattern, which is weird since the user can update the index. Therefore, we need to work on improving the ID generation process.

Copy link
Contributor

@CAWilson94 CAWilson94 left a comment

Choose a reason for hiding this comment

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

Code looks good, nice test additions too 🚀 Thank you!

Copy link
Contributor

@tiansivive tiansivive left a comment

Choose a reason for hiding this comment

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

LGTM ✅
Left a question about a comment

@machadoum machadoum enabled auto-merge (squash) July 7, 2025 08:05
@elasticmachine
Copy link
Contributor

elasticmachine commented Jul 7, 2025

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #3 / MonitoringEntitySourceDataClient init should initialize Monitoring Entity Source Sync Config Successfully
  • [job] [logs] Jest Tests #3 / MonitoringEntitySourceDataClient init should initialize Monitoring Entity Source Sync Config Successfully
  • [job] [logs] Jest Tests #3 / MonitoringEntitySourceDataClient init should not create Monitoring Entity Source Sync Config when a SO already exist with the same name
  • [job] [logs] Jest Tests #3 / MonitoringEntitySourceDataClient init should not create Monitoring Entity Source Sync Config when a SO already exist with the same name
  • [job] [logs] Jest Tests #3 / MonitoringEntitySourceDataClient init should update Monitoring Entity Source Sync Config Successfully when calling init when the SO already exists
  • [job] [logs] Jest Tests #3 / MonitoringEntitySourceDataClient init should update Monitoring Entity Source Sync Config Successfully when calling init when the SO already exists
  • [job] [logs] Jest Tests #3 / MonitoringEntitySourceDataClient update should update Monitoring Entity Source Sync Config Successfully
  • [job] [logs] Jest Tests #3 / MonitoringEntitySourceDataClient update should update Monitoring Entity Source Sync Config Successfully

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
securitySolution 7819 7821 +2

Async chunks

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

id before after diff
securitySolution 9.8MB 9.8MB +1.3KB

Page load bundle

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

id before after diff
securitySolution 94.2KB 94.2KB +1.0B

History

cc @machadoum

@machadoum machadoum merged commit 8453edc into elastic:main Jul 7, 2025
13 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 9.1

https://github.com/elastic/kibana/actions/runs/16117178051

@kibanamachine
Copy link
Contributor

Starting backport for target branches: 9.1

https://github.com/elastic/kibana/actions/runs/16117183088

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
9.1 Backport failed because of merge conflicts

You might need to backport the following PRs to 9.1:
- Add API Key Management and Enable Index Sync via Scheduled Task (#225551)

Manual backport

To create the backport manually run:

node scripts/backport --pr 226099

Questions ?

Please refer to the Backport tool documentation

1 similar comment
@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
9.1 Backport failed because of merge conflicts

You might need to backport the following PRs to 9.1:
- Add API Key Management and Enable Index Sync via Scheduled Task (#225551)

Manual backport

To create the backport manually run:

node scripts/backport --pr 226099

Questions ?

Please refer to the Backport tool documentation

@machadoum
Copy link
Member Author

💚 All backports created successfully

Status Branch Result
9.1

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

machadoum added a commit to machadoum/kibana that referenced this pull request Jul 8, 2025
…lastic#226099)

Fix the Manage Data Sources page index import by implementing the
creation, updating, deletion, and retrieval of entity source
configurations. It includes updates to the TypeScript definitions, API
schema, and client-side API methods to support these operations.

After this change, the user will be able to create only one data source
using the UI.

### API and types changes
* Added new types (`CreateMonitoringEntitySource`,
`UpdatedMonitoringEntitySource`, `MonitoringEntitySource`) with expanded
fields for entity source configurations, such as `indexPattern`,
`enabled`, `error`, and `matchers`.
[[1]](diffhunk://#diff-b8c44f34825a1f7fa2c3f70fdda00f38b07e19ef8600e1a2e937660346d95c72R18-R21)
[[2]](diffhunk://#diff-b8c44f34825a1f7fa2c3f70fdda00f38b07e19ef8600e1a2e937660346d95c72L39-R64)
[[3]](diffhunk://#diff-b8c44f34825a1f7fa2c3f70fdda00f38b07e19ef8600e1a2e937660346d95c72R76-R122)

* Updated the API schema (`monitoring_entity_source.schema.yaml`) to
reflect new entity source operations, including `CreateEntitySource`,
`UpdateEntitySource`, `DeleteEntitySource`, `GetEntitySource`, and
`ListEntitySources`. Added support for query parameters and refined
response schema definitions.
[[1]](diffhunk://#diff-e7f2de573ae15c6a3c3781b2a97b9875299c0674f81dd673d2bf9b3a6cf397f1L10-R30)
[[2]](diffhunk://#diff-e7f2de573ae15c6a3c3781b2a97b9875299c0674f81dd673d2bf9b3a6cf397f1L42-R48)
[[3]](diffhunk://#diff-e7f2de573ae15c6a3c3781b2a97b9875299c0674f81dd673d2bf9b3a6cf397f1L58-R72)
[[4]](diffhunk://#diff-e7f2de573ae15c6a3c3781b2a97b9875299c0674f81dd673d2bf9b3a6cf397f1L78-R102)
[[5]](diffhunk://#diff-e7f2de573ae15c6a3c3781b2a97b9875299c0674f81dd673d2bf9b3a6cf397f1L88-R114)
[[6]](diffhunk://#diff-e7f2de573ae15c6a3c3781b2a97b9875299c0674f81dd673d2bf9b3a6cf397f1L128-R189)
[[7]](diffhunk://#diff-e7f2de573ae15c6a3c3781b2a97b9875299c0674f81dd673d2bf9b3a6cf397f1R219-R220)

* Add a uniqueness assertion for the data source name.

* Create the data source 'PUT' API that allows updates

* Force the `managed` to be consistently defined by default

* Update list data sources API to support filter params

### UI changes
* Extract `IndexImportManageDataSource` component to its file.
* Stop calling the `init` API on updates
* Implement the edit mode instead of creating a new data source on every
save
  * Load the already added indices when editing
* Fix the displayed added indices message to show the right value

### Video

https://github.com/user-attachments/assets/9d1c1ad1-09b9-49f0-8cea-1b640a26e954

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [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
- [x] 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)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

(cherry picked from commit 8453edc)
machadoum added a commit that referenced this pull request Jul 8, 2025
…ort (#226099) (#226921)

# Backport

This will backport the following commits from `main` to `9.1`:
- [[SecuritySolution] [Bug] Fix Manage data sources page index import
(#226099)](#226099)

<!--- Backport version: 10.0.1 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Pablo
Machado","email":"pablo.nevesmachado@elastic.co"},"sourceCommit":{"committedDate":"2025-07-07T12:39:14Z","message":"[SecuritySolution]
[Bug] Fix Manage data sources page index import (#226099)\n\nFix the
Manage Data Sources page index import by implementing the\ncreation,
updating, deletion, and retrieval of entity source\nconfigurations. It
includes updates to the TypeScript definitions, API\nschema, and
client-side API methods to support these operations.\n\nAfter this
change, the user will be able to create only one data source\nusing the
UI.\n\n### API and types changes \n* Added new types
(`CreateMonitoringEntitySource`,\n`UpdatedMonitoringEntitySource`,
`MonitoringEntitySource`) with expanded\nfields for entity source
configurations, such as `indexPattern`,\n`enabled`, `error`, and
`matchers`.\n[[1]](diffhunk://#diff-b8c44f34825a1f7fa2c3f70fdda00f38b07e19ef8600e1a2e937660346d95c72R18-R21)\n[[2]](diffhunk://#diff-b8c44f34825a1f7fa2c3f70fdda00f38b07e19ef8600e1a2e937660346d95c72L39-R64)\n[[3]](diffhunk://#diff-b8c44f34825a1f7fa2c3f70fdda00f38b07e19ef8600e1a2e937660346d95c72R76-R122)\n\n*
Updated the API schema (`monitoring_entity_source.schema.yaml`)
to\nreflect new entity source operations, including
`CreateEntitySource`,\n`UpdateEntitySource`, `DeleteEntitySource`,
`GetEntitySource`, and\n`ListEntitySources`. Added support for query
parameters and refined\nresponse schema
definitions.\n[[1]](diffhunk://#diff-e7f2de573ae15c6a3c3781b2a97b9875299c0674f81dd673d2bf9b3a6cf397f1L10-R30)\n[[2]](diffhunk://#diff-e7f2de573ae15c6a3c3781b2a97b9875299c0674f81dd673d2bf9b3a6cf397f1L42-R48)\n[[3]](diffhunk://#diff-e7f2de573ae15c6a3c3781b2a97b9875299c0674f81dd673d2bf9b3a6cf397f1L58-R72)\n[[4]](diffhunk://#diff-e7f2de573ae15c6a3c3781b2a97b9875299c0674f81dd673d2bf9b3a6cf397f1L78-R102)\n[[5]](diffhunk://#diff-e7f2de573ae15c6a3c3781b2a97b9875299c0674f81dd673d2bf9b3a6cf397f1L88-R114)\n[[6]](diffhunk://#diff-e7f2de573ae15c6a3c3781b2a97b9875299c0674f81dd673d2bf9b3a6cf397f1L128-R189)\n[[7]](diffhunk://#diff-e7f2de573ae15c6a3c3781b2a97b9875299c0674f81dd673d2bf9b3a6cf397f1R219-R220)\n\n*
Add a uniqueness assertion for the data source name.\n\n* Create the
data source 'PUT' API that allows updates\n\n* Force the `managed` to be
consistently defined by default\n\n* Update list data sources API to
support filter params\n\n### UI changes\n* Extract
`IndexImportManageDataSource` component to its file.\n* Stop calling the
`init` API on updates\n* Implement the edit mode instead of creating a
new data source on every\nsave\n * Load the already added indices when
editing\n* Fix the displayed added indices message to show the right
value\n\n###
Video\n\nhttps://github.com/user-attachments/assets/9d1c1ad1-09b9-49f0-8cea-1b640a26e954\n\n\n\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [x] Any text
added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\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- [x] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*`
labels.","sha":"8453edc55264144db5af97ab7ea13d727322c92d","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:
SecuritySolution","Theme: entity_analytics","Feature:Entity
Analytics","Team:Entity
Analytics","backport:version","v9.1.0","v9.2.0"],"title":"[SecuritySolution]
[Bug] Fix Manage data sources page index import
","number":226099,"url":"https://github.com/elastic/kibana/pull/226099","mergeCommit":{"message":"[SecuritySolution]
[Bug] Fix Manage data sources page index import (#226099)\n\nFix the
Manage Data Sources page index import by implementing the\ncreation,
updating, deletion, and retrieval of entity source\nconfigurations. It
includes updates to the TypeScript definitions, API\nschema, and
client-side API methods to support these operations.\n\nAfter this
change, the user will be able to create only one data source\nusing the
UI.\n\n### API and types changes \n* Added new types
(`CreateMonitoringEntitySource`,\n`UpdatedMonitoringEntitySource`,
`MonitoringEntitySource`) with expanded\nfields for entity source
configurations, such as `indexPattern`,\n`enabled`, `error`, and
`matchers`.\n[[1]](diffhunk://#diff-b8c44f34825a1f7fa2c3f70fdda00f38b07e19ef8600e1a2e937660346d95c72R18-R21)\n[[2]](diffhunk://#diff-b8c44f34825a1f7fa2c3f70fdda00f38b07e19ef8600e1a2e937660346d95c72L39-R64)\n[[3]](diffhunk://#diff-b8c44f34825a1f7fa2c3f70fdda00f38b07e19ef8600e1a2e937660346d95c72R76-R122)\n\n*
Updated the API schema (`monitoring_entity_source.schema.yaml`)
to\nreflect new entity source operations, including
`CreateEntitySource`,\n`UpdateEntitySource`, `DeleteEntitySource`,
`GetEntitySource`, and\n`ListEntitySources`. Added support for query
parameters and refined\nresponse schema
definitions.\n[[1]](diffhunk://#diff-e7f2de573ae15c6a3c3781b2a97b9875299c0674f81dd673d2bf9b3a6cf397f1L10-R30)\n[[2]](diffhunk://#diff-e7f2de573ae15c6a3c3781b2a97b9875299c0674f81dd673d2bf9b3a6cf397f1L42-R48)\n[[3]](diffhunk://#diff-e7f2de573ae15c6a3c3781b2a97b9875299c0674f81dd673d2bf9b3a6cf397f1L58-R72)\n[[4]](diffhunk://#diff-e7f2de573ae15c6a3c3781b2a97b9875299c0674f81dd673d2bf9b3a6cf397f1L78-R102)\n[[5]](diffhunk://#diff-e7f2de573ae15c6a3c3781b2a97b9875299c0674f81dd673d2bf9b3a6cf397f1L88-R114)\n[[6]](diffhunk://#diff-e7f2de573ae15c6a3c3781b2a97b9875299c0674f81dd673d2bf9b3a6cf397f1L128-R189)\n[[7]](diffhunk://#diff-e7f2de573ae15c6a3c3781b2a97b9875299c0674f81dd673d2bf9b3a6cf397f1R219-R220)\n\n*
Add a uniqueness assertion for the data source name.\n\n* Create the
data source 'PUT' API that allows updates\n\n* Force the `managed` to be
consistently defined by default\n\n* Update list data sources API to
support filter params\n\n### UI changes\n* Extract
`IndexImportManageDataSource` component to its file.\n* Stop calling the
`init` API on updates\n* Implement the edit mode instead of creating a
new data source on every\nsave\n * Load the already added indices when
editing\n* Fix the displayed added indices message to show the right
value\n\n###
Video\n\nhttps://github.com/user-attachments/assets/9d1c1ad1-09b9-49f0-8cea-1b640a26e954\n\n\n\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [x] Any text
added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\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- [x] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*`
labels.","sha":"8453edc55264144db5af97ab7ea13d727322c92d"}},"sourceBranch":"main","suggestedTargetBranches":["9.1"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/226099","number":226099,"mergeCommit":{"message":"[SecuritySolution]
[Bug] Fix Manage data sources page index import (#226099)\n\nFix the
Manage Data Sources page index import by implementing the\ncreation,
updating, deletion, and retrieval of entity source\nconfigurations. It
includes updates to the TypeScript definitions, API\nschema, and
client-side API methods to support these operations.\n\nAfter this
change, the user will be able to create only one data source\nusing the
UI.\n\n### API and types changes \n* Added new types
(`CreateMonitoringEntitySource`,\n`UpdatedMonitoringEntitySource`,
`MonitoringEntitySource`) with expanded\nfields for entity source
configurations, such as `indexPattern`,\n`enabled`, `error`, and
`matchers`.\n[[1]](diffhunk://#diff-b8c44f34825a1f7fa2c3f70fdda00f38b07e19ef8600e1a2e937660346d95c72R18-R21)\n[[2]](diffhunk://#diff-b8c44f34825a1f7fa2c3f70fdda00f38b07e19ef8600e1a2e937660346d95c72L39-R64)\n[[3]](diffhunk://#diff-b8c44f34825a1f7fa2c3f70fdda00f38b07e19ef8600e1a2e937660346d95c72R76-R122)\n\n*
Updated the API schema (`monitoring_entity_source.schema.yaml`)
to\nreflect new entity source operations, including
`CreateEntitySource`,\n`UpdateEntitySource`, `DeleteEntitySource`,
`GetEntitySource`, and\n`ListEntitySources`. Added support for query
parameters and refined\nresponse schema
definitions.\n[[1]](diffhunk://#diff-e7f2de573ae15c6a3c3781b2a97b9875299c0674f81dd673d2bf9b3a6cf397f1L10-R30)\n[[2]](diffhunk://#diff-e7f2de573ae15c6a3c3781b2a97b9875299c0674f81dd673d2bf9b3a6cf397f1L42-R48)\n[[3]](diffhunk://#diff-e7f2de573ae15c6a3c3781b2a97b9875299c0674f81dd673d2bf9b3a6cf397f1L58-R72)\n[[4]](diffhunk://#diff-e7f2de573ae15c6a3c3781b2a97b9875299c0674f81dd673d2bf9b3a6cf397f1L78-R102)\n[[5]](diffhunk://#diff-e7f2de573ae15c6a3c3781b2a97b9875299c0674f81dd673d2bf9b3a6cf397f1L88-R114)\n[[6]](diffhunk://#diff-e7f2de573ae15c6a3c3781b2a97b9875299c0674f81dd673d2bf9b3a6cf397f1L128-R189)\n[[7]](diffhunk://#diff-e7f2de573ae15c6a3c3781b2a97b9875299c0674f81dd673d2bf9b3a6cf397f1R219-R220)\n\n*
Add a uniqueness assertion for the data source name.\n\n* Create the
data source 'PUT' API that allows updates\n\n* Force the `managed` to be
consistently defined by default\n\n* Update list data sources API to
support filter params\n\n### UI changes\n* Extract
`IndexImportManageDataSource` component to its file.\n* Stop calling the
`init` API on updates\n* Implement the edit mode instead of creating a
new data source on every\nsave\n * Load the already added indices when
editing\n* Fix the displayed added indices message to show the right
value\n\n###
Video\n\nhttps://github.com/user-attachments/assets/9d1c1ad1-09b9-49f0-8cea-1b640a26e954\n\n\n\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [x] Any text
added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\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- [x] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*`
labels.","sha":"8453edc55264144db5af97ab7ea13d727322c92d"}}]}]
BACKPORT-->
kertal pushed a commit to kertal/kibana that referenced this pull request Jul 25, 2025
…lastic#226099)

Fix the Manage Data Sources page index import by implementing the
creation, updating, deletion, and retrieval of entity source
configurations. It includes updates to the TypeScript definitions, API
schema, and client-side API methods to support these operations.

After this change, the user will be able to create only one data source
using the UI.

### API and types changes 
* Added new types (`CreateMonitoringEntitySource`,
`UpdatedMonitoringEntitySource`, `MonitoringEntitySource`) with expanded
fields for entity source configurations, such as `indexPattern`,
`enabled`, `error`, and `matchers`.
[[1]](diffhunk://#diff-b8c44f34825a1f7fa2c3f70fdda00f38b07e19ef8600e1a2e937660346d95c72R18-R21)
[[2]](diffhunk://#diff-b8c44f34825a1f7fa2c3f70fdda00f38b07e19ef8600e1a2e937660346d95c72L39-R64)
[[3]](diffhunk://#diff-b8c44f34825a1f7fa2c3f70fdda00f38b07e19ef8600e1a2e937660346d95c72R76-R122)

* Updated the API schema (`monitoring_entity_source.schema.yaml`) to
reflect new entity source operations, including `CreateEntitySource`,
`UpdateEntitySource`, `DeleteEntitySource`, `GetEntitySource`, and
`ListEntitySources`. Added support for query parameters and refined
response schema definitions.
[[1]](diffhunk://#diff-e7f2de573ae15c6a3c3781b2a97b9875299c0674f81dd673d2bf9b3a6cf397f1L10-R30)
[[2]](diffhunk://#diff-e7f2de573ae15c6a3c3781b2a97b9875299c0674f81dd673d2bf9b3a6cf397f1L42-R48)
[[3]](diffhunk://#diff-e7f2de573ae15c6a3c3781b2a97b9875299c0674f81dd673d2bf9b3a6cf397f1L58-R72)
[[4]](diffhunk://#diff-e7f2de573ae15c6a3c3781b2a97b9875299c0674f81dd673d2bf9b3a6cf397f1L78-R102)
[[5]](diffhunk://#diff-e7f2de573ae15c6a3c3781b2a97b9875299c0674f81dd673d2bf9b3a6cf397f1L88-R114)
[[6]](diffhunk://#diff-e7f2de573ae15c6a3c3781b2a97b9875299c0674f81dd673d2bf9b3a6cf397f1L128-R189)
[[7]](diffhunk://#diff-e7f2de573ae15c6a3c3781b2a97b9875299c0674f81dd673d2bf9b3a6cf397f1R219-R220)

* Add a uniqueness assertion for the data source name.

* Create the data source 'PUT' API that allows updates

* Force the `managed` to be consistently defined by default

* Update list data sources API to support filter params

### UI changes
* Extract `IndexImportManageDataSource` component to its file.
* Stop calling the `init` API on updates
* Implement the edit mode instead of creating a new data source on every
save
  * Load the already added indices when editing
* Fix the displayed added indices message to show the right value

### Video

https://github.com/user-attachments/assets/9d1c1ad1-09b9-49f0-8cea-1b640a26e954




### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [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
- [x] 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)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.
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 bug Fixes for quality problems that affect the customer experience Feature:Entity Analytics Security Solution Entity Analytics features release_note:skip Skip the PR/issue when compiling release notes Team:Entity Analytics Security Entity Analytics Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Theme: entity_analytics v9.1.0 v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants