Skip to content

Conversation

@valeriy42
Copy link
Contributor

@valeriy42 valeriy42 commented Dec 18, 2025

Enable ML datafeeds to search across multiple projects with unqualified index patterns by removing the artificial CPS block and integrating CPS mode detection. Since datafeeds already support CCS remote indices and RemoteClusterAware.isRemoteIndexName() returns true for both CCS (cluster:index) and CPS (project:index) patterns, existing remote-handling code already works for CPS.

This commit introduces support for Cross-Project Search (CPS) in the Datafeed configuration. Key changes include:

- Updated `PutDatafeedAction` and `UpdateDatafeedAction` to accept a new parameter for enabling CPS during request parsing.
- Enhanced `DatafeedConfig` to handle CPS options, including serialization and deserialization of the `resolve_cross_project_index_expression` field.
- Added integration tests to validate CPS functionality in datafeeds, ensuring that CPS-enabled indices can be created and retrieved correctly.
- Adjusted existing tests to reflect the new CPS capabilities and removed restrictions that previously prevented CPS usage in datafeeds.

These changes facilitate the use of CPS in machine learning datafeeds, allowing for more flexible data retrieval across projects.
@elasticsearchmachine elasticsearchmachine added needs:triage Requires assignment of a team area label v9.4.0 labels Dec 18, 2025
@valeriy42 valeriy42 added >enhancement :ml Machine learning Team:ML Meta label for the ML team and removed needs:triage Requires assignment of a team area label v9.4.0 labels Dec 18, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/ml-core (Team:ML)

@valeriy42 valeriy42 added test-full-bwc Trigger full BWC version matrix tests v9.4.0 labels Dec 18, 2025
@elasticsearchmachine
Copy link
Collaborator

Hi @valeriy42, I've created a changelog YAML for you.

elasticsearchmachine and others added 4 commits December 18, 2025 20:51
This commit refactors the `PutDatafeedAction` and `UpdateDatafeedAction` classes to leverage a new method in `DatafeedConfig` for managing Cross-Project Search (CPS) settings. Key changes include:

- Replaced inline CPS handling logic with a call to `DatafeedConfig.ensureCrossProjectSearchEnabled`, simplifying the code and improving maintainability.
- Updated the `DatafeedUpdate` parser to correctly handle the `resolve_cross_project_index_expression` field during deserialization.
- Added tests to ensure that CPS options are correctly applied and serialized.

These changes enhance the clarity and efficiency of CPS management within datafeed actions, supporting better integration of cross-project capabilities in machine learning workflows.
@valeriy42 valeriy42 marked this pull request as draft December 19, 2025 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>enhancement :ml Machine learning Team:ML Meta label for the ML team test-full-bwc Trigger full BWC version matrix tests v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants