Skip to content

[CPS] Update asScoped call sites - @elastic/actionable-obs-team#254459

Closed
gsoldevila wants to merge 1 commit into
elastic:mainfrom
gsoldevila:cps-asscoped-actionable-obs
Closed

[CPS] Update asScoped call sites - @elastic/actionable-obs-team#254459
gsoldevila wants to merge 1 commit into
elastic:mainfrom
gsoldevila:cps-asscoped-actionable-obs

Conversation

@gsoldevila
Copy link
Copy Markdown
Member

@gsoldevila gsoldevila commented Feb 23, 2026

Background

Cross-Project Search (CPS) is a Serverless feature that orchestrates searches across Elastic projects using project_routing headers, injected at the ES client level by Kibana.

#254186 introduced a new optional opts parameter to elasticsearch.client.asScoped() that lets callers explicitly declare their CPS routing intent. This PR is one of a series that updates call sites owned by @elastic/actionable-obs-team.

What changed

All asScoped() call sites in this PR have been annotated with a // TODO REVIEW comment and an explicit projectRouting option (pre-selected based on whether the request carries a url: URL property). The annotation is intentional: it is meant to prompt the owning team to review each call site and confirm or adjust the routing choice.

What you need to do

Please review each // TODO REVIEW annotated call site and decide the correct routing strategy:

  • projectRouting: 'space' — the client will inject the current space NPRE (Named Project Routing Expression) so that searches are scoped to the user's space. The request object passed to asScoped() must carry a url: URL property; if it does not (e.g. FakeRequest, background tasks), this will throw at runtime.
  • projectRouting: 'origin-only' — no project routing is injected automatically. Use this for system/background requests or any context where the request object has no URL.

Once you have confirmed the routing choice for each call site, please take ownership of this PR, update the options as needed, and remove the // TODO REVIEW comments before merging.

@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 Feb 23, 2026
@elasticmachine
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!

@gsoldevila gsoldevila force-pushed the cps-asscoped-actionable-obs branch 2 times, most recently from 04d8693 to 0aa8018 Compare February 23, 2026 15:54
@gsoldevila gsoldevila force-pushed the cps-asscoped-actionable-obs branch from 0aa8018 to 37f2d31 Compare February 23, 2026 16:09
@gsoldevila gsoldevila changed the title [CPS] Make asScoped opts mandatory - @elastic/actionable-obs-team [CPS] Update asScoped call sites - @elastic/actionable-obs-team Feb 23, 2026
@gsoldevila
Copy link
Copy Markdown
Member Author

Superseded by the consolidated PR #255066, which makes opts mandatory and updates all call sites in a single change.

@gsoldevila gsoldevila closed this Feb 26, 2026
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 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.

2 participants