Skip to content

Commit

Permalink
Merge branch 'main' into unified_search_use_data_views_plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkime authored Oct 20, 2022
2 parents 5cbc205 + 9a433da commit 3e6c09d
Show file tree
Hide file tree
Showing 513 changed files with 22,539 additions and 7,591 deletions.
1 change: 1 addition & 0 deletions .buildkite/ftr_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ enabled:
- x-pack/test/functional/apps/lens/group1/config.ts
- x-pack/test/functional/apps/lens/group2/config.ts
- x-pack/test/functional/apps/lens/group3/config.ts
- x-pack/test/functional/apps/lens/open_in_lens/config.ts
- x-pack/test/functional/apps/license_management/config.ts
- x-pack/test/functional/apps/logstash/config.ts
- x-pack/test/functional/apps/management/config.ts
Expand Down
10 changes: 7 additions & 3 deletions .buildkite/pipeline-utils/ci-stats/pick_test_group_run_order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,15 @@ function getRunGroups(bk: BuildkiteClient, allTypes: RunGroup[], typeName: strin
if (tooLongs.length > 0) {
bk.setAnnotation(
`test-group-too-long:${typeName}`,
'error',
'warning',
[
tooLongs.length === 1
? `The following "${typeName}" config has a duration that exceeds the maximum amount of time desired for a single CI job. Please split it up.`
: `The following "${typeName}" configs have durations that exceed the maximum amount of time desired for a single CI job. Please split them up.`,
? `The following "${typeName}" config has a duration that exceeds the maximum amount of time desired for a single CI job. ` +
`This is not an error, and if you don't own this config then you can ignore this warning. ` +
`If you own this config please split it up ASAP and ask Operations if you have questions about how to do that.`
: `The following "${typeName}" configs have durations that exceed the maximum amount of time desired for a single CI job. ` +
`This is not an error, and if you don't own any of these configs then you can ignore this warning.` +
`If you own any of these configs please split them up ASAP and ask Operations if you have questions about how to do that.`,
'',
...tooLongs.map(({ config, durationMin }) => ` - ${config}: ${durationMin} minutes`),
].join('\n')
Expand Down
7 changes: 5 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ x-pack/examples/files_example @elastic/kibana-app-services
/src/core/types/elasticsearch @elastic/apm-ui
/packages/kbn-utility-types/src/dot.ts @dgieselaar
/packages/kbn-utility-types/src/dot_test.ts @dgieselaar
/packages/kbn-adhoc-profiler @elastic/apm-ui
#CC# /src/plugins/apm_oss/ @elastic/apm-ui
#CC# /x-pack/plugins/observability/ @elastic/apm-ui

Expand Down Expand Up @@ -348,12 +349,12 @@ x-pack/examples/files_example @elastic/kibana-app-services
/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/ @elastic/response-ops
/docs/user/alerting/ @elastic/response-ops @elastic/mlr-docs
/docs/management/connectors/ @elastic/response-ops @elastic/mlr-docs
#CC# /x-pack/plugins/stack_alerts/ @elastic/response-ops
/x-pack/plugins/stack_alerts/ @elastic/response-ops
/x-pack/plugins/cases/ @elastic/response-ops
/x-pack/test/cases_api_integration/ @elastic/response-ops
/x-pack/test/functional/services/cases/ @elastic/response-ops
/x-pack/test/functional_with_es_ssl/apps/cases/ @elastic/response-ops
/x-pack/test/api_integration/apis/cases @elastic/response-ops
/x-pack/test/api_integration/apis/cases/ @elastic/response-ops

# Enterprise Search
/x-pack/plugins/enterprise_search @elastic/enterprise-search-frontend
Expand Down Expand Up @@ -855,6 +856,7 @@ packages/home/sample_data_card @elastic/shared-ux
packages/home/sample_data_tab @elastic/shared-ux
packages/home/sample_data_types @elastic/shared-ux
packages/kbn-ace @elastic/platform-deployment-management
packages/kbn-adhoc-profiler @elastic/apm-ui
packages/kbn-alerts @elastic/security-solution
packages/kbn-ambient-storybook-types @elastic/kibana-operations
packages/kbn-ambient-ui-types @elastic/kibana-operations
Expand Down Expand Up @@ -905,6 +907,7 @@ packages/kbn-ftr-common-functional-services @elastic/kibana-operations
packages/kbn-ftr-screenshot-filename @elastic/kibana-operations
packages/kbn-generate @elastic/kibana-operations
packages/kbn-get-repo-files @elastic/kibana-operations
packages/kbn-guided-onboarding @elastic/platform-onboarding
packages/kbn-handlebars @elastic/kibana-security
packages/kbn-hapi-mocks @elastic/kibana-core
packages/kbn-i18n @elastic/kibana-core
Expand Down
1 change: 1 addition & 0 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"fieldFormats": "src/plugins/field_formats",
"flot": "packages/kbn-flot-charts/lib",
"guidedOnboarding": "src/plugins/guided_onboarding",
"guidedOnboardingPackage": "packages/kbn-guided-onboarding",
"home": "src/plugins/home",
"homePackages": "packages/home",
"indexPatternEditor": "src/plugins/data_view_editor",
Expand Down
2 changes: 1 addition & 1 deletion api_docs/kbn_doc_links.devdocs.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@
"label": "enterpriseSearch",
"description": [],
"signature": [
"{ readonly apiKeys: string; readonly bulkApi: string; readonly configuration: string; readonly connectors: string; readonly connectorsMongoDB: string; readonly connectorsMySQL: string; readonly connectorsWorkplaceSearch: string; readonly crawlerGettingStarted: string; readonly crawlerManaging: string; readonly crawlerOverview: string; readonly deployTrainedModels: string; readonly documentLevelSecurity: string; readonly ingestPipelines: string; readonly languageAnalyzers: string; readonly languageClients: string; readonly licenseManagement: string; readonly mailService: string; readonly start: string; readonly troubleshootSetup: string; readonly usersAccess: string; }"
"{ readonly apiKeys: string; readonly bulkApi: string; readonly configuration: string; readonly connectors: string; readonly connectorsMongoDB: string; readonly connectorsMySQL: string; readonly connectorsWorkplaceSearch: string; readonly crawlerManaging: string; readonly crawlerOverview: string; readonly deployTrainedModels: string; readonly documentLevelSecurity: string; readonly ingestPipelines: string; readonly languageAnalyzers: string; readonly languageClients: string; readonly licenseManagement: string; readonly mailService: string; readonly start: string; readonly troubleshootSetup: string; readonly usersAccess: string; }"
],
"path": "packages/kbn-doc-links/src/types.ts",
"deprecated": false,
Expand Down
16 changes: 12 additions & 4 deletions docs/settings/reporting-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ security is enabled, <<xpack-security-encryptionKey, `xpack.security.encryptionK
Specifies the {time-units}[time] that the reporting poller waits between polling the index for any pending Reporting jobs. Can be specified as number of milliseconds. Defaults to `3s`.

[[xpack-reporting-q-timeout]] `xpack.reporting.queue.timeout` {ess-icon}::
{time-units}[How long] each worker has to produce a report. If your machine is slow or under heavy load, you might need to increase this timeout. If a Reporting job execution goes over this time limit, the job is marked as a failure and no download will be available. Can be specified as number of milliseconds. Defaults to `2m`.
{time-units}[How long] each worker has to produce a report. If your machine is slow or under heavy load, you
might need to increase this timeout. If a Reporting job execution goes over this time limit, the job is marked
as a failure and no download will be available. Can be specified as number of milliseconds. Defaults to `4m`.

[float]
[[reporting-capture-settings]]
Expand All @@ -92,13 +94,19 @@ Specifies the {time-units}[time] that the reporting poller waits between polling
Reporting uses an internal "screenshotting" plugin to capture screenshots from {kib}. The following settings control the capturing process.

`xpack.screenshotting.capture.timeouts.openUrl` {ess-icon}::
Specify the {time-units}[time] to allow the Reporting browser to wait for the "Loading..." screen to dismiss and find the initial data for the page. If the time is exceeded, a screenshot is captured showing the current page, and the download link shows a warning message. Can be specified as number of milliseconds. Defaults to `1m`.
Specify the {time-units}[time] to allow the Reporting browser to wait for the "Loading..." screen to dismiss
and find the initial data for the page. If the time is exceeded, a screenshot is captured showing the current
page, and the download link shows a warning message. Can be specified as number of milliseconds. Defaults to `1m`.

`xpack.screenshotting.capture.timeouts.waitForElements` {ess-icon}::
Specify the {time-units}[time] to allow the Reporting browser to wait for all visualization panels to load on the page. If the time is exceeded, a screenshot is captured showing the current page, and the download link shows a warning message. Can be specified as number of milliseconds. Defaults to `30s`.
Specify the {time-units}[time] to allow the Reporting browser to wait for all visualization panels to load on
the page. If the time is exceeded, a screenshot is captured showing the current page, and the download link
shows a warning message. Can be specified as number of milliseconds. Defaults to `1m`.

`xpack.screenshotting.capture.timeouts.renderComplete` {ess-icon}::
Specify the {time-units}[time] to allow the Reporting browser to wait for all visualizations to fetch and render the data. If the time is exceeded, a screenshot is captured showing the current page, and the download link shows a warning message. Can be specified as number of milliseconds. Defaults to `30s`.
Specify the {time-units}[time] to allow the Reporting browser to wait for all visualizations to fetch and
render the data. If the time is exceeded, a screenshot is captured showing the current page, and the download
link shows a warning message. Can be specified as number of milliseconds. Defaults to `2m`.

NOTE: If any timeouts from `xpack.screenshotting.capture.timeouts.*` settings occur when
running a report job, Reporting will log the error and try to continue
Expand Down
9 changes: 2 additions & 7 deletions examples/guided_onboarding_example/public/components/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,8 @@ import {
EuiText,
EuiTitle,
} from '@elastic/eui';
import type {
GuidedOnboardingPluginStart,
GuideState,
GuideStepIds,
GuideId,
GuideStep,
} from '@kbn/guided-onboarding-plugin/public';
import type { GuideState, GuideStepIds, GuideId, GuideStep } from '@kbn/guided-onboarding';
import type { GuidedOnboardingPluginStart } from '@kbn/guided-onboarding-plugin/public';
import { guidesConfig } from '@kbn/guided-onboarding-plugin/public';

interface MainProps {
Expand Down
2 changes: 0 additions & 2 deletions examples/guided_onboarding_example/public/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* Side Public License, v 1.
*/

import { NavigationPublicPluginStart } from '@kbn/navigation-plugin/public';
import { GuidedOnboardingPluginStart } from '@kbn/guided-onboarding-plugin/public/types';

// eslint-disable-next-line @typescript-eslint/no-empty-interface
Expand All @@ -16,6 +15,5 @@ export interface GuidedOnboardingExamplePluginSetup {}
export interface GuidedOnboardingExamplePluginStart {}

export interface AppPluginStartDependencies {
navigation: NavigationPublicPluginStart;
guidedOnboarding: GuidedOnboardingPluginStart;
}
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
"@hapi/inert": "^6.0.4",
"@hapi/wreck": "^17.1.0",
"@kbn/ace": "link:bazel-bin/packages/kbn-ace",
"@kbn/adhoc-profiler": "link:bazel-bin/packages/kbn-adhoc-profiler",
"@kbn/aiops-components": "link:bazel-bin/x-pack/packages/ml/aiops_components",
"@kbn/aiops-utils": "link:bazel-bin/x-pack/packages/ml/aiops_utils",
"@kbn/alerts": "link:bazel-bin/packages/kbn-alerts",
Expand Down Expand Up @@ -323,6 +324,7 @@
"@kbn/es-types": "link:bazel-bin/packages/kbn-es-types",
"@kbn/field-types": "link:bazel-bin/packages/kbn-field-types",
"@kbn/flot-charts": "link:bazel-bin/packages/kbn-flot-charts",
"@kbn/guided-onboarding": "link:bazel-bin/packages/kbn-guided-onboarding",
"@kbn/handlebars": "link:bazel-bin/packages/kbn-handlebars",
"@kbn/hapi-mocks": "link:bazel-bin/packages/kbn-hapi-mocks",
"@kbn/home-sample-data-card": "link:bazel-bin/packages/home/sample_data_card",
Expand Down Expand Up @@ -573,11 +575,12 @@
"peggy": "^1.2.0",
"pluralize": "3.1.0",
"polished": "^3.7.2",
"pprof": "^3.2.0",
"pretty-ms": "6.0.0",
"prop-types": "^15.8.1",
"proxy-from-env": "1.0.0",
"puid": "1.0.7",
"puppeteer": "^10.2.0",
"puppeteer": "18.1.0",
"query-string": "^6.13.2",
"rbush": "^3.0.1",
"re-resizable": "^6.1.1",
Expand Down Expand Up @@ -857,6 +860,7 @@
"@types/json5": "^0.0.30",
"@types/jsonwebtoken": "^8.5.6",
"@types/kbn__ace": "link:bazel-bin/packages/kbn-ace/npm_module_types",
"@types/kbn__adhoc-profiler": "link:bazel-bin/packages/kbn-adhoc-profiler/npm_module_types",
"@types/kbn__aiops-components": "link:bazel-bin/x-pack/packages/ml/aiops_components/npm_module_types",
"@types/kbn__aiops-utils": "link:bazel-bin/x-pack/packages/ml/aiops_utils/npm_module_types",
"@types/kbn__alerts": "link:bazel-bin/packages/kbn-alerts/npm_module_types",
Expand Down Expand Up @@ -1075,6 +1079,7 @@
"@types/kbn__ftr-screenshot-filename": "link:bazel-bin/packages/kbn-ftr-screenshot-filename/npm_module_types",
"@types/kbn__generate": "link:bazel-bin/packages/kbn-generate/npm_module_types",
"@types/kbn__get-repo-files": "link:bazel-bin/packages/kbn-get-repo-files/npm_module_types",
"@types/kbn__guided-onboarding": "link:bazel-bin/packages/kbn-guided-onboarding/npm_module_types",
"@types/kbn__handlebars": "link:bazel-bin/packages/kbn-handlebars/npm_module_types",
"@types/kbn__hapi-mocks": "link:bazel-bin/packages/kbn-hapi-mocks/npm_module_types",
"@types/kbn__home-sample-data-card": "link:bazel-bin/packages/home/sample_data_card/npm_module_types",
Expand Down
4 changes: 4 additions & 0 deletions packages/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ filegroup(
"//packages/home/sample_data_tab:build",
"//packages/home/sample_data_types:build",
"//packages/kbn-ace:build",
"//packages/kbn-adhoc-profiler:build",
"//packages/kbn-alerts:build",
"//packages/kbn-ambient-storybook-types:build",
"//packages/kbn-ambient-ui-types:build",
Expand Down Expand Up @@ -231,6 +232,7 @@ filegroup(
"//packages/kbn-ftr-screenshot-filename:build",
"//packages/kbn-generate:build",
"//packages/kbn-get-repo-files:build",
"//packages/kbn-guided-onboarding:build",
"//packages/kbn-handlebars:build",
"//packages/kbn-hapi-mocks:build",
"//packages/kbn-i18n:build",
Expand Down Expand Up @@ -528,6 +530,7 @@ filegroup(
"//packages/home/sample_data_card:build_types",
"//packages/home/sample_data_tab:build_types",
"//packages/kbn-ace:build_types",
"//packages/kbn-adhoc-profiler:build_types",
"//packages/kbn-alerts:build_types",
"//packages/kbn-analytics:build_types",
"//packages/kbn-apm-config-loader:build_types",
Expand Down Expand Up @@ -569,6 +572,7 @@ filegroup(
"//packages/kbn-ftr-screenshot-filename:build_types",
"//packages/kbn-generate:build_types",
"//packages/kbn-get-repo-files:build_types",
"//packages/kbn-guided-onboarding:build_types",
"//packages/kbn-handlebars:build_types",
"//packages/kbn-hapi-mocks:build_types",
"//packages/kbn-i18n:build_types",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export interface SimpleSavedObject<T = unknown> {
error: SavedObjectType<T>['error'];
references: SavedObjectType<T>['references'];
updatedAt: SavedObjectType<T>['updated_at'];
createdAt: SavedObjectType<T>['created_at'];
/**
* Space(s) that this saved object exists in. This attribute is not used for "global" saved object types which are registered with
* `namespaceType: 'agnostic'`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ describe('getRootFields', () => {
"migrationVersion",
"coreMigrationVersion",
"updated_at",
"created_at",
"originId",
]
`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const ROOT_FIELDS = [
'migrationVersion',
'coreMigrationVersion',
'updated_at',
'created_at',
'originId',
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export function getSavedObjectFromSource<T>(
id: string,
doc: { _seq_no?: number; _primary_term?: number; _source: SavedObjectsRawDocSource }
): SavedObject<T> {
const { originId, updated_at: updatedAt } = doc._source;
const { originId, updated_at: updatedAt, created_at: createdAt } = doc._source;

let namespaces: string[] = [];
if (!registry.isNamespaceAgnostic(type)) {
Expand All @@ -146,6 +146,7 @@ export function getSavedObjectFromSource<T>(
namespaces,
...(originId && { originId }),
...(updatedAt && { updated_at: updatedAt }),
...(createdAt && { created_at: createdAt }),
version: encodeHitVersion(doc),
attributes: doc._source[type],
references: doc._source.references || [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ describe('SavedObjectsRepository', () => {

const mockTimestamp = '2017-08-14T15:49:14.886Z';
const mockTimestampFields = { updated_at: mockTimestamp };
const mockTimestampFieldsWithCreated = { updated_at: mockTimestamp, created_at: mockTimestamp };
const mockVersionProps = { _seq_no: 1, _primary_term: 1 };
const mockVersion = encodeHitVersion(mockVersionProps);

Expand Down Expand Up @@ -454,7 +455,7 @@ describe('SavedObjectsRepository', () => {
namespace,
...(originId && { originId }),
references,
...mockTimestampFields,
...mockTimestampFieldsWithCreated,
migrationVersion: migrationVersion || { [type]: '1.1.1' },
},
...mockVersionProps,
Expand Down Expand Up @@ -528,7 +529,7 @@ describe('SavedObjectsRepository', () => {
coreMigrationVersion: KIBANA_VERSION,
version: mockVersion,
namespaces: obj.namespaces ?? [obj.namespace ?? 'default'],
...mockTimestampFields,
...mockTimestampFieldsWithCreated,
});

describe('client calls', () => {
Expand Down Expand Up @@ -1089,7 +1090,7 @@ describe('SavedObjectsRepository', () => {
migrator.migrateDocument.mockImplementation(mockMigrateDocument);
const modifiedObj1 = { ...obj1, coreMigrationVersion: '8.0.0' };
await bulkCreateSuccess([modifiedObj1, obj2]);
const docs = [modifiedObj1, obj2].map((x) => ({ ...x, ...mockTimestampFields }));
const docs = [modifiedObj1, obj2].map((x) => ({ ...x, ...mockTimestampFieldsWithCreated }));
expectMigrationArgs(docs[0], true, 1);
expectMigrationArgs(docs[1], true, 2);

Expand Down Expand Up @@ -1440,6 +1441,7 @@ describe('SavedObjectsRepository', () => {
namespaces: doc._source!.namespaces ?? ['default'],
...(doc._source!.originId && { originId: doc._source!.originId }),
...(doc._source!.updated_at && { updated_at: doc._source!.updated_at }),
...(doc._source!.created_at && { created_at: doc._source!.created_at }),
version: encodeHitVersion(doc),
attributes: doc._source![type],
references: doc._source!.references || [],
Expand Down Expand Up @@ -3233,7 +3235,7 @@ describe('SavedObjectsRepository', () => {
references,
migrationVersion,
coreMigrationVersion,
...mockTimestampFields,
...mockTimestampFieldsWithCreated,
};
expectMigrationArgs(doc);

Expand Down Expand Up @@ -3290,7 +3292,7 @@ describe('SavedObjectsRepository', () => {
expect(result).toEqual({
type: MULTI_NAMESPACE_TYPE,
id,
...mockTimestampFields,
...mockTimestampFieldsWithCreated,
version: mockVersion,
attributes,
references,
Expand Down Expand Up @@ -3969,6 +3971,7 @@ describe('SavedObjectsRepository', () => {
'migrationVersion',
'coreMigrationVersion',
'updated_at',
'created_at',
'originId',
'title',
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ export class SavedObjectsRepository implements ISavedObjectsRepository {
attributes,
migrationVersion,
coreMigrationVersion,
created_at: time,
updated_at: time,
...(Array.isArray(references) && { references }),
});
Expand Down Expand Up @@ -516,6 +517,7 @@ export class SavedObjectsRepository implements ISavedObjectsRepository {
...(savedObjectNamespace && { namespace: savedObjectNamespace }),
...(savedObjectNamespaces && { namespaces: savedObjectNamespaces }),
updated_at: time,
created_at: time,
references: object.references || [],
originId,
}) as SavedObjectSanitizedDoc<T>;
Expand Down
Loading

0 comments on commit 3e6c09d

Please sign in to comment.