Skip to content

Commit 4aee3df

Browse files
committed
Merge branch 'main' of https://github.com/elastic/kibana into canvas/remove-legacy-embeddable-functions
2 parents eb98de2 + a7c3e61 commit 4aee3df

182 files changed

Lines changed: 9050 additions & 589 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.buildkite/ftr_platform_stateful_configs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,7 @@ enabled:
406406
- x-pack/platform/test/api_integration/apis/monitoring_collection/config.ts
407407
- x-pack/platform/test/api_integration/apis/osquery/config.ts
408408
- x-pack/platform/test/api_integration/apis/search/config.ts
409+
- x-pack/platform/test/api_integration/apis/search_inference_endpoints/config.ts
409410
- x-pack/platform/test/api_integration/apis/searchprofiler/config.ts
410411
- x-pack/platform/test/api_integration/apis/security/config_security_trial.ts
411412
- x-pack/platform/test/api_integration/apis/spaces/config.ts

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2423,6 +2423,8 @@ x-pack/platform/test/functional/page_objects/search_profiler_page.ts @elastic/se
24232423
/x-pack/platform/test/serverless/functional/page_objects/svl_api_keys.ts @elastic/search-kibana
24242424
/x-pack/solutions/search/test/functional_search/ @elastic/search-kibana
24252425
/x-pack/solutions/search/test/api_integration/apis/search_playground/ @elastic/search-kibana
2426+
/x-pack/platform/test/api_integration/apis/search_inference_endpoints/ @elastic/search-kibana
2427+
/x-pack/platform/test/serverless/api_integration/test_suites/search_inference_endpoints/ @elastic/search-kibana
24262428

24272429
# workplaceai
24282430
/x-pack/solutions/workplaceai/test/serverless/api_integration/configs/config.ts @elastic/search-kibana @elastic/appex-qa

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,7 +1481,7 @@
14811481
"suricata-sid-db": "1.0.2",
14821482
"swr": "2.3.3",
14831483
"symbol-observable": "4.0.0",
1484-
"tar": "7.5.8",
1484+
"tar": "7.5.11",
14851485
"textarea-caret": "3.1.0",
14861486
"tree-dump": "1.1.0",
14871487
"ts-easing": "0.2.0",
@@ -2098,7 +2098,7 @@
20982098
"sass-loader": "10.5.2",
20992099
"selenium-webdriver": "4.40.0",
21002100
"sharp": "0.34.5",
2101-
"simple-git": "3.27.0",
2101+
"simple-git": "3.32.3",
21022102
"simple-statistics": "7.8.8",
21032103
"sinon": "21.0.1",
21042104
"sort-package-json": "3.2.1",

