Skip to content

Commit a321076

Browse files
Merge branch 'main' into versioning-file-upload-apis
2 parents cf5d818 + eff18a4 commit a321076

File tree

97 files changed

+2098
-807
lines changed

Some content is hidden

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

97 files changed

+2098
-807
lines changed

.github/CODEOWNERS

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ packages/kbn-alerts-as-data-utils @elastic/response-ops
2323
x-pack/test/alerting_api_integration/common/plugins/alerts_restricted @elastic/response-ops
2424
packages/kbn-alerts-ui-shared @elastic/response-ops
2525
packages/kbn-ambient-common-types @elastic/kibana-operations
26-
packages/kbn-ambient-ftr-types @elastic/kibana-operations
26+
packages/kbn-ambient-ftr-types @elastic/kibana-operations @elastic/appex-qa
2727
packages/kbn-ambient-storybook-types @elastic/kibana-operations
2828
packages/kbn-ambient-ui-types @elastic/kibana-operations
2929
packages/kbn-analytics @elastic/kibana-core
@@ -331,7 +331,7 @@ x-pack/examples/embedded_lens_example @elastic/kibana-visualizations
331331
x-pack/plugins/encrypted_saved_objects @elastic/kibana-security
332332
x-pack/plugins/enterprise_search @elastic/enterprise-search-frontend
333333
packages/kbn-es @elastic/kibana-operations
334-
packages/kbn-es-archiver @elastic/kibana-operations
334+
packages/kbn-es-archiver @elastic/kibana-operations @elastic/appex-qa
335335
packages/kbn-es-errors @elastic/kibana-core
336336
packages/kbn-es-query @elastic/kibana-data-discovery
337337
packages/kbn-es-types @elastic/kibana-core @elastic/apm-ui
@@ -346,7 +346,7 @@ src/plugins/event_annotation @elastic/kibana-visualizations
346346
x-pack/test/plugin_api_integration/plugins/event_log @elastic/response-ops
347347
x-pack/plugins/event_log @elastic/response-ops
348348
packages/kbn-expandable-flyout @elastic/security-threat-hunting-investigations
349-
packages/kbn-expect @elastic/kibana-operations
349+
packages/kbn-expect @elastic/kibana-operations @elastic/appex-qa
350350
x-pack/examples/exploratory_view_example @elastic/uptime
351351
x-pack/plugins/exploratory_view @elastic/uptime
352352
src/plugins/expression_error @elastic/kibana-presentation
@@ -364,7 +364,7 @@ src/plugins/chart_expressions/expression_tagcloud @elastic/kibana-visualizations
364364
src/plugins/chart_expressions/expression_xy @elastic/kibana-visualizations
365365
examples/expressions_explorer @elastic/kibana-app-services
366366
src/plugins/expressions @elastic/kibana-visualizations
367-
packages/kbn-failed-test-reporter-cli @elastic/kibana-operations
367+
packages/kbn-failed-test-reporter-cli @elastic/kibana-operations @elastic/appex-qa
368368
x-pack/test/plugin_api_integration/plugins/feature_usage_test @elastic/kibana-security
369369
x-pack/plugins/features @elastic/kibana-core
370370
x-pack/test/functional_execution_context/plugins/alerts @elastic/kibana-core
@@ -380,8 +380,8 @@ x-pack/plugins/fleet @elastic/fleet
380380
packages/kbn-flot-charts @elastic/kibana-operations
381381
x-pack/test/ui_capabilities/common/plugins/foo_plugin @elastic/kibana-security
382382
src/plugins/ftr_apis @elastic/kibana-core
383-
packages/kbn-ftr-common-functional-services @elastic/kibana-operations
384-
packages/kbn-ftr-screenshot-filename @elastic/kibana-operations
383+
packages/kbn-ftr-common-functional-services @elastic/kibana-operations @elastic/appex-qa
384+
packages/kbn-ftr-screenshot-filename @elastic/kibana-operations @elastic/appex-qa
385385
x-pack/test/functional_with_es_ssl/plugins/cases @elastic/response-ops
386386
packages/kbn-generate @elastic/kibana-operations
387387
packages/kbn-generate-csv @elastic/appex-sharedux
@@ -423,7 +423,7 @@ test/interactive_setup_api_integration/plugins/test_endpoints @elastic/kibana-se
423423
packages/kbn-interpreter @elastic/kibana-visualizations
424424
packages/kbn-io-ts-utils @elastic/apm-ui
425425
packages/kbn-jest-serializers @elastic/kibana-operations
426-
packages/kbn-journeys @elastic/kibana-operations
426+
packages/kbn-journeys @elastic/kibana-operations @elastic/appex-qa
427427
packages/kbn-json-ast @elastic/kibana-operations
428428
test/health_gateway/plugins/status @elastic/kibana-core
429429
test/plugin_functional/plugins/kbn_sample_panel_action @elastic/kibana-app-services
@@ -665,10 +665,10 @@ src/plugins/telemetry_management_section @elastic/kibana-core
665665
src/plugins/telemetry @elastic/kibana-core
666666
test/plugin_functional/plugins/telemetry @elastic/kibana-core
667667
packages/kbn-telemetry-tools @elastic/kibana-core
668-
packages/kbn-test @elastic/kibana-operations
668+
packages/kbn-test @elastic/kibana-operations @elastic/appex-qa
669669
x-pack/test/licensing_plugin/plugins/test_feature_usage @elastic/kibana-security
670-
packages/kbn-test-jest-helpers @elastic/kibana-operations
671-
packages/kbn-test-subj-selector @elastic/kibana-operations
670+
packages/kbn-test-jest-helpers @elastic/kibana-operations @elastic/appex-qa
671+
packages/kbn-test-subj-selector @elastic/kibana-operations @elastic/appex-qa
672672
x-pack/examples/testing_embedded_lens @elastic/kibana-visualizations
673673
packages/kbn-text-based-editor @elastic/kibana-visualizations
674674
src/plugins/text_based_languages @elastic/kibana-visualizations

