Skip to content

Commit ccd4d85

Browse files
Merge branch '9.0' into backport/9.0/pr-236506
2 parents d7d3698 + 4a5e0f2 commit ccd4d85

84 files changed

Lines changed: 3552 additions & 2719 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.

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,6 +1005,7 @@ x-pack/solutions/security/packages/navigation @elastic/security-threat-hunting-i
10051005
x-pack/solutions/security/packages/security-ai-prompts @elastic/security-generative-ai
10061006
x-pack/solutions/security/packages/side-nav @elastic/security-threat-hunting-investigations
10071007
x-pack/solutions/security/packages/storybook/config @elastic/security-threat-hunting-investigations
1008+
x-pack/solutions/security/packages/test-api-clients @elastic/security-detection-rule-management
10081009
x-pack/solutions/security/packages/upselling @elastic/security-threat-hunting-investigations
10091010
x-pack/solutions/security/plugins/cloud_defend @elastic/kibana-cloud-security-posture
10101011
x-pack/solutions/security/plugins/cloud_security_posture @elastic/kibana-cloud-security-posture

kbn_pm/src/commands/build_shared_packages.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import { run } from '../lib/spawn.mjs';
1111

12-
/** @type {import("../lib/command").Command} */
12+
/** @type {import('../lib/command').Command} */
1313
export const command = {
1414
name: 'build-shared',
1515
intro: 'Builds shared packages with webpack',
@@ -35,6 +35,10 @@ export const command = {
3535
[':build-webpack'].concat(!cache ? ['-u'] : []).concat(dist ? ['--', '--dist'] : []),
3636
{
3737
pipe: !quiet,
38+
env: {
39+
...process.env,
40+
...(!cache ? { MOON_CACHE: 'off' } : {}),
41+
},
3842
}
3943
);
4044

kbn_pm/src/commands/clean_command.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import { dedent } from '../lib/indent.mjs';
1111
import { cleanPaths } from '../lib/clean.mjs';
12-
import { findPluginCleanPaths } from '../lib/find_clean_paths.mjs';
12+
import { collectBazelPaths, findPluginCleanPaths } from '../lib/find_clean_paths.mjs';
1313
import Path from 'path';
1414
import { REPO_ROOT } from '../lib/paths.mjs';
1515

@@ -37,6 +37,8 @@ export const command = {
3737

3838
await cleanPaths(log, [
3939
...(await findPluginCleanPaths(log)),
40+
...collectBazelPaths(),
41+
Path.resolve(REPO_ROOT, '.moon', 'cache'),
4042
Path.resolve(REPO_ROOT, '.es', 'cache'),
4143
]);
4244
},

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,13 @@
127127
"@elastic/node-crypto": "^1.2.3",
128128
"@elastic/numeral": "^2.5.1",
129129
"@elastic/opentelemetry-node": "^1.1.1",
130-
"@elastic/react-search-ui": "^1.20.2",
131-
"@elastic/react-search-ui-views": "^1.20.2",
130+
"@elastic/react-search-ui": "^1.24.2",
131+
"@elastic/react-search-ui-views": "^1.24.2",
132132
"@elastic/request-converter": "^9.0.1",
133133
"@elastic/request-crypto": "^2.0.3",
134-
"@elastic/search-ui": "^1.20.2",
135-
"@elastic/search-ui-app-search-connector": "^1.20.2",
136-
"@elastic/search-ui-engines-connector": "^1.20.2",
134+
"@elastic/search-ui": "^1.24.2",
135+
"@elastic/search-ui-app-search-connector": "^1.24.1",
136+
"@elastic/search-ui-engines-connector": "^1.24.2",
137137
"@emotion/cache": "^11.11.0",
138138
"@emotion/css": "^11.11.0",
139139
"@emotion/react": "^11.11.0",
@@ -845,6 +845,7 @@
845845
"@kbn/security-solution-serverless": "link:x-pack/solutions/security/plugins/security_solution_serverless",
846846
"@kbn/security-solution-side-nav": "link:x-pack/solutions/security/packages/side-nav",
847847
"@kbn/security-solution-storybook-config": "link:x-pack/solutions/security/packages/storybook/config",
848+
"@kbn/security-solution-test-api-clients": "link:x-pack/solutions/security/packages/test-api-clients",
848849
"@kbn/security-solution-upselling": "link:x-pack/solutions/security/packages/upselling",
849850
"@kbn/security-test-endpoints-plugin": "link:x-pack/test/security_functional/plugins/test_endpoints",
850851
"@kbn/security-ui-components": "link:x-pack/platform/packages/private/security/ui_components",

src/dev/build/tasks/build_packages_task.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ export const BuildPackages: Task = {
109109
await buildWebpackBundles({
110110
quiet: false,
111111
dist: true,
112+
noCache: true,
112113
});
113114

114115
const transformConfig: TransformConfig = {
@@ -307,8 +308,20 @@ export const BuildPackages: Task = {
307308
},
308309
};
309310

310-
export async function buildWebpackBundles({ quiet, dist }: { quiet: boolean; dist: boolean }) {
311-
const options = [quiet ? ['--quiet'] : [], dist ? ['--dist'] : []].flat();
311+
export async function buildWebpackBundles({
312+
quiet,
313+
dist,
314+
noCache,
315+
}: {
316+
quiet: boolean;
317+
dist: boolean;
318+
noCache?: boolean;
319+
}) {
320+
const options = [
321+
quiet ? ['--quiet'] : [],
322+
dist ? ['--dist'] : [],
323+
noCache ? ['--no-cache'] : [],
324+
].flat();
312325
const stdio: StdioOption[] = quiet
313326
? ['ignore', 'pipe', 'pipe']
314327
: ['inherit', 'inherit', 'inherit'];

src/platform/packages/shared/kbn-openapi-generator/src/template_service/templates/api_client_supertest.handlebars

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@
99

1010
import { ELASTIC_HTTP_VERSION_HEADER, X_ELASTIC_INTERNAL_ORIGIN_REQUEST } from '@kbn/core-http-common';
1111
import { replaceParams } from '@kbn/openapi-common/shared';
12-
import { FtrProviderContext } from 'x-pack/test/api_integration/ftr_provider_context';
13-
14-
import { routeWithNamespace } from 'x-pack/test/common/utils/security_solution';
1512

1613
{{#each operations}}
17-
import {
14+
import type {
1815
{{operationId}}RequestQueryInput,
1916
{{operationId}}RequestParamsInput,
2017
{{operationId}}RequestBodyInput
2118
} from '{{replace sourcePath 'schema.yaml' 'gen'}}';
2219
{{/each}}
2320

21+
import type { FtrProviderContext } from '@kbn/ftr-common-functional-services';
22+
import { getRouteUrlForSpace } from '@kbn/spaces-plugin/common';
23+
2424
export function SecuritySolutionApiProvider({ getService }: FtrProviderContext) {
2525
const supertest = getService('supertest');
2626

@@ -33,14 +33,14 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext)
3333
{{/if}}
3434
{{camelCase operationId}}({{#if (or requestQuery requestParams requestBody)}}props: {{operationId}}Props, {{/if}}kibanaSpace: string = 'default') {
3535
return supertest
36-
.{{method}}(routeWithNamespace({{#if requestParams}}replaceParams('{{path}}', props.params){{else}}'{{path}}'{{/if}}, kibanaSpace))
36+
.{{method}}(getRouteUrlForSpace({{#if requestParams}}replaceParams('{{path}}', props.params){{else}}'{{path}}'{{/if}}, kibanaSpace))
3737
.set('kbn-xsrf', 'true')
3838
.set(ELASTIC_HTTP_VERSION_HEADER, '{{version}}')
3939
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
4040
{{~#if requestBody}}.send(props.body as object){{/if}}
4141
{{~#if requestQuery}}.query(props.query){{/if}}
4242
},
43-
{{/each}}
43+
{{/each}}
4444
}
4545
}
4646

tsconfig.base.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1676,6 +1676,8 @@
16761676
"@kbn/security-solution-side-nav/*": ["x-pack/solutions/security/packages/side-nav/*"],
16771677
"@kbn/security-solution-storybook-config": ["x-pack/solutions/security/packages/storybook/config"],
16781678
"@kbn/security-solution-storybook-config/*": ["x-pack/solutions/security/packages/storybook/config/*"],
1679+
"@kbn/security-solution-test-api-clients": ["x-pack/solutions/security/packages/test-api-clients"],
1680+
"@kbn/security-solution-test-api-clients/*": ["x-pack/solutions/security/packages/test-api-clients/*"],
16791681
"@kbn/security-solution-upselling": ["x-pack/solutions/security/packages/upselling"],
16801682
"@kbn/security-solution-upselling/*": ["x-pack/solutions/security/packages/upselling/*"],
16811683
"@kbn/security-test-endpoints-plugin": ["x-pack/test/security_functional/plugins/test_endpoints"],

x-pack/platform/plugins/shared/osquery/scripts/openapi/generate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const OSQUERY_ROOT = resolve(__dirname, '../..');
3232
bundle: {
3333
outFile: join(
3434
REPO_ROOT,
35-
'x-pack/test/api_integration/services/security_solution_osquery_api.gen.ts'
35+
'x-pack/solutions/security/packages/test-api-clients/supertest/osquery.gen.ts'
3636
),
3737
},
3838
});
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0; you may not use this file except in compliance with the Elastic License
5+
* 2.0.
6+
*/
7+
8+
/**
9+
* Wraps the provided Kibana route URL with the Kibana space ID.
10+
* "default" space is equivalent to an empty value and doesn't lead to adding any space aware path.
11+
*
12+
* @param routeUrl the route url string
13+
* @param spaceId [optional] the Kibana space to account for in the route url
14+
*
15+
* Examples:
16+
* - `getRouteUrlForSpace('/api/some_endpoint')` returns `/api/some_endpoint`
17+
* - `getRouteUrlForSpace('/api/some_endpoint', 'default')` returns `/api/some_endpoint`
18+
* - `getRouteUrlForSpace('/api/some_endpoint', 'my_space') returns `/s/my_space/api/some_endpoint`
19+
*/
20+
export function getRouteUrlForSpace(routeUrl: string, spaceId?: string): string {
21+
return spaceId ? `/s/${spaceId}${routeUrl}` : routeUrl;
22+
}

x-pack/platform/plugins/shared/spaces/common/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export {
1313
DEFAULT_SPACE_ID,
1414
API_VERSIONS,
1515
} from './constants';
16+
export { getRouteUrlForSpace } from './get_spaced_route_url';
1617
export { addSpaceIdToPath, getSpaceIdFromPath } from './lib/spaces_url_parser';
1718
export type {
1819
Space,

0 commit comments

Comments
 (0)