Skip to content

Commit

Permalink
Merge branch 'master' into add-ftr-metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Apr 20, 2020
2 parents 4923e3f + 878cc8b commit 223c3eb
Show file tree
Hide file tree
Showing 1,768 changed files with 14,072 additions and 53,051 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ module.exports = {
},
{
// typescript only for front and back end
files: ['x-pack/legacy/plugins/siem/**/*.{ts,tsx}'],
files: ['x-pack/{,legacy/}plugins/siem/**/*.{ts,tsx}'],
rules: {
// This will be turned on after bug fixes are complete
// '@typescript-eslint/explicit-member-accessibility': 'warn',
Expand Down Expand Up @@ -613,7 +613,7 @@ module.exports = {
// },
{
// typescript and javascript for front and back end
files: ['x-pack/legacy/plugins/siem/**/*.{js,ts,tsx}'],
files: ['x-pack/{,legacy/}plugins/siem/**/*.{js,ts,tsx}'],
plugins: ['eslint-plugin-node', 'react'],
env: {
mocha: true,
Expand Down
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ A high level overview of our contributing guidelines.
- [Setting Up SSL](#setting-up-ssl)
- [Linting](#linting)
- [Internationalization](#internationalization)
- [Localization](#localization)
- [Testing and Building](#testing-and-building)
- [Debugging server code](#debugging-server-code)
- [Instrumenting with Elastic APM](#instrumenting-with-elastic-apm)
Expand Down Expand Up @@ -408,6 +409,11 @@ ReactDOM.render(
There are a number of tools created to support internationalization in Kibana that would allow one to validate internationalized labels,
extract them to a `JSON` file or integrate translations back to Kibana. To know more, please read corresponding [readme](src/dev/i18n/README.md) file.

### Localization

We cannot support accepting contributions to the translations from any source other than the translators we have engaged to do the work.
We are still to develop a proper process to accept any contributed translations. We certainly appreciate that people care enough about the localization effort to want to help improve the quality. We aim to build out a more comprehensive localization process for the future and will notify you once contributions can be supported, but for the time being, we are not able to incorporate suggestions.

### Testing and Building

To ensure that your changes will not break other functionality, please run the test suite and build process before submitting your Pull Request.
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ kibanaPipeline(timeoutMinutes: 135, checkPrChanges: true) {
'xpack-ciGroup10': kibanaPipeline.xpackCiGroupProcess(10),
'xpack-accessibility': kibanaPipeline.functionalTestProcess('xpack-accessibility', './test/scripts/jenkins_xpack_accessibility.sh'),
'xpack-siemCypress': { processNumber ->
whenChanged(['x-pack/legacy/plugins/siem/', 'x-pack/test/siem_cypress/']) {
whenChanged(['x-pack/plugins/siem/', 'x-pack/legacy/plugins/siem/', 'x-pack/test/siem_cypress/']) {
kibanaPipeline.functionalTestProcess('xpack-siemCypress', './test/scripts/jenkins_siem_cypress.sh')(processNumber)
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
| [SavedQuery](./kibana-plugin-plugins-data-public.savedquery.md) | |
| [SavedQueryService](./kibana-plugin-plugins-data-public.savedqueryservice.md) | |
| [SearchSourceFields](./kibana-plugin-plugins-data-public.searchsourcefields.md) | |
| [SearchStrategyProvider](./kibana-plugin-plugins-data-public.searchstrategyprovider.md) | |
| [TabbedAggColumn](./kibana-plugin-plugins-data-public.tabbedaggcolumn.md) | \* |
| [TabbedTable](./kibana-plugin-plugins-data-public.tabbedtable.md) | \* |
| [TimeRange](./kibana-plugin-plugins-data-public.timerange.md) | |
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

15 changes: 12 additions & 3 deletions docs/user/alerting/action-types.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,23 @@ a| <<webhook-action-type, Webhook>>

[NOTE]
==============================================
Some action types are paid commercial features, while others are free.
For a comparison of the Elastic subscription levels,
see https://www.elastic.co/subscriptions[the subscription page].
Some action types are paid commercial features, while others are free.
For a comparison of the Elastic subscription levels,
see https://www.elastic.co/subscriptions[the subscription page].
==============================================

[float]
[[create-connectors]]
=== Connectors

You can create connectors for actions in <<managing-alerts-and-actions, Alerts and Actions>> or via the action API.
For out-of-the-box and standardized connectors, you can <<pre-configured-connectors, preconfigure connectors>>
before {kib} starts.

include::action-types/email.asciidoc[]
include::action-types/index.asciidoc[]
include::action-types/pagerduty.asciidoc[]
include::action-types/server-log.asciidoc[]
include::action-types/slack.asciidoc[]
include::action-types/webhook.asciidoc[]
include::pre-configured-connectors.asciidoc[]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
88 changes: 88 additions & 0 deletions docs/user/alerting/pre-configured-connectors.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
[role="xpack"]
[[pre-configured-connectors]]

== Preconfigured connectors

You can preconfigure an action connector to have all the information it needs prior to startup
by adding it to the `kibana.yml` file.
Sensitive configuration information, such as credentials, can use the {kib} keystore.

Preconfigured connectors offer the following capabilities:

- Require no setup. Configuration and credentials needed to execute an
action are predefined, including the connector name and ID.
- Appear in all spaces because they are not saved objects.
- Cannot be edited or deleted.

[float]
[[preconfigured-connector-example]]
=== Example of a preconfigured connector

The following example shows a valid configuration 2 out-of-the box connector.

[source,console]
------------------------
xpack.actions.preconfigured:
- id: 'my-slack1' <1>
actionTypeId: .slack <2>
name: 'Slack #xyz' <3>
config: <4>
webhookUrl: 'https://hooks.slack.com/services/abcd/efgh/ijklmnopqrstuvwxyz'
- id: 'webhook-service'
actionTypeId: .webhook
name: 'Email service'
config:
url: 'https://email-alert-service.elastic.co'
method: post
headers:
header1: value1
header2: value2
secrets: <5>
user: elastic
password: changeme
------------------------

<1> `id` is the action connector identifier.
<2> `actionTypeId` is the action type identifier.
<3> `name` is the name of the preconfigured connector.
<4> `config` is the action type specific to the configuration.
<5> `secrets` is sensitive configuration, such as username, password, and keys.

[NOTE]
==============================================
Sensitive properties, such as passwords, can also be stored in the {kib} keystore.
==============================================

[float]
[[pre-configured-connector-alert-form]]
=== Creating an alert with a preconfigured connector

When attaching an action to an alert,
select from a list of available action types, and
then select the Slack or Webhook type. Those action types were configured previously.
The preconfigured connector is installed and is automatically selected.

[role="screenshot"]
image::images/alert-pre-configured-slack-connector.png[Create alert with selected Slack action type]

The dropdown is populated with additional preconfigured Slack connectors.
The `preconfigured` label distinguishes them from space-aware connectors that use saved objects.

[role="screenshot"]
image::images/alert-pre-configured-connectors-dropdown.png[Dropdown list with pre-cofigured connectors]

[float]
[[managing-pre-configured-connectors]]
=== Managing preconfigured connectors

Preconfigured connectors appear in the connector list, regardless of which space the user is in.
They are tagged as “preconfigured” and cannot be deleted.

[role="screenshot"]
image::images/pre-configured-connectors-managing.png[Connectors managing tab with pre-cofigured]

Clicking on a preconfigured connector shows the description, but not any of the configuration.
A message indicates that this is a preconfigured connector.

[role="screenshot"]
image::images/pre-configured-connectors-view-screen.png[Pre-configured connector view details]
1 change: 1 addition & 0 deletions packages/kbn-config-schema/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ import {
export { ObjectType, TypeOf, Type };
export { ByteSizeValue } from './byte_size_value';
export { SchemaTypeError, ValidationError } from './errors';
export { isConfigSchema } from './typeguards';

function any(options?: TypeOptions<any>) {
return new AnyType(options);
Expand Down
20 changes: 20 additions & 0 deletions packages/kbn-config-schema/src/typeguards/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

export { isConfigSchema } from './is_config_schema';
56 changes: 56 additions & 0 deletions packages/kbn-config-schema/src/typeguards/is_config_schema.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { schema } from '..';
import { isConfigSchema } from './is_config_schema';

describe('isConfigSchema', () => {
it('returns true for every sub classes of `Type`', () => {
expect(isConfigSchema(schema.any())).toBe(true);
expect(isConfigSchema(schema.arrayOf(schema.string()))).toBe(true);
expect(isConfigSchema(schema.boolean())).toBe(true);
expect(isConfigSchema(schema.buffer())).toBe(true);
expect(isConfigSchema(schema.byteSize())).toBe(true);
expect(isConfigSchema(schema.duration())).toBe(true);
expect(isConfigSchema(schema.literal(''))).toBe(true);
expect(isConfigSchema(schema.mapOf(schema.string(), schema.number()))).toBe(true);
expect(isConfigSchema(schema.nullable(schema.string()))).toBe(true);
expect(isConfigSchema(schema.number())).toBe(true);
expect(isConfigSchema(schema.object({}))).toBe(true);
expect(isConfigSchema(schema.oneOf([schema.string()]))).toBe(true);
expect(isConfigSchema(schema.recordOf(schema.string(), schema.object({})))).toBe(true);
expect(isConfigSchema(schema.string())).toBe(true);
expect(isConfigSchema(schema.stream())).toBe(true);
});

it('returns false for every javascript data type', () => {
expect(isConfigSchema('foo')).toBe(false);
expect(isConfigSchema(42)).toBe(false);
expect(isConfigSchema(new Date())).toBe(false);
expect(isConfigSchema(null)).toBe(false);
expect(isConfigSchema(undefined)).toBe(false);
expect(isConfigSchema([1, 2, 3])).toBe(false);
expect(isConfigSchema({ foo: 'bar' })).toBe(false);
expect(isConfigSchema(function() {})).toBe(false);
});

it('returns true as long as `__isKbnConfigSchemaType` is true', () => {
expect(isConfigSchema({ __isKbnConfigSchemaType: true })).toBe(true);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
* under the License.
*/

export { SearchError, getSearchErrorType } from './search_error';
import { Type } from '../types';

export { SearchStrategyProvider, SearchStrategySearchParams } from './types';

export { defaultSearchStrategy } from './default_search_strategy';
export function isConfigSchema(obj: any): obj is Type<any> {
return obj ? obj.__isKbnConfigSchemaType === true : false;
}
3 changes: 3 additions & 0 deletions packages/kbn-config-schema/src/types/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ export abstract class Type<V> {
// sets the value to `null` while still keeping the type.
public readonly type: V = null! as V;

// used for the `isConfigSchema` typeguard
public readonly __isKbnConfigSchemaType = true;

/**
* Internal "schema" backed by Joi.
* @type {Schema}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ describe('OptimizerConfig::parseOptions()', () => {
<absolute path>/x-pack/plugins,
<absolute path>/plugins,
<absolute path>/examples,
<absolute path>/x-pack/examples,
<absolute path>-extra,
],
"profileWebpack": false,
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-optimizer/src/optimizer/optimizer_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,14 @@ export class OptimizerConfig {

/**
* BEWARE: this needs to stay roughly synchronized with
* `src/core/server/config/env.ts` which determins which paths
* `src/core/server/config/env.ts` which determines which paths
* should be searched for plugins to load
*/
const pluginScanDirs = options.pluginScanDirs || [
Path.resolve(repoRoot, 'src/plugins'),
...(oss ? [] : [Path.resolve(repoRoot, 'x-pack/plugins')]),
Path.resolve(repoRoot, 'plugins'),
...(examples ? [Path.resolve('examples')] : []),
...(examples ? [Path.resolve('examples'), Path.resolve('x-pack/examples')] : []),
Path.resolve(repoRoot, '../kibana-extra'),
];
if (!pluginScanDirs.every(p => Path.isAbsolute(p))) {
Expand Down
2 changes: 1 addition & 1 deletion src/cli/cluster/cluster_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ export class ClusterManager {
...pluginInternalDirsIgnore,
fromRoot('src/legacy/server/sass/__tmp__'),
fromRoot('x-pack/legacy/plugins/reporting/.chromium'),
fromRoot('x-pack/legacy/plugins/siem/cypress'),
fromRoot('x-pack/plugins/siem/cypress'),
fromRoot('x-pack/legacy/plugins/apm/e2e'),
fromRoot('x-pack/legacy/plugins/apm/scripts'),
fromRoot('x-pack/legacy/plugins/canvas/canvas_plugin_src'), // prevents server from restarting twice for Canvas plugin changes,
Expand Down
Loading

0 comments on commit 223c3eb

Please sign in to comment.