Skip to content

Commit

Permalink
Merge branch 'main' of github.com:elastic/kibana into adds-revision-f…
Browse files Browse the repository at this point in the history
…ield-to-rules
  • Loading branch information
spong committed Mar 9, 2023
2 parents eef57f6 + 1ab5aed commit 2028524
Show file tree
Hide file tree
Showing 172 changed files with 3,342 additions and 1,644 deletions.
6 changes: 6 additions & 0 deletions .buildkite/pipelines/on_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ steps:
- exit_status: '*'
limit: 1

- command: '.buildkite/scripts/steps/functional/on_merge_unsupported_ftrs.sh'
label: Trigger unsupported ftr tests
timeout_in_minutes: 10
agents:
queue: 'kibana-default'

- command: .buildkite/scripts/steps/lint.sh
label: 'Linting'
agents:
Expand Down
66 changes: 66 additions & 0 deletions .buildkite/pipelines/on_merge_unsupported_ftrs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
steps:
- command: .buildkite/scripts/lifecycle/pre_build.sh
label: Pre-Build
timeout_in_minutes: 10
agents:
queue: kibana-default
retry:
automatic:
- exit_status: '*'
limit: 1

- command: .buildkite/scripts/steps/build_kibana.sh
label: Build Kibana Distribution and Plugins
agents:
queue: n2-16-spot
key: build
if: "build.env('KIBANA_BUILD_ID') == null || build.env('KIBANA_BUILD_ID') == ''"
timeout_in_minutes: 60
retry:
automatic:
- exit_status: '-1'
limit: 3

- command: .buildkite/scripts/steps/functional/apm_cypress.sh
label: 'APM Cypress Tests'
agents:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 120
parallelism: 4
retry:
automatic:
- exit_status: '-1'
limit: 3
- exit_status: '*'
limit: 1


- command: .buildkite/scripts/steps/functional/security_solution.sh
label: 'Security Solution Tests'
agents:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 120
parallelism: 4
retry:
automatic:
- exit_status: '-1'
limit: 3
- exit_status: '*'
limit: 1

- command: .buildkite/scripts/steps/functional/synthetics_plugin.sh
label: 'Synthetics @elastic/synthetics Tests'
agents:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 120
artifact_paths:
- 'x-pack/plugins/synthetics/e2e/.journeys/**/*'
retry:
automatic:
- exit_status: '-1'
limit: 3
- exit_status: '*'
limit: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

set -euo pipefail

echo "--- Trigger unsupported ftr tests"
ts-node .buildkite/scripts/steps/trigger_pipeline.ts kibana-on-merge-unsupported-ftrs "$BUILDKITE_BRANCH" "$BUILDKITE_COMMIT"
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@
"usng.js": "^0.4.5",
"utility-types": "^3.10.0",
"uuid": "9.0.0",
"vega": "5.22.1",
"vega": "^5.24.0",
"vega-interpreter": "^1.0.4",
"vega-lite": "^5.5.0",
"vega-schema-url-parser": "^2.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ import { SavedObjectConfig } from '@kbn/core-saved-objects-base-server-internal'
import type { InternalCoreUsageDataSetup } from '@kbn/core-usage-data-base-server-internal';
import type { Logger } from '@kbn/logging';
import type { InternalSavedObjectRouter } from '../internal_types';
import { catchAndReturnBoomErrors, throwIfAnyTypeNotVisibleByAPI } from './utils';
import {
catchAndReturnBoomErrors,
logWarnOnExternalRequest,
throwIfAnyTypeNotVisibleByAPI,
} from './utils';

interface RouteDependencies {
config: SavedObjectConfig;
Expand Down Expand Up @@ -54,9 +58,12 @@ export const registerBulkCreateRoute = (
},
},
catchAndReturnBoomErrors(async (context, req, res) => {
logger.warn(
"The bulk create saved object API '/api/saved_objects/_bulk_create' is deprecated."
);
logWarnOnExternalRequest({
method: 'post',
path: '/api/saved_objects/_bulk_create',
req,
logger,
});
const { overwrite } = req.query;

const usageStatsClient = coreUsageData.getClient();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ import { SavedObjectConfig } from '@kbn/core-saved-objects-base-server-internal'
import type { InternalCoreUsageDataSetup } from '@kbn/core-usage-data-base-server-internal';
import type { Logger } from '@kbn/logging';
import type { InternalSavedObjectRouter } from '../internal_types';
import { catchAndReturnBoomErrors, throwIfAnyTypeNotVisibleByAPI } from './utils';
import {
catchAndReturnBoomErrors,
logWarnOnExternalRequest,
throwIfAnyTypeNotVisibleByAPI,
} from './utils';

interface RouteDependencies {
config: SavedObjectConfig;
Expand Down Expand Up @@ -40,9 +44,12 @@ export const registerBulkDeleteRoute = (
},
},
catchAndReturnBoomErrors(async (context, req, res) => {
logger.warn(
"The bulk update saved object API '/api/saved_objects/_bulk_update' is deprecated."
);
logWarnOnExternalRequest({
method: 'post',
path: '/api/saved_objects/_bulk_delete',
req,
logger,
});
const { force } = req.query;
const usageStatsClient = coreUsageData.getClient();
usageStatsClient.incrementSavedObjectsBulkDelete({ request: req }).catch(() => {});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ import { SavedObjectConfig } from '@kbn/core-saved-objects-base-server-internal'
import type { InternalCoreUsageDataSetup } from '@kbn/core-usage-data-base-server-internal';
import type { Logger } from '@kbn/logging';
import type { InternalSavedObjectRouter } from '../internal_types';
import { catchAndReturnBoomErrors, throwIfAnyTypeNotVisibleByAPI } from './utils';
import {
catchAndReturnBoomErrors,
logWarnOnExternalRequest,
throwIfAnyTypeNotVisibleByAPI,
} from './utils';

interface RouteDependencies {
config: SavedObjectConfig;
Expand Down Expand Up @@ -39,7 +43,12 @@ export const registerBulkGetRoute = (
},
},
catchAndReturnBoomErrors(async (context, req, res) => {
logger.warn("The bulk get saved object API '/api/saved_objects/_bulk_get' is deprecated.");
logWarnOnExternalRequest({
method: 'post',
path: '/api/saved_objects/_bulk_get',
req,
logger,
});
const usageStatsClient = coreUsageData.getClient();
usageStatsClient.incrementSavedObjectsBulkGet({ request: req }).catch(() => {});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ import { SavedObjectConfig } from '@kbn/core-saved-objects-base-server-internal'
import type { InternalCoreUsageDataSetup } from '@kbn/core-usage-data-base-server-internal';
import type { Logger } from '@kbn/logging';
import type { InternalSavedObjectRouter } from '../internal_types';
import { catchAndReturnBoomErrors, throwIfAnyTypeNotVisibleByAPI } from './utils';
import {
catchAndReturnBoomErrors,
logWarnOnExternalRequest,
throwIfAnyTypeNotVisibleByAPI,
} from './utils';

interface RouteDependencies {
config: SavedObjectConfig;
Expand All @@ -37,9 +41,12 @@ export const registerBulkResolveRoute = (
},
},
catchAndReturnBoomErrors(async (context, req, res) => {
logger.warn(
"The bulk resolve saved object API '/api/saved_objects/_bulk_resolve' is deprecated."
);
logWarnOnExternalRequest({
method: 'post',
path: '/api/saved_objects/_bulk_resolve',
req,
logger,
});
const usageStatsClient = coreUsageData.getClient();
usageStatsClient.incrementSavedObjectsBulkResolve({ request: req }).catch(() => {});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ import { SavedObjectConfig } from '@kbn/core-saved-objects-base-server-internal'
import type { InternalCoreUsageDataSetup } from '@kbn/core-usage-data-base-server-internal';
import type { Logger } from '@kbn/logging';
import type { InternalSavedObjectRouter } from '../internal_types';
import { catchAndReturnBoomErrors, throwIfAnyTypeNotVisibleByAPI } from './utils';
import {
catchAndReturnBoomErrors,
logWarnOnExternalRequest,
throwIfAnyTypeNotVisibleByAPI,
} from './utils';

interface RouteDependencies {
config: SavedObjectConfig;
Expand Down Expand Up @@ -49,9 +53,12 @@ export const registerBulkUpdateRoute = (
},
},
catchAndReturnBoomErrors(async (context, req, res) => {
logger.warn(
"The bulk update saved object API '/api/saved_objects/_bulk_update' is deprecated."
);
logWarnOnExternalRequest({
method: 'put',
path: '/api/saved_objects/_bulk_update',
req,
logger,
});
const usageStatsClient = coreUsageData.getClient();
usageStatsClient.incrementSavedObjectsBulkUpdate({ request: req }).catch(() => {});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ import { SavedObjectConfig } from '@kbn/core-saved-objects-base-server-internal'
import type { InternalCoreUsageDataSetup } from '@kbn/core-usage-data-base-server-internal';
import type { Logger } from '@kbn/logging';
import type { InternalSavedObjectRouter } from '../internal_types';
import { catchAndReturnBoomErrors, throwIfTypeNotVisibleByAPI } from './utils';
import {
catchAndReturnBoomErrors,
logWarnOnExternalRequest,
throwIfTypeNotVisibleByAPI,
} from './utils';

interface RouteDependencies {
config: SavedObjectConfig;
Expand Down Expand Up @@ -53,7 +57,12 @@ export const registerCreateRoute = (
},
},
catchAndReturnBoomErrors(async (context, req, res) => {
logger.warn("The create saved object API '/api/saved_objects/{type}/{id}' is deprecated.");
logWarnOnExternalRequest({
method: 'post',
path: '/api/saved_objects/{type}/{id?}',
req,
logger,
});
const { type, id } = req.params;
const { overwrite } = req.query;
const { attributes, migrationVersion, coreMigrationVersion, references, initialNamespaces } =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ import { SavedObjectConfig } from '@kbn/core-saved-objects-base-server-internal'
import type { InternalCoreUsageDataSetup } from '@kbn/core-usage-data-base-server-internal';
import type { Logger } from '@kbn/logging';
import type { InternalSavedObjectRouter } from '../internal_types';
import { catchAndReturnBoomErrors, throwIfTypeNotVisibleByAPI } from './utils';
import {
catchAndReturnBoomErrors,
logWarnOnExternalRequest,
throwIfTypeNotVisibleByAPI,
} from './utils';

interface RouteDependencies {
config: SavedObjectConfig;
Expand All @@ -38,7 +42,12 @@ export const registerDeleteRoute = (
},
},
catchAndReturnBoomErrors(async (context, req, res) => {
logger.warn("The delete saved object API '/api/saved_objects/{type}/{id}' is deprecated.");
logWarnOnExternalRequest({
method: 'delete',
path: '/api/saved_objects/{type}/{id}',
req,
logger,
});
const { type, id } = req.params;
const { force } = req.query;
const { getClient, typeRegistry } = (await context.core).savedObjects;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type { InternalCoreUsageDataSetup } from '@kbn/core-usage-data-base-serve
import type { Logger } from '@kbn/logging';
import type { InternalSavedObjectRouter } from '../internal_types';
import { catchAndReturnBoomErrors, throwOnHttpHiddenTypes } from './utils';

import { logWarnOnExternalRequest } from './utils';
interface RouteDependencies {
config: SavedObjectConfig;
coreUsageData: InternalCoreUsageDataSetup;
Expand Down Expand Up @@ -63,7 +63,12 @@ export const registerFindRoute = (
},
},
catchAndReturnBoomErrors(async (context, req, res) => {
logger.warn("The find saved object API '/api/saved_objects/_find' is deprecated.");
logWarnOnExternalRequest({
method: 'get',
path: '/api/saved_objects/_find',
req,
logger,
});
const query = req.query;

const namespaces =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ import { SavedObjectConfig } from '@kbn/core-saved-objects-base-server-internal'
import type { InternalCoreUsageDataSetup } from '@kbn/core-usage-data-base-server-internal';
import type { Logger } from '@kbn/logging';
import type { InternalSavedObjectRouter } from '../internal_types';
import { catchAndReturnBoomErrors, throwIfTypeNotVisibleByAPI } from './utils';
import {
catchAndReturnBoomErrors,
logWarnOnExternalRequest,
throwIfTypeNotVisibleByAPI,
} from './utils';

interface RouteDependencies {
config: SavedObjectConfig;
Expand All @@ -35,7 +39,12 @@ export const registerGetRoute = (
},
},
catchAndReturnBoomErrors(async (context, req, res) => {
logger.warn("The get saved object API '/api/saved_objects/{type}/{id}' is deprecated.");
logWarnOnExternalRequest({
method: 'get',
path: '/api/saved_objects/{type}/{id}',
req,
logger,
});
const { type, id } = req.params;

const usageStatsClient = coreUsageData.getClient();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export function registerRoutes({
}) {
const router =
http.createRouter<InternalSavedObjectsRequestHandlerContext>('/api/saved_objects/');

registerGetRoute(router, { config, coreUsageData, logger });
registerResolveRoute(router, { config, coreUsageData, logger });
registerCreateRoute(router, { config, coreUsageData, logger });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { SavedObjectConfig } from '@kbn/core-saved-objects-base-server-internal'
import type { InternalCoreUsageDataSetup } from '@kbn/core-usage-data-base-server-internal';
import type { Logger } from '@kbn/logging';
import type { InternalSavedObjectRouter } from '../internal_types';
import { throwIfTypeNotVisibleByAPI } from './utils';
import { throwIfTypeNotVisibleByAPI, logWarnOnExternalRequest } from './utils';

interface RouteDependencies {
config: SavedObjectConfig;
Expand All @@ -35,9 +35,12 @@ export const registerResolveRoute = (
},
},
router.handleLegacyErrors(async (context, req, res) => {
logger.warn(
"The resolve saved object API '/api/saved_objects/resolve/{type}/{id}' is deprecated."
);
logWarnOnExternalRequest({
method: 'get',
path: '/api/saved_objects/resolve/{type}/{id}',
req,
logger,
});
const { type, id } = req.params;
const { savedObjects } = await context.core;

Expand Down
Loading

0 comments on commit 2028524

Please sign in to comment.