.github/workflows/deploy-my-kibana.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
##
33
## This the automation to let Observability team members to deploy a Kibana instance
44
## using the Observability test environments.
5-
## It will deploy a new instance for those who add a comment /oblt-deploy or /oblt-deploy-serverless
5+
## It will deploy a new instance for those who add a comment /oblt-deploy
66
## only supported for Elasticians.
77
##
88
## Owner: @elastic/observablt-robots
@@ -28,15 +28,3 @@ jobs:
2828
vaultUrl: ${{ secrets.OBLT_VAULT_ADDR }}
2929
vaultRoleId: ${{ secrets.OBLT_VAULT_ROLE_ID }}
3030
vaultSecretId: ${{ secrets.OBLT_VAULT_SECRET_ID }}
31-
serverless: false
32-
33-
deploy-my-kibana-serverless:
34-
if: ${{ github.event.issue.pull_request && github.event.comment.body == '/oblt-deploy-serverless'}}
35-
runs-on: ubuntu-latest
36-
steps:
37-
- uses: elastic/apm-pipeline-library/.github/actions/deploy-my-kibana@current
38-
with:
39-
vaultUrl: ${{ secrets.OBLT_VAULT_ADDR }}
40-
vaultRoleId: ${{ secrets.OBLT_VAULT_ROLE_ID }}
41-
vaultSecretId: ${{ secrets.OBLT_VAULT_SECRET_ID }}
42-
serverless: true

.github/workflows/oblt-github-commands.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ jobs:
5050
5151
Just comment with:
5252
- \`/oblt-deploy\` : Deploy a Kibana instance using the Observability test environments.
53-
- \`/oblt-deploy-serverless\` : Deploy a Kibana instance using the Observability `serverless` test environment [only for main].
5453
- \`run\` \`elasticsearch-ci/docs\` : Re-trigger the docs validation. (use unformatted text in the comment!)
5554
5655
</p>

packages/core/chrome/core-chrome-browser/src/project_navigation.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ export interface ChromeProjectNavigationNode {
2525
id?: string;
2626
link?: ChromeProjectNavigationLink;
2727
children?: ChromeProjectNavigationNode[];
28-
2928
title?: string;
3029
icon?: string;
3130
}

packages/core/saved-objects/core-saved-objects-base-server-internal/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export type {
4444
export { parseObjectKey, getObjectKey, getIndexForType } from './src/utils';
4545
export {
4646
modelVersionVirtualMajor,
47+
globalSwitchToModelVersionAt,
4748
assertValidModelVersion,
4849
isVirtualModelVersion,
4950
virtualVersionToModelVersion,

packages/core/saved-objects/core-saved-objects-base-server-internal/src/model_version/constants.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,8 @@
1010
* The major version that is used to represent model versions.
1111
*/
1212
export const modelVersionVirtualMajor = 10;
13+
14+
/**
15+
* The stack version where all types will be forced to switch to using the model version system.
16+
*/
17+
export const globalSwitchToModelVersionAt = '8.10.0';

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Side Public License, v 1.
77
*/
88

9-
export { modelVersionVirtualMajor } from './constants';
9+
export { modelVersionVirtualMajor, globalSwitchToModelVersionAt } from './constants';
1010
export {
1111
assertValidModelVersion,
1212
isVirtualModelVersion,
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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+
import type { SavedObjectsType } from '@kbn/core-saved-objects-server';
10+
import { globalSwitchToModelVersionAt } from '@kbn/core-saved-objects-base-server-internal';
11+
import { applyTypeDefaults } from './apply_type_defaults';
12+
13+
const createType = (parts: Partial<SavedObjectsType> = {}): SavedObjectsType => ({
14+
name: 'test',
15+
namespaceType: 'single',
16+
hidden: false,
17+
mappings: { properties: {} },
18+
...parts,
19+
});
20+
21+
describe('applyTypeDefaults', () => {
22+
describe('switchToModelVersionAt', () => {
23+
it(`keeps the type's switchToModelVersionAt if lesser than the global version`, () => {
24+
const type = createType({
25+
switchToModelVersionAt: '8.4.0',
26+
});
27+
28+
const result = applyTypeDefaults(type);
29+
expect(result.switchToModelVersionAt).toEqual('8.4.0');
30+
});
31+
32+
it(`sets switchToModelVersionAt to the global version if unspecified`, () => {
33+
const type = createType({
34+
switchToModelVersionAt: undefined,
35+
});
36+
37+
const result = applyTypeDefaults(type);
38+
expect(result.switchToModelVersionAt).toEqual(globalSwitchToModelVersionAt);
39+
});
40+
41+
it(`throws if switchToModelVersionAt is invalid`, () => {
42+
const type = createType({
43+
switchToModelVersionAt: 'foobar',
44+
});
45+
46+
expect(() => applyTypeDefaults(type)).toThrowErrorMatchingInlineSnapshot(
47+
`"Type test: invalid switchToModelVersionAt provided: foobar"`
48+
);
49+
});
50+
51+
it(`throws if type version is greater than the global version`, () => {
52+
const type = createType({
53+
switchToModelVersionAt: '9.2.0',
54+
});
55+
56+
expect(() => applyTypeDefaults(type)).toThrowErrorMatchingInlineSnapshot(
57+
`"Type test: provided switchToModelVersionAt (9.2.0) is higher than maximum (8.10.0)"`
58+
);
59+
});
60+
});
61+
});
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
import Semver from 'semver';
10+
import type { SavedObjectsType } from '@kbn/core-saved-objects-server';
11+
import { globalSwitchToModelVersionAt } from '@kbn/core-saved-objects-base-server-internal';
12+
13+
/**
14+
* Apply global defaults to the provided SO type.
15+
*/
16+
export const applyTypeDefaults = (type: SavedObjectsType): SavedObjectsType => {
17+
let switchToModelVersionAt = type.switchToModelVersionAt;
18+
if (switchToModelVersionAt) {
19+
if (!Semver.valid(switchToModelVersionAt)) {
20+
throw new Error(
21+
`Type ${type.name}: invalid switchToModelVersionAt provided: ${switchToModelVersionAt}`
22+
);
23+
}
24+
if (Semver.gt(switchToModelVersionAt, globalSwitchToModelVersionAt)) {
25+
throw new Error(
26+
`Type ${type.name}: provided switchToModelVersionAt (${switchToModelVersionAt}) is higher than maximum (${globalSwitchToModelVersionAt})`
27+
);
28+
}
29+
} else {
30+
switchToModelVersionAt = globalSwitchToModelVersionAt;
31+
}
32+
33+
return {
34+
...type,
35+
switchToModelVersionAt,
36+
};
37+
};

packages/core/saved-objects/core-saved-objects-server-internal/src/saved_objects_service.test.mocks.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,12 @@ export const registerRoutesMock = jest.fn();
5050
jest.doMock('./routes', () => ({
5151
registerRoutes: registerRoutesMock,
5252
}));
53+
54+
export const applyTypeDefaultsMock = jest.fn();
55+
jest.doMock('./apply_type_defaults', () => {
56+
const actual = jest.requireActual('./apply_type_defaults');
57+
return {
58+
...actual,
59+
applyTypeDefaults: applyTypeDefaultsMock,
60+
};
61+
});

0 commit comments

Comments
 (0)