Skip to content

Commit

Permalink
Merge branch 'main' into task/olm-3092-port-trusted-apps-to-ArtifactL…
Browse files Browse the repository at this point in the history
…istPage-component
  • Loading branch information
ashokaditya authored Apr 20, 2022
2 parents 2b2509d + d0643e0 commit 0567f36
Show file tree
Hide file tree
Showing 1,263 changed files with 4,416 additions and 1,927 deletions.
1 change: 0 additions & 1 deletion .buildkite/pipelines/es_snapshots/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ steps:
queue: kibana-default
depends_on:
- default-cigroup
- default-cigroup-docker
- oss-cigroup
- jest-integration
- api-integration
Expand Down
4 changes: 2 additions & 2 deletions .buildkite/scripts/steps/functional/uptime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ echo "--- Uptime @elastic/synthetics Tests"

cd "$XPACK_DIR"

checks-reporter-with-killswitch "Uptime @elastic/synthetics Tests" \
node plugins/uptime/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"}
checks-reporter-with-killswitch "uptime plugin @elastic/synthetics Tests" \
node plugins/synthetics/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"}
10 changes: 5 additions & 5 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,11 @@ the alertTypes by the Stack in the alerting plugin, register associated HTTP
routes, etc.
|{kib-repo}blob/{branch}/x-pack/plugins/synthetics/README.md[synthetics]
|The purpose of this plugin is to provide users of Heartbeat more visibility of what's happening
in their infrastructure.
|{kib-repo}blob/{branch}/x-pack/plugins/task_manager/README.md[taskManager]
|The task manager is a generic system for running background tasks.
Documentation: https://www.elastic.co/guide/en/kibana/master/task-manager-production-considerations.html
Expand Down Expand Up @@ -648,11 +653,6 @@ As a developer you can reuse and extend built-in alerts and actions UI functiona
|Upgrade Assistant helps users prepare their Stack for being upgraded to the next major. It will only be enabled on the last minor before the next major release. This is controlled via the config: xpack.upgrade_assistant.readonly (#101296).
|{kib-repo}blob/{branch}/x-pack/plugins/uptime/README.md[uptime]
|The purpose of this plugin is to provide users of Heartbeat more visibility of what's happening
in their infrastructure.
|{kib-repo}blob/{branch}/x-pack/plugins/drilldowns/url_drilldown/README.md[urlDrilldown]
|NOTE: This plugin contains implementation of URL drilldown. For drilldowns infrastructure code refer to ui_actions_enhanced plugin.
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
"@kbn/i18n-react": "link:bazel-bin/packages/kbn-i18n-react",
"@kbn/interpreter": "link:bazel-bin/packages/kbn-interpreter",
"@kbn/io-ts-utils": "link:bazel-bin/packages/kbn-io-ts-utils",
"@kbn/kibana-json-schema": "link:bazel-bin/packages/kbn-kibana-json-schema",
"@kbn/logging": "link:bazel-bin/packages/kbn-logging",
"@kbn/logging-mocks": "link:bazel-bin/packages/kbn-logging-mocks",
"@kbn/mapbox-gl": "link:bazel-bin/packages/kbn-mapbox-gl",
Expand Down Expand Up @@ -635,6 +636,7 @@
"@types/kbn__interpreter": "link:bazel-bin/packages/kbn-interpreter/npm_module_types",
"@types/kbn__io-ts-utils": "link:bazel-bin/packages/kbn-io-ts-utils/npm_module_types",
"@types/kbn__jest-serializers": "link:bazel-bin/packages/kbn-jest-serializers/npm_module_types",
"@types/kbn__kibana-json-schema": "link:bazel-bin/packages/kbn-kibana-json-schema/npm_module_types",
"@types/kbn__logging": "link:bazel-bin/packages/kbn-logging/npm_module_types",
"@types/kbn__logging-mocks": "link:bazel-bin/packages/kbn-logging-mocks/npm_module_types",
"@types/kbn__mapbox-gl": "link:bazel-bin/packages/kbn-mapbox-gl/npm_module_types",
Expand Down Expand Up @@ -877,6 +879,7 @@
"jest-styled-components": "^7.0.3",
"jimp": "^0.14.0",
"jsdom": "13.1.0",
"json-schema-typed": "^7.0.3",
"json5": "^1.0.1",
"jsondiffpatch": "0.4.1",
"license-checker": "^16.0.0",
Expand Down
2 changes: 2 additions & 0 deletions packages/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ filegroup(
"//packages/kbn-interpreter:build",
"//packages/kbn-io-ts-utils:build",
"//packages/kbn-jest-serializers:build",
"//packages/kbn-kibana-json-schema:build",
"//packages/kbn-logging-mocks:build",
"//packages/kbn-logging:build",
"//packages/kbn-mapbox-gl:build",
Expand Down Expand Up @@ -149,6 +150,7 @@ filegroup(
"//packages/kbn-interpreter:build_types",
"//packages/kbn-io-ts-utils:build_types",
"//packages/kbn-jest-serializers:build_types",
"//packages/kbn-kibana-json-schema:build_types",
"//packages/kbn-logging-mocks:build_types",
"//packages/kbn-logging:build_types",
"//packages/kbn-mapbox-gl:build_types",
Expand Down
4 changes: 2 additions & 2 deletions packages/analytics/client/src/events/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ export interface EventContext {
*/
userId?: string;
/**
* The user's organization ID.
* The Cloud ID.
*/
esOrgId?: string;
cloudId?: string;
/**
* The product's version.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ describe('FullStoryShipper', () => {
});
});

test('calls `setUserVars` when esOrgId is provided', () => {
fullstoryShipper.extendContext({ esOrgId: 'test-es-org-id' });
test('calls `setUserVars` when cloudId is provided', () => {
fullstoryShipper.extendContext({ cloudId: 'test-es-org-id' });
expect(fullStoryApiMock.setUserVars).toHaveBeenCalledWith({ org_id_str: 'test-es-org-id' });
});

test('merges both: version and esOrgId if both are provided', () => {
fullstoryShipper.extendContext({ version: '1.2.3', esOrgId: 'test-es-org-id' });
test('merges both: version and cloudId if both are provided', () => {
fullstoryShipper.extendContext({ version: '1.2.3', cloudId: 'test-es-org-id' });
expect(fullStoryApiMock.setUserVars).toHaveBeenCalledWith({
org_id_str: 'test-es-org-id',
version_str: '1.2.3',
Expand All @@ -84,7 +84,7 @@ describe('FullStoryShipper', () => {
const context = {
userId: 'test-user-id',
version: '1.2.3',
esOrgId: 'test-es-org-id',
cloudId: 'test-es-org-id',
foo: 'bar',
};
fullstoryShipper.extendContext(context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class FullStoryShipper implements IShipper {
this.initContext.logger.debug(`Received context ${JSON.stringify(newContext)}`);

// FullStory requires different APIs for different type of contexts.
const { userId, version, esOrgId, ...nonUserContext } = newContext;
const { userId, version, cloudId, ...nonUserContext } = newContext;

// Call it only when the userId changes
if (userId && userId !== this.lastUserId) {
Expand All @@ -47,13 +47,13 @@ export class FullStoryShipper implements IShipper {
}

// User-level context
if (version || esOrgId) {
if (version || cloudId) {
this.initContext.logger.debug(
`Calling FS.setUserVars with version ${version} and esOrgId ${esOrgId}`
`Calling FS.setUserVars with version ${version} and cloudId ${cloudId}`
);
this.fullStoryApi.setUserVars({
...(version ? getParsedVersion(version) : {}),
...(esOrgId ? { org_id_str: esOrgId } : {}),
...(cloudId ? { org_id_str: cloudId } : {}),
});
}

Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-babel-preset/styled_components_files.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
USES_STYLED_COMPONENTS: [
/packages[\/\\]kbn-ui-shared-deps-(npm|src)[\/\\]/,
/src[\/\\]plugins[\/\\](unified_search|kibana_react)[\/\\]/,
/x-pack[\/\\]plugins[\/\\](apm|beats_management|cases|fleet|infra|lists|observability|osquery|security_solution|timelines|uptime|ux)[\/\\]/,
/x-pack[\/\\]plugins[\/\\](apm|beats_management|cases|fleet|infra|lists|observability|osquery|security_solution|timelines|synthetics|ux)[\/\\]/,
/x-pack[\/\\]test[\/\\]plugin_functional[\/\\]plugins[\/\\]resolver_test[\/\\]/,
],
};
2 changes: 2 additions & 0 deletions packages/kbn-dev-utils/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ RUNTIME_DEPS = [
"//packages/kbn-stdio-dev-helpers",
"//packages/kbn-ci-stats-reporter",
"//packages/kbn-jest-serializers",
"//packages/kbn-kibana-json-schema",
"@npm//@babel/core",
"@npm//axios",
"@npm//chalk",
Expand Down Expand Up @@ -77,6 +78,7 @@ TYPES_DEPS = [
"//packages/kbn-stdio-dev-helpers:npm_module_types",
"//packages/kbn-ci-stats-reporter:npm_module_types",
"//packages/kbn-jest-serializers:npm_module_types",
"//packages/kbn-kibana-json-schema:npm_module_types",
"@npm//@babel/parser",
"@npm//@babel/types",
"@npm//@types/babel__core",
Expand Down
15 changes: 15 additions & 0 deletions packages/kbn-dev-utils/src/vscode_config/managed_config_keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
* Side Public License, v 1.
*/

import { KibanaJsonSchema } from '@kbn/kibana-json-schema';

export interface ManagedConfigKey {
key: string;
value: string | Record<string, any> | boolean | number;
Expand Down Expand Up @@ -58,4 +60,17 @@ export const MANAGED_CONFIG_KEYS: ManagedConfigKey[] = [
key: 'typescript.tsserver.maxTsServerMemory',
value: 4096,
},
{
key: 'json.schemas',
value: [
{
fileMatch: ['kibana.json'],
url: './.vscode/kibana-json-schema.json',
},
],
},
];

export const MANAGED_CONFIG_FILES = [
{ name: 'kibana-json-schema.json', content: JSON.stringify(KibanaJsonSchema, null, 2) },
];
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ const TEST_KEYS: ManagedConfigKey[] = [
key: 'stringKey',
value: 'foo',
},
{
key: 'arrayKey',
value: ['foo', 'bar'],
},
];

const run = (json?: string) => updateVscodeConfig(TEST_KEYS, '', json);
Expand All @@ -41,7 +45,9 @@ it('updates the passed JSON with the managed settings', () => {
"world": [1, 2, 3]
},
// @managed
"stringKey": "foo"
"stringKey": "foo",
// @managed
"arrayKey": ["foo", "bar"]
}
`);
Expand All @@ -58,7 +64,9 @@ it('initialized empty or undefined json values', () => {
"world": [1, 2, 3]
},
// @managed
"stringKey": "foo"
"stringKey": "foo",
// @managed
"arrayKey": ["foo", "bar"]
}
`);
Expand All @@ -73,7 +81,9 @@ it('initialized empty or undefined json values', () => {
"world": [1, 2, 3]
},
// @managed
"stringKey": "foo"
"stringKey": "foo",
// @managed
"arrayKey": ["foo", "bar"]
}
`);
Expand All @@ -90,7 +100,9 @@ it('replaces conflicting managed keys which do not have matching value types', (
"world": [1, 2, 3]
},
// @managed
"stringKey": "foo"
"stringKey": "foo",
// @managed
"arrayKey": ["foo", "bar"]
}
`);
Expand Down Expand Up @@ -136,7 +148,9 @@ it('persists comments in the original file', () => {
"world": [1, 2, 3]
},
// @managed
"stringKey": "foo"
"stringKey": "foo",
// @managed
"arrayKey": ["foo", "bar"]
}
`);
Expand Down Expand Up @@ -164,7 +178,9 @@ it('overrides old values for managed keys', () => {
"world": [1, 2, 3]
},
// @managed
"stringKey": "foo"
"stringKey": "foo",
// @managed
"arrayKey": ["foo", "bar"]
}
`);
Expand Down Expand Up @@ -206,7 +222,9 @@ it('does not modify properties with leading `// self managed` comment', () => {
"world": [5]
},
// self managed
"stringKey": "--"
"stringKey": "--",
// @managed
"arrayKey": ["foo", "bar"]
}
`);
Expand All @@ -232,7 +250,9 @@ it('does not modify child properties with leading `// self managed` comment', ()
"hello": true
},
// @managed
"stringKey": "foo"
"stringKey": "foo",
// @managed
"arrayKey": ["foo", "bar"]
}
`);
Expand Down Expand Up @@ -260,7 +280,9 @@ it('does not modify unknown child properties', () => {
"hello": true
},
// @managed
"stringKey": "foo"
"stringKey": "foo",
// @managed
"arrayKey": ["foo", "bar"]
}
`);
Expand Down Expand Up @@ -288,7 +310,9 @@ it('removes managed properties which are no longer managed', () => {
"hello": true
},
// @managed
"stringKey": "foo"
"stringKey": "foo",
// @managed
"arrayKey": ["foo", "bar"]
}
`);
Expand All @@ -314,7 +338,9 @@ it('wipes out child keys which conflict with newly managed child keys', () => {
"world": [1, 2, 3]
},
// @managed
"stringKey": "foo"
"stringKey": "foo",
// @managed
"arrayKey": ["foo", "bar"]
}
`);
Expand All @@ -338,7 +364,9 @@ it('correctly formats info text when specified', () => {
"world": [1, 2, 3]
},
// @managed
"stringKey": "foo"
"stringKey": "foo",
// @managed
"arrayKey": ["foo", "bar"]
}
`);
Expand Down Expand Up @@ -368,7 +396,9 @@ it('allows "// self managed" comments conflicting with "// @managed" comments to
"world": [1, 2, 3]
},
// self managed
"stringKey": 12345
"stringKey": 12345,
// @managed
"arrayKey": ["foo", "bar"]
}
`);
Expand Down
18 changes: 16 additions & 2 deletions packages/kbn-dev-utils/src/vscode_config/update_vscode_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ const createObjectPropOfManagedValues = (key: string, value: Record<string, any>
const addManagedProp = (
ast: t.ObjectExpression,
key: string,
value: string | Record<string, any> | boolean | number
value: string | Record<string, any> | boolean | number | any[]
) => {
if (['number', 'string', 'boolean'].includes(typeof value)) {
if (['number', 'string', 'boolean'].includes(typeof value) || Array.isArray(value)) {
ast.properties.push(createManagedProp(key, value));
} else {
ast.properties.push(createObjectPropOfManagedValues(key, value as Record<string, any>));
Expand Down Expand Up @@ -183,6 +183,20 @@ export function updateVscodeConfig(keys: ManagedConfigKey[], infoText: string, j
continue;
}

if (Array.isArray(value)) {
if (!existingProp) {
addManagedProp(ast, key, value);
continue;
}

if (!isSelfManaged(existingProp)) {
replaceManagedProp(ast, existingProp, value);
continue;
}

continue;
}

if (typeof value === 'object') {
if (existingProp && existingProp.value.type === 'ObjectExpression') {
// setting exists and is an object so merge properties of `value` with it
Expand Down
Loading

0 comments on commit 0567f36

Please sign in to comment.