packages/kbn-check-saved-objects-cli/current_fields.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,7 @@
709709
"title",
710710
"type"
711711
],
712+
"inference-settings": [],
712713
"infra-custom-dashboards": [
713714
"assetType",
714715
"dashboardFilterAssetIdEnabled",

packages/kbn-check-saved-objects-cli/current_mappings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2353,6 +2353,10 @@
23532353
}
23542354
}
23552355
},
2356+
"inference-settings": {
2357+
"dynamic": false,
2358+
"properties": {}
2359+
},
23562360
"infra-custom-dashboards": {
23572361
"dynamic": false,
23582362
"properties": {

src/core/packages/elasticsearch/client-server-internal/src/cluster_client.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ describe('ClusterClient', () => {
338338
onRequest.get()({} as never, params, {});
339339

340340
expect((params.body as Record<string, unknown>).project_routing).toBe(
341-
'kibana_space_my-space_default'
341+
'@kibana_space_my-space_default'
342342
);
343343
});
344344

src/core/packages/saved-objects/server-internal/src/object_types/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ export { registerCoreObjectTypes } from './registration';
1111

1212
// set minimum number of registered saved objects to ensure no object types are removed after 8.8
1313
// declared in internal implementation explicitly to prevent unintended changes.
14-
export const SAVED_OBJECT_TYPES_COUNT = 149 as const;
14+
export const SAVED_OBJECT_TYPES_COUNT = 150 as const;

src/core/server/integration_tests/ci_checks/saved_objects/check_registered_types.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ describe('checking migration metadata changes on all registered SO types', () =>
128128
"gap_auto_fill_scheduler": "999fc5b82b06e7d0cb7ccd6fe7e98d0deb8da9de4d3a597614051a2162a4f1e2",
129129
"graph-workspace": "8adf653e4f4077bd4bad75edb3fc07e7978cb7b2aaa8d105a409bcd2f27fccec",
130130
"index-pattern": "97de563e0aea6135a10dcec02e48fba69404e86c404db78855476d947b71f70e",
131+
"inference-settings": "a318995bd9b44f06069a53efe025a2adc928c95607b4d9c3852c7c3fdc73d148",
131132
"infra-custom-dashboards": "ecf04d387399d169ab60737f6869f1e564d03dd683315c486ac50984ecf9c9e9",
132133
"infrastructure-monitoring-log-view": "a15ae1d2c400f2ea175cd407705dccd85178f9db82def8137b24c4ee4a489ae9",
133134
"infrastructure-ui-source": "498c2ba7abd4329a0d8b40efd98b4b16991107512d38141707f9f2e10521b367",
@@ -787,6 +788,11 @@ describe('checking migration metadata changes on all registered SO types', () =>
787788
"index-pattern|warning: This type uses 'migrations:' WRAPPER functions that prevent detecting changes in the implementation.",
788789
"index-pattern|warning: The SO type owner should ensure these transform functions DO NOT mutate after they are defined.",
789790
"======================================================================================================================",
791+
"inference-settings|global: 8ab54509d6f1e99a8ffee306623a091d739bd121",
792+
"inference-settings|mappings: e1b10e5bec060a176469a5e9a4f80c94e23abcd7",
793+
"inference-settings|schemas: da39a3ee5e6b4b0d3255bfef95601890afd80709",
794+
"inference-settings|10.1.0: af0d2da66317bf7704a9c8b28e9930e0c94361cc4d5156cc2ae65b8141365e3e",
795+
"===========================================================================================",
790796
"infra-custom-dashboards|global: 1b06d42d7dccce40b06e976e15d92489db9e815f",
791797
"infra-custom-dashboards|mappings: 62818be6fba4040c54ed2c35c9c353267e511b8d",
792798
"infra-custom-dashboards|schemas: da39a3ee5e6b4b0d3255bfef95601890afd80709",
@@ -1424,6 +1430,7 @@ describe('checking migration metadata changes on all registered SO types', () =>
14241430
"gap_auto_fill_scheduler": "10.1.0",
14251431
"graph-workspace": "10.0.0",
14261432
"index-pattern": "10.0.0",
1433+
"inference-settings": "10.1.0",
14271434
"infra-custom-dashboards": "10.2.0",
14281435
"infrastructure-monitoring-log-view": "10.0.0",
14291436
"infrastructure-ui-source": "10.0.0",
@@ -1583,6 +1590,7 @@ describe('checking migration metadata changes on all registered SO types', () =>
15831590
"gap_auto_fill_scheduler": "10.1.0",
15841591
"graph-workspace": "7.11.0",
15851592
"index-pattern": "7.11.0",
1593+
"inference-settings": "10.1.0",
15861594
"infra-custom-dashboards": "10.2.0",
15871595
"infrastructure-monitoring-log-view": "0.0.0",
15881596
"infrastructure-ui-source": "7.16.2",

src/core/server/integration_tests/elasticsearch/project_routing_serverless_cps.test.ts

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -809,4 +809,166 @@ describe('project_routing on serverless CPS', () => {
809809
expect(counts).toEqual(SORTED_COUNTS_DESC);
810810
});
811811
});
812+
813+
/**
814+
* Tests for NPRE (Named Project Routing Expressions) lifecycle and usage.
815+
*
816+
* NPREs are created via `PUT /_project_routing/{name}` with an `expression` field,
817+
* and referenced in requests using the `@{name}` syntax in `project_routing`.
818+
*
819+
* Two NPREs are tested:
820+
* - `_alias:*` - routes to any index accessible via any alias
821+
* - `_alias:_origin` - routes to the origin project's own indices
822+
*
823+
* A test alias on the test index is created so that `_alias:*` can resolve it.
824+
*/
825+
describe('NPRE (named project routing expressions) lifecycle and usage', () => {
826+
const TEST_ALIAS = `${TEST_INDEX}-alias`;
827+
const NPRE_ALIAS_STAR = 'cps-test-alias-star';
828+
const NPRE_ALIAS_ORIGIN = 'cps-test-alias-origin';
829+
830+
const deleteNpre = (name: string) =>
831+
client?.transport
832+
.request({ method: 'DELETE', path: `/_project_routing/${name}` })
833+
.catch(() => {});
834+
835+
beforeAll(async () => {
836+
// Create an alias on the test index so that '_alias:*' can resolve it.
837+
await client.indices.putAlias({ index: TEST_INDEX, name: TEST_ALIAS });
838+
839+
await client.transport.request({
840+
method: 'PUT',
841+
path: `/_project_routing/${NPRE_ALIAS_STAR}`,
842+
body: { expression: '_alias:*' },
843+
});
844+
await client.transport.request({
845+
method: 'PUT',
846+
path: `/_project_routing/${NPRE_ALIAS_ORIGIN}`,
847+
body: { expression: '_alias:_origin' },
848+
});
849+
});
850+
851+
afterAll(async () => {
852+
await deleteNpre(NPRE_ALIAS_STAR);
853+
await deleteNpre(NPRE_ALIAS_ORIGIN);
854+
await client?.indices.deleteAlias({ index: TEST_INDEX, name: TEST_ALIAS }).catch(() => {});
855+
});
856+
857+
describe(`with expression '_alias:*' (any alias)`, () => {
858+
it('search returns results', async () => {
859+
const response = await client.search({
860+
index: TEST_ALIAS,
861+
query: { match_all: {} },
862+
body: {
863+
// @ts-expect-error - project_routing is a valid body parameter
864+
project_routing: `@${NPRE_ALIAS_STAR}`,
865+
},
866+
});
867+
868+
expect(response.hits.hits.length).toBe(TOTAL_DOCS_COUNT);
869+
});
870+
871+
it('search with filter returns correct results', async () => {
872+
const response = await client.search({
873+
index: TEST_ALIAS,
874+
query: { term: { category: 'alpha' } },
875+
body: {
876+
// @ts-expect-error - project_routing is a valid body parameter
877+
project_routing: `@${NPRE_ALIAS_STAR}`,
878+
},
879+
});
880+
881+
expect(response.hits.hits.length).toBe(ALPHA_CATEGORY_DOCS_COUNT);
882+
});
883+
884+
it('count returns the correct total', async () => {
885+
const response = await client.count({
886+
index: TEST_ALIAS,
887+
query: { match_all: {} },
888+
body: {
889+
// @ts-expect-error - project_routing is a valid body parameter
890+
project_routing: `@${NPRE_ALIAS_STAR}`,
891+
},
892+
});
893+
894+
expect(response.count).toBe(TOTAL_DOCS_COUNT);
895+
});
896+
});
897+
898+
describe(`with expression '_alias:_origin' (origin project indices)`, () => {
899+
it('search returns results', async () => {
900+
const response = await client.search({
901+
index: TEST_INDEX,
902+
query: { match_all: {} },
903+
body: {
904+
// @ts-expect-error - project_routing is a valid body parameter
905+
project_routing: `@${NPRE_ALIAS_ORIGIN}`,
906+
},
907+
});
908+
909+
expect(response.hits.hits.length).toBe(TOTAL_DOCS_COUNT);
910+
});
911+
912+
it('search with filter returns correct results', async () => {
913+
const response = await client.search({
914+
index: TEST_INDEX,
915+
query: { term: { category: 'alpha' } },
916+
body: {
917+
// @ts-expect-error - project_routing is a valid body parameter
918+
project_routing: `@${NPRE_ALIAS_ORIGIN}`,
919+
},
920+
});
921+
922+
expect(response.hits.hits.length).toBe(ALPHA_CATEGORY_DOCS_COUNT);
923+
});
924+
925+
it('count returns the correct total', async () => {
926+
const response = await client.count({
927+
index: TEST_INDEX,
928+
query: { match_all: {} },
929+
body: {
930+
// @ts-expect-error - project_routing is a valid body parameter
931+
project_routing: `@${NPRE_ALIAS_ORIGIN}`,
932+
},
933+
});
934+
935+
expect(response.count).toBe(TOTAL_DOCS_COUNT);
936+
});
937+
});
938+
939+
/**
940+
* When a referenced NPRE does not exist, ES does not reject the request.
941+
* Instead, it issues a 299 deprecation warning header and falls back to
942+
* processing the request without NPRE filtering (i.e. as if no
943+
* project_routing was set). The request still succeeds and returns results.
944+
*/
945+
describe('with a non-existent NPRE', () => {
946+
it('search succeeds and returns results despite the NPRE not existing', async () => {
947+
const response = await client.search({
948+
index: TEST_INDEX,
949+
query: { match_all: {} },
950+
body: {
951+
// @ts-expect-error - project_routing is a valid body parameter
952+
project_routing: '@cps-test-does-not-exist',
953+
},
954+
});
955+
956+
// ES falls back to no-op routing and returns results normally.
957+
expect(response.hits.hits.length).toBe(TOTAL_DOCS_COUNT);
958+
});
959+
960+
it('count succeeds and returns the total despite the NPRE not existing', async () => {
961+
const response = await client.count({
962+
index: TEST_INDEX,
963+
query: { match_all: {} },
964+
body: {
965+
// @ts-expect-error - project_routing is a valid body parameter
966+
project_routing: '@cps-test-does-not-exist',
967+
},
968+
});
969+
970+
expect(response.count).toBe(TOTAL_DOCS_COUNT);
971+
});
972+
});
973+
});
812974
});

src/core/server/integration_tests/saved_objects/registration/type_registrations.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ const previouslyRegisteredTypes = [
102102
'infrastructure-monitoring-log-view',
103103
'infrastructure-ui-source',
104104
'infra-custom-dashboards',
105+
'inference-settings',
105106
'ingest-agent-policies',
106107
'ingest-download-sources',
107108
'ingest-outputs',

0 commit comments

Comments
 (0)