Skip to content

Commit cdf28f3

Browse files
Merge branch 'main' into eui-upgrade-47.0.0
2 parents 8172e57 + f792e5d commit cdf28f3

39 files changed

Lines changed: 520 additions & 709 deletions

File tree

.github/CODEOWNERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,8 @@
344344
/x-pack/plugins/triggers_actions_ui/ @elastic/response-ops
345345
/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/ @elastic/response-ops
346346
/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/ @elastic/response-ops
347-
/docs/user/alerting/ @elastic/response-ops
348-
/docs/management/connectors/ @elastic/response-ops
347+
/docs/user/alerting/ @elastic/response-ops @elastic/mlr-docs
348+
/docs/management/connectors/ @elastic/response-ops @elastic/mlr-docs
349349
#CC# /x-pack/plugins/stack_alerts @elastic/response-ops
350350
/x-pack/plugins/cases/ @elastic/response-ops
351351
/x-pack/test/cases_api_integration/ @elastic/response-ops

.github/workflows/label-qa-fixed-in.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ jobs:
3737
}
3838
}
3939
prnumber: ${{ github.event.number }}
40-
token: ${{ secrets.FLEET_TECH_KIBANA_USER_TOKEN }}
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.FLEET_TECH_KIBANA_USER_TOKEN }}
4142
- uses: sergeysova/jq-action@v2
4243
id: issues_to_label
4344
with:
@@ -75,4 +76,5 @@ jobs:
7576
}
7677
issueid: ${{ matrix.issueNodeId }}
7778
labelids: ${{ needs.fetch_issues_to_label.outputs.label_ids }}
78-
token: ${{ secrets.FLEET_TECH_KIBANA_USER_TOKEN }}
79+
env:
80+
GITHUB_TOKEN: ${{ secrets.FLEET_TECH_KIBANA_USER_TOKEN }}

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
"**/handlebars/uglify-js": "^3.14.3",
8383
"**/hoist-non-react-statics": "^3.3.2",
8484
"**/html-minifier/uglify-js": "^3.14.3",
85-
"**/isomorphic-fetch/node-fetch": "^2.6.1",
85+
"**/isomorphic-fetch/node-fetch": "^2.6.7",
8686
"**/istanbul-lib-coverage": "^3.2.0",
8787
"**/json-schema": "^0.4.0",
8888
"**/minimist": "^1.2.5",
@@ -93,7 +93,8 @@
9393
"**/trim": "1.0.1",
9494
"**/typescript": "4.5.3",
9595
"**/underscore": "^1.13.1",
96-
"globby/fast-glob": "3.2.7"
96+
"globby/fast-glob": "3.2.7",
97+
"puppeteer/node-fetch": "^2.6.7"
9798
},
9899
"dependencies": {
99100
"@babel/runtime": "^7.17.2",
@@ -305,7 +306,7 @@
305306
"monaco-editor": "^0.22.3",
306307
"mustache": "^2.3.2",
307308
"nock": "12.0.3",
308-
"node-fetch": "^2.6.1",
309+
"node-fetch": "^2.6.7",
309310
"node-forge": "^1.2.1",
310311
"nodemailer": "^6.6.2",
311312
"normalize-path": "^3.0.0",
@@ -643,7 +644,7 @@
643644
"@types/ncp": "^2.0.1",
644645
"@types/nock": "^10.0.3",
645646
"@types/node": "16.10.2",
646-
"@types/node-fetch": "^2.5.7",
647+
"@types/node-fetch": "^2.6.0",
647648
"@types/node-forge": "^1.0.0",
648649
"@types/nodemailer": "^6.4.0",
649650
"@types/normalize-path": "^3.0.0",

src/core/server/execution_context/execution_context_container.test.ts

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,40 @@ describe('KibanaExecutionContext', () => {
9191
expect(value).toBe('type:name:41;child-test-type:child-test-name:42');
9292
});
9393

94-
it('returns an escaped string representation of provided execution contextStringified', () => {
94+
it('returns an escaped string representation of provided execution context', () => {
9595
const context: KibanaExecutionContext = {
9696
id: 'Visualization☺漢字',
97+
type: 'test☺type',
98+
name: 'test漢name',
99+
description: 'test字description',
100+
};
101+
102+
const value = new ExecutionContextContainer(context).toString();
103+
expect(value).toBe(
104+
'test%E2%98%BAtype:test%E6%BC%A2name:Visualization%E2%98%BA%E6%BC%A2%E5%AD%97'
105+
);
106+
});
107+
108+
it('returns an escaped string representation of provided execution context parent', () => {
109+
const parentContext: KibanaExecutionContext = {
110+
id: 'Dashboard☺漢字',
111+
type: 'test☺type',
112+
name: 'test漢name',
113+
description: 'parent-descripton',
114+
};
115+
const parentContainer = new ExecutionContextContainer(parentContext);
116+
117+
const context: KibanaExecutionContext = {
118+
id: 'Visualization',
97119
type: 'test-type',
98120
name: 'test-name',
99121
description: 'test-description',
100122
};
101123

102-
const value = new ExecutionContextContainer(context).toString();
103-
expect(value).toBe('test-type:test-name:Visualization%E2%98%BA%E6%BC%A2%E5%AD%97');
124+
const value = new ExecutionContextContainer(context, parentContainer).toString();
125+
expect(value).toBe(
126+
'test%E2%98%BAtype:test%E6%BC%A2name:Dashboard%E2%98%BA%E6%BC%A2%E5%AD%97;test-type:test-name:Visualization'
127+
);
104128
});
105129

106130
it('trims a string representation of provided execution context if it is bigger max allowed size', () => {

src/core/server/execution_context/execution_context_container.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,23 @@ export interface IExecutionContextContainer {
5050
}
5151

5252
function stringify(ctx: KibanaExecutionContext): string {
53-
const stringifiedCtx = `${ctx.type}:${ctx.name}:${encodeURIComponent(ctx.id!)}`;
53+
const stringifiedCtx = `${encodeURIComponent(ctx.type)}:${encodeURIComponent(
54+
ctx.name
55+
)}:${encodeURIComponent(ctx.id!)}`;
5456
return ctx.child ? `${stringifiedCtx};${stringify(ctx.child)}` : stringifiedCtx;
5557
}
5658

5759
export class ExecutionContextContainer implements IExecutionContextContainer {
5860
readonly #context: Readonly<KibanaExecutionContext>;
61+
5962
constructor(context: KibanaExecutionContext, parent?: IExecutionContextContainer) {
6063
this.#context = parent ? { ...parent.toJSON(), child: context } : context;
6164
}
65+
6266
toString(): string {
6367
return enforceMaxLength(stringify(this.#context));
6468
}
69+
6570
toJSON() {
6671
return this.#context;
6772
}

src/core/server/execution_context/integration_tests/tracing.test.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ const parentContext = {
1818
description: 'test-description',
1919
};
2020

21+
const withUtf8CharsContext = {
22+
type: 'test字type',
23+
name: 'test漢字name',
24+
id: '9000☺',
25+
description: 'test-description',
26+
};
27+
2128
describe('trace', () => {
2229
let esServer: kbnTestServer.TestElasticsearchUtils;
2330
let root: ReturnType<typeof kbnTestServer.createRoot>;
@@ -384,6 +391,35 @@ describe('trace', () => {
384391
expect(response.body).toEqual(parentContext);
385392
});
386393

394+
it('supports UTF-8 characters', async () => {
395+
const { http } = await root.setup();
396+
const { createRouter } = http;
397+
398+
const router = createRouter('');
399+
router.get({ path: '/execution-context', validate: false }, async (context, req, res) => {
400+
const { headers } = await context.core.elasticsearch.client.asCurrentUser.ping(
401+
{},
402+
{ meta: true }
403+
);
404+
return res.ok({ body: headers || {} });
405+
});
406+
407+
await root.start();
408+
const response = await kbnTestServer.request
409+
.get(root, '/execution-context')
410+
.set('x-opaque-id', 'utf-test')
411+
.set(new ExecutionContextContainer(withUtf8CharsContext).toHeader())
412+
.expect(200);
413+
414+
const rawOpaqueId = response.body['x-opaque-id'];
415+
expect(rawOpaqueId).toEqual(
416+
'utf-test;kibana:test%E5%AD%97type:test%E6%BC%A2%E5%AD%97name:9000%E2%98%BA'
417+
);
418+
expect(decodeURIComponent(rawOpaqueId)).toEqual(
419+
'utf-test;kibana:test字type:test漢字name:9000☺'
420+
);
421+
});
422+
387423
it('execution context is the same for all the lifecycle events', async () => {
388424
const { executionContext, http } = await root.setup();
389425
const {

src/plugins/discover/public/application/main/services/discover_search_session.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
getQueryParams,
1616
removeQueryParam,
1717
} from '../../../../../kibana_utils/public';
18-
import { SEARCH_SESSION_ID_QUERY_PARAM } from '../../../url_generator';
18+
import { SEARCH_SESSION_ID_QUERY_PARAM } from '../../../constants';
1919

2020
export interface DiscoverSearchSessionManagerDeps {
2121
history: History;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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 and the Server Side Public License, v 1; you may not use this file except
5+
* in compliance with, at your election, the Elastic License 2.0 or the Server
6+
* Side Public License, v 1.
7+
*/
8+
9+
export const SEARCH_SESSION_ID_QUERY_PARAM = 'searchSessionId';

src/plugins/discover/public/index.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,5 @@ export type { ISearchEmbeddable, SearchInput } from './embeddable';
2727
export { SEARCH_EMBEDDABLE_TYPE } from './embeddable';
2828
export { loadSharingDataHelpers } from './utils';
2929

30-
export type { DiscoverUrlGeneratorState } from './url_generator';
31-
32-
/**
33-
* @deprecated
34-
*/
35-
export { DISCOVER_APP_URL_GENERATOR } from './url_generator';
3630
export { DISCOVER_APP_LOCATOR } from './locator';
3731
export type { DiscoverAppLocator, DiscoverAppLocatorParams } from './locator';

src/plugins/discover/public/mocks.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ const createSetupContract = (): Setup => {
2424

2525
const createStartContract = (): Start => {
2626
const startContract: Start = {
27-
urlGenerator: {
28-
createUrl: jest.fn(),
29-
} as unknown as DiscoverStart['urlGenerator'],
3027
locator: sharePluginMock.createLocator(),
3128
};
3229
return startContract;

0 commit comments

Comments
 (0)