Skip to content

Commit

Permalink
Merge branch 'master' into patch_actions_bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
spong authored Jun 2, 2020
2 parents 6d42aa6 + ce45dad commit 90af400
Show file tree
Hide file tree
Showing 373 changed files with 1,396 additions and 1,381 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
/x-pack/plugins/telemetry_collection_xpack/ @elastic/pulse

# Kibana Alerting Services
/x-pack/plugins/alerting/ @elastic/kibana-alerting-services
/x-pack/plugins/alerts/ @elastic/kibana-alerting-services
/x-pack/plugins/actions/ @elastic/kibana-alerting-services
/x-pack/plugins/event_log/ @elastic/kibana-alerting-services
/x-pack/plugins/task_manager/ @elastic/kibana-alerting-services
Expand Down
6 changes: 3 additions & 3 deletions docs/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

:include-xpack: true
:lang: en
:kib-repo-dir: {docdir}
:kib-repo-dir: {kibana-root}/docs
:blog-ref: https://www.elastic.co/blog/
:wikipedia: https://en.wikipedia.org/wiki

include::{asciidoc-dir}/../../shared/versions/stack/{source_branch}.asciidoc[]
include::{docs-root}/shared/versions/stack/{source_branch}.asciidoc[]

:docker-repo: docker.elastic.co/kibana/kibana
:docker-image: docker.elastic.co/kibana/kibana:{version}
Expand All @@ -18,7 +18,7 @@ include::{asciidoc-dir}/../../shared/versions/stack/{source_branch}.asciidoc[]
:blob: {repo}blob/{branch}/
:security-ref: https://www.elastic.co/community/security/

include::{asciidoc-dir}/../../shared/attributes.asciidoc[]
include::{docs-root}/shared/attributes.asciidoc[]

include::user/index.asciidoc[]

Expand Down
26 changes: 13 additions & 13 deletions docs/setup/settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -627,17 +627,17 @@ Valid locales are: `en`, `zh-CN`, `ja-JP`. *Default: `en`*

|===

include::{docdir}/settings/alert-action-settings.asciidoc[]
include::{docdir}/settings/apm-settings.asciidoc[]
include::{docdir}/settings/dev-settings.asciidoc[]
include::{docdir}/settings/graph-settings.asciidoc[]
include::{docdir}/settings/infrastructure-ui-settings.asciidoc[]
include::{docdir}/settings/i18n-settings.asciidoc[]
include::{docdir}/settings/logs-ui-settings.asciidoc[]
include::{docdir}/settings/ml-settings.asciidoc[]
include::{docdir}/settings/monitoring-settings.asciidoc[]
include::{docdir}/settings/reporting-settings.asciidoc[]
include::{kib-repo-dir}/settings/alert-action-settings.asciidoc[]
include::{kib-repo-dir}/settings/apm-settings.asciidoc[]
include::{kib-repo-dir}/settings/dev-settings.asciidoc[]
include::{kib-repo-dir}/settings/graph-settings.asciidoc[]
include::{kib-repo-dir}/settings/infrastructure-ui-settings.asciidoc[]
include::{kib-repo-dir}/settings/i18n-settings.asciidoc[]
include::{kib-repo-dir}/settings/logs-ui-settings.asciidoc[]
include::{kib-repo-dir}/settings/ml-settings.asciidoc[]
include::{kib-repo-dir}/settings/monitoring-settings.asciidoc[]
include::{kib-repo-dir}/settings/reporting-settings.asciidoc[]
include::secure-settings.asciidoc[]
include::{docdir}/settings/security-settings.asciidoc[]
include::{docdir}/settings/spaces-settings.asciidoc[]
include::{docdir}/settings/telemetry-settings.asciidoc[]
include::{kib-repo-dir}/settings/security-settings.asciidoc[]
include::{kib-repo-dir}/settings/spaces-settings.asciidoc[]
include::{kib-repo-dir}/settings/telemetry-settings.asciidoc[]
2 changes: 1 addition & 1 deletion examples/alerting_example/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"kibanaVersion": "kibana",
"server": true,
"ui": true,
"requiredPlugins": ["triggers_actions_ui", "charts", "data", "alerting", "actions"],
"requiredPlugins": ["triggers_actions_ui", "charts", "data", "alerts", "actions"],
"optionalPlugins": []
}
8 changes: 4 additions & 4 deletions examples/alerting_example/public/alert_types/astros.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ import {
import { i18n } from '@kbn/i18n';
import { flatten } from 'lodash';
import { ALERTING_EXAMPLE_APP_ID, Craft, Operator } from '../../common/constants';
import { SanitizedAlert } from '../../../../x-pack/plugins/alerting/common';
import { PluginSetupContract as AlertingSetup } from '../../../../x-pack/plugins/alerting/public';
import { SanitizedAlert } from '../../../../x-pack/plugins/alerts/common';
import { PluginSetupContract as AlertingSetup } from '../../../../x-pack/plugins/alerts/public';
import { AlertTypeModel } from '../../../../x-pack/plugins/triggers_actions_ui/public';

export function registerNavigation(alerting: AlertingSetup) {
alerting.registerNavigation(
export function registerNavigation(alerts: AlertingSetup) {
alerts.registerNavigation(
ALERTING_EXAMPLE_APP_ID,
'example.people-in-space',
(alert: SanitizedAlert) => `/astros/${alert.id}`
Expand Down
10 changes: 5 additions & 5 deletions examples/alerting_example/public/alert_types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@

import { registerNavigation as registerPeopleInSpaceNavigation } from './astros';
import { ALERTING_EXAMPLE_APP_ID } from '../../common/constants';
import { SanitizedAlert } from '../../../../x-pack/plugins/alerting/common';
import { PluginSetupContract as AlertingSetup } from '../../../../x-pack/plugins/alerting/public';
import { SanitizedAlert } from '../../../../x-pack/plugins/alerts/common';
import { PluginSetupContract as AlertingSetup } from '../../../../x-pack/plugins/alerts/public';

export function registerNavigation(alerting: AlertingSetup) {
export function registerNavigation(alerts: AlertingSetup) {
// register default navigation
alerting.registerDefaultNavigation(
alerts.registerDefaultNavigation(
ALERTING_EXAMPLE_APP_ID,
(alert: SanitizedAlert) => `/alert/${alert.id}`
);

registerPeopleInSpaceNavigation(alerting);
registerPeopleInSpaceNavigation(alerts);
}
2 changes: 1 addition & 1 deletion examples/alerting_example/public/components/view_alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {
Alert,
AlertTaskState,
BASE_ALERT_API_PATH,
} from '../../../../x-pack/plugins/alerting/common';
} from '../../../../x-pack/plugins/alerts/common';
import { ALERTING_EXAMPLE_APP_ID } from '../../common/constants';

type Props = RouteComponentProps & {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import {
Alert,
AlertTaskState,
BASE_ALERT_API_PATH,
} from '../../../../x-pack/plugins/alerting/common';
} from '../../../../x-pack/plugins/alerts/common';
import { ALERTING_EXAMPLE_APP_ID } from '../../common/constants';

type Props = RouteComponentProps & {
Expand Down
10 changes: 5 additions & 5 deletions examples/alerting_example/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import { Plugin, CoreSetup, AppMountParameters } from 'kibana/public';
import { PluginSetupContract as AlertingSetup } from '../../../x-pack/plugins/alerting/public';
import { PluginSetupContract as AlertingSetup } from '../../../x-pack/plugins/alerts/public';
import { ChartsPluginStart } from '../../../src/plugins/charts/public';
import { TriggersAndActionsUIPublicPluginSetup } from '../../../x-pack/plugins/triggers_actions_ui/public';
import { DataPublicPluginStart } from '../../../src/plugins/data/public';
Expand All @@ -30,12 +30,12 @@ export type Setup = void;
export type Start = void;

export interface AlertingExamplePublicSetupDeps {
alerting: AlertingSetup;
alerts: AlertingSetup;
triggers_actions_ui: TriggersAndActionsUIPublicPluginSetup;
}

export interface AlertingExamplePublicStartDeps {
alerting: AlertingSetup;
alerts: AlertingSetup;
triggers_actions_ui: TriggersAndActionsUIPublicPluginSetup;
charts: ChartsPluginStart;
data: DataPublicPluginStart;
Expand All @@ -44,7 +44,7 @@ export interface AlertingExamplePublicStartDeps {
export class AlertingExamplePlugin implements Plugin<Setup, Start, AlertingExamplePublicSetupDeps> {
public setup(
core: CoreSetup<AlertingExamplePublicStartDeps, Start>,
{ alerting, triggers_actions_ui }: AlertingExamplePublicSetupDeps
{ alerts, triggers_actions_ui }: AlertingExamplePublicSetupDeps
) {
core.application.register({
id: 'AlertingExample',
Expand All @@ -59,7 +59,7 @@ export class AlertingExamplePlugin implements Plugin<Setup, Start, AlertingExamp
triggers_actions_ui.alertTypeRegistry.register(getAlwaysFiringAlertType());
triggers_actions_ui.alertTypeRegistry.register(getPeopleInSpaceAlertType());

registerNavigation(alerting);
registerNavigation(alerts);
}

public start() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import uuid from 'uuid';
import { range } from 'lodash';
import { AlertType } from '../../../../x-pack/plugins/alerting/server';
import { AlertType } from '../../../../x-pack/plugins/alerts/server';
import { DEFAULT_INSTANCES_TO_GENERATE, ALERTING_EXAMPLE_APP_ID } from '../../common/constants';

export const alertType: AlertType = {
Expand Down
2 changes: 1 addition & 1 deletion examples/alerting_example/server/alert_types/astros.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import axios from 'axios';
import { AlertType } from '../../../../x-pack/plugins/alerting/server';
import { AlertType } from '../../../../x-pack/plugins/alerts/server';
import { Operator, Craft, ALERTING_EXAMPLE_APP_ID } from '../../common/constants';

interface PeopleInSpace {
Expand Down
10 changes: 5 additions & 5 deletions examples/alerting_example/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@
*/

import { Plugin, CoreSetup } from 'kibana/server';
import { PluginSetupContract as AlertingSetup } from '../../../x-pack/plugins/alerting/server';
import { PluginSetupContract as AlertingSetup } from '../../../x-pack/plugins/alerts/server';

import { alertType as alwaysFiringAlert } from './alert_types/always_firing';
import { alertType as peopleInSpaceAlert } from './alert_types/astros';

// this plugin's dependendencies
export interface AlertingExampleDeps {
alerting: AlertingSetup;
alerts: AlertingSetup;
}

export class AlertingExamplePlugin implements Plugin<void, void, AlertingExampleDeps> {
public setup(core: CoreSetup, { alerting }: AlertingExampleDeps) {
alerting.registerType(alwaysFiringAlert);
alerting.registerType(peopleInSpaceAlert);
public setup(core: CoreSetup, { alerts }: AlertingExampleDeps) {
alerts.registerType(alwaysFiringAlert);
alerts.registerType(peopleInSpaceAlert);
}

public start() {}
Expand Down
2 changes: 1 addition & 1 deletion rfcs/text/0003_handler_interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ application.registerApp({
});

// Alerting
alerting.registerType({
alerts.registerType({
id: 'myAlert',
async execute(context, params, state) {
const indexPatterns = await context.core.savedObjects.find('indexPattern');
Expand Down
2 changes: 1 addition & 1 deletion x-pack/.i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"xpack.actions": "plugins/actions",
"xpack.advancedUiActions": "plugins/advanced_ui_actions",
"xpack.uiActionsEnhanced": "examples/ui_actions_enhanced_examples",
"xpack.alerting": "plugins/alerting",
"xpack.alerts": "plugins/alerts",
"xpack.alertingBuiltins": "plugins/alerting_builtins",
"xpack.apm": ["legacy/plugins/apm", "plugins/apm"],
"xpack.beatsManagement": ["legacy/plugins/beats_management", "plugins/beats_management"],
Expand Down
12 changes: 6 additions & 6 deletions x-pack/dev-tools/jest/create_jest_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
* you may not use this file except in compliance with the Elastic License.
*/

export function createJestConfig({ kibanaDirectory, xPackKibanaDirectory }) {
export function createJestConfig({ kibanaDirectory, rootDir, xPackKibanaDirectory }) {
const fileMockPath = `${kibanaDirectory}/src/dev/jest/mocks/file_mock.js`;
return {
rootDir: xPackKibanaDirectory,
rootDir,
roots: ['<rootDir>/plugins', '<rootDir>/legacy/plugins', '<rootDir>/legacy/server'],
moduleFileExtensions: ['js', 'json', 'ts', 'tsx'],
moduleNameMapper: {
Expand Down Expand Up @@ -44,15 +44,15 @@ export function createJestConfig({ kibanaDirectory, xPackKibanaDirectory }) {
'!**/plugins/apm/e2e/**',
],
coveragePathIgnorePatterns: ['.*\\.d\\.ts'],
coverageDirectory: '<rootDir>/../target/kibana-coverage/jest',
coverageDirectory: `${kibanaDirectory}/target/kibana-coverage/jest`,
coverageReporters: !!process.env.CODE_COVERAGE ? ['json'] : ['html'],
setupFiles: [
`${kibanaDirectory}/src/dev/jest/setup/babel_polyfill.js`,
`<rootDir>/dev-tools/jest/setup/polyfills.js`,
`<rootDir>/dev-tools/jest/setup/enzyme.js`,
`${xPackKibanaDirectory}/dev-tools/jest/setup/polyfills.js`,
`${xPackKibanaDirectory}/dev-tools/jest/setup/enzyme.js`,
],
setupFilesAfterEnv: [
`<rootDir>/dev-tools/jest/setup/setup_test.js`,
`${xPackKibanaDirectory}/dev-tools/jest/setup/setup_test.js`,
`${kibanaDirectory}/src/dev/jest/setup/mocks.js`,
`${kibanaDirectory}/src/dev/jest/setup/react_testing_library.js`,
],
Expand Down
1 change: 1 addition & 0 deletions x-pack/dev-tools/jest/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export function runJest() {
const config = JSON.stringify(
createJestConfig({
kibanaDirectory: resolve(__dirname, '../../..'),
rootDir: resolve(__dirname, '../..'),
xPackKibanaDirectory: resolve(__dirname, '../..'),
})
);
Expand Down
2 changes: 1 addition & 1 deletion x-pack/legacy/plugins/monitoring/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { KIBANA_ALERTING_ENABLED } from '../../../plugins/monitoring/common/cons
*/
const deps = ['kibana', 'elasticsearch', 'xpack_main'];
if (KIBANA_ALERTING_ENABLED) {
deps.push(...['alerting', 'actions']);
deps.push(...['alerts', 'actions']);
}
export const monitoring = (kibana: any) => {
return new kibana.Plugin({
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/actions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Table of Contents
- [Executor](#executor)
- [Example](#example)
- [RESTful API](#restful-api)
- [`POST /api/action`: Create action](#post-apiaction-create-action)
- [`POST /api/actions/action`: Create action](#post-apiaction-create-action)
- [`DELETE /api/actions/action/{id}`: Delete action](#delete-apiactionid-delete-action)
- [`GET /api/actions`: Get all actions](#get-apiactiongetall-get-all-actions)
- [`GET /api/actions/action/{id}`: Get action](#get-apiactionid-get-action)
Expand Down Expand Up @@ -163,7 +163,7 @@ The built-in email action type provides a good example of creating an action typ

Using an action type requires an action to be created that will contain and encrypt configuration for a given action type. See below for CRUD operations using the API.

### `POST /api/action`: Create action
### `POST /api/actions/action`: Create action

Payload:

Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/alerting_builtins/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# alerting_builtins plugin

This plugin provides alertTypes shipped with Kibana for use with the
[the alerting plugin](../alerting/README.md). When enabled, it will register
[the alerts plugin](../alerts/README.md). When enabled, it will register
the built-in alertTypes with the alerting plugin, register associated HTTP
routes, etc.

Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/alerting_builtins/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"server": true,
"version": "8.0.0",
"kibanaVersion": "kibana",
"requiredPlugins": ["alerting"],
"requiredPlugins": ["alerts"],
"configPath": ["xpack", "alerting_builtins"],
"ui": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { register as registerIndexThreshold } from './index_threshold';
interface RegisterBuiltInAlertTypesParams {
service: Service;
router: IRouter;
alerting: AlertingSetup;
alerts: AlertingSetup;
baseRoute: string;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import { i18n } from '@kbn/i18n';
import { Params } from './alert_type_params';
import { AlertExecutorOptions } from '../../../../alerting/server';
import { AlertExecutorOptions } from '../../../../alerts/server';

// alert type context provided to actions

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ export function getService() {
interface RegisterParams {
service: Service;
router: IRouter;
alerting: AlertingSetup;
alerts: AlertingSetup;
baseRoute: string;
}

export function register(params: RegisterParams) {
const { service, router, alerting, baseRoute } = params;
const { service, router, alerts, baseRoute } = params;

alerting.registerType(getAlertType(service));
alerts.registerType(getAlertType(service));

const baseBuiltInRoute = `${baseRoute}/index_threshold`;
registerRoutes({ service, router, baseRoute: baseBuiltInRoute });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import { i18n } from '@kbn/i18n';
import { times } from 'lodash';
import { parseDuration } from '../../../../../alerting/server';
import { parseDuration } from '../../../../../alerts/server';
import { MAX_INTERVALS } from '../index';

// dates as numbers are epoch millis
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import { i18n } from '@kbn/i18n';
import { schema, TypeOf } from '@kbn/config-schema';

import { parseDuration } from '../../../../../alerting/server';
import { parseDuration } from '../../../../../alerts/server';
import { MAX_INTERVALS } from '../index';
import { CoreQueryParamsSchemaProperties, validateCoreQueryBody } from './core_query_types';
import {
Expand Down
6 changes: 3 additions & 3 deletions x-pack/plugins/alerting_builtins/server/plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import { AlertingBuiltinsPlugin } from './plugin';
import { coreMock } from '../../../../src/core/server/mocks';
import { alertsMock } from '../../../plugins/alerting/server/mocks';
import { alertsMock } from '../../alerts/server/mocks';

describe('AlertingBuiltins Plugin', () => {
describe('setup()', () => {
Expand All @@ -22,7 +22,7 @@ describe('AlertingBuiltins Plugin', () => {

it('should register built-in alert types', async () => {
const alertingSetup = alertsMock.createSetup();
await plugin.setup(coreSetup, { alerting: alertingSetup });
await plugin.setup(coreSetup, { alerts: alertingSetup });

expect(alertingSetup.registerType).toHaveBeenCalledTimes(1);

Expand All @@ -44,7 +44,7 @@ describe('AlertingBuiltins Plugin', () => {

it('should return a service in the expected shape', async () => {
const alertingSetup = alertsMock.createSetup();
const service = await plugin.setup(coreSetup, { alerting: alertingSetup });
const service = await plugin.setup(coreSetup, { alerts: alertingSetup });

expect(typeof service.indexThreshold.timeSeriesQuery).toBe('function');
});
Expand Down
Loading

0 comments on commit 90af400

Please sign in to comment.