[9.5] [CPS] Fix CPS Scope Being Stamped Incorrectly (#280603)#280889
Open
hannahbrooks wants to merge 1 commit into
Open
[9.5] [CPS] Fix CPS Scope Being Stamped Incorrectly (#280603)#280889hannahbrooks wants to merge 1 commit into
hannahbrooks wants to merge 1 commit into
Conversation
Closes elastic#279328 `GET /_project_routing/{npreName}` returns `{ expression }` but the code was accessing it as `res[npreName].expression` — that key never exists, so it always fell back to `_alias:*`. Response type sourced from `NpreClient` in the CPS plugin (`src/platform/plugins/shared/cps/server/npre/npre_client.ts`), which calls the same endpoint and types the response as `{ expression: ProjectRouting }`. - Fixed the existing unit test mocks (they had the same wrong shape, so they never caught this) - Added a regression test: origin-routed space must stamp `_alias:_origin`, not `_alias:*` (cherry picked from commit b66d389)
hannahbrooks
marked this pull request as ready for review
July 24, 2026 20:56
kibanamachine
requested review from
darnautov
and removed request for
kibanamachine
July 24, 2026 20:57
Contributor
💛 Build succeeded, but was flaky
Failed CI Steps
Test Failures
Metrics [docs]
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport
This will backport the following commit from
mainto9.5:Backported manually because the automated backport tool hit merge conflicts (test mocks in
9.5still used the pre-refactor singleesClientshape rather than main'sinternalUserEsClient/currentUserEsClientsplit). The conflicts were resolved by keeping9.5's existing client shape and applying the same underlying fix: the/_project_routing/{npreName}response is{ expression }, not{ [npreName]: { expression } }.Note:
9.3and9.4are not backported —resolve_cps_data.tsdoesn't exist on those branches (it was introduced by #266495 after they branched off), so there's nothing to fix there.8.19was intentionally skipped.Questions?
Please refer to the Backport tool documentation
Made with Cursor