Skip to content

Commit

Permalink
Merge branch '7.x' into backport/7.x/pr-65658
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored May 8, 2020
2 parents 4c27798 + d516c64 commit 421fefb
Show file tree
Hide file tree
Showing 172 changed files with 2,854 additions and 1,088 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ module.exports = {
files: ['x-pack/plugins/lens/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
'react-hooks/rules-of-hooks': 'off',
},
},
{
Expand Down
7 changes: 7 additions & 0 deletions docs/migration/migrate_7_2.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ your application to Kibana 7.2.

See also <<release-highlights-7.2.0, release highlights>> and <<release-notes-7.2.0, release notes>>.

//NOTE: The notable-breaking-changes tagged regions are re-used in the
//Installation and Upgrade Guide

//tag::notable-breaking-changes[]

// end::notable-breaking-changes[]

[float]
[[breaking_72_index_pattern_changes]]

Expand Down
1 change: 1 addition & 0 deletions docs/migration/migrate_7_5.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ Any installs that previously enabled the Code app will now log a warning when
Kibana starts up. It's safe to remove all configurations starting with
`xpack.code.`. Starting in 8.0, these warnings will become errors that prevent
Kibana from starting up.
// end::notable-breaking-changes[]
5 changes: 5 additions & 0 deletions docs/migration/migrate_7_6.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ your application to Kibana 7.6.
* <<user-facing-changes, Breaking changes for users>>
* <<general-plugin-API-changes, Breaking changes for plugin developers>>

// The following section is re-used in the Installation and Upgrade Guide
//tag::notable-breaking-changes[]

// end::notable-breaking-changes[]

[float]
[[user-facing-changes]]
=== Breaking changes for users
Expand Down
12 changes: 4 additions & 8 deletions docs/migration/migrate_7_7.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,10 @@
This page discusses the breaking changes that you need to be aware of when migrating
your application to Kibana 7.7.

//NOTE: The notable-breaking-changes tagged regions are re-used in the
//Installation and Upgrade Guide

////
The following section is re-used in the Installation and Upgrade Guide
[[breaking_70_notable]]
=== Notable breaking changes
////
// The following section is re-used in the Installation and Upgrade Guide
// tag::notable-breaking-changes[]

// end::notable-breaking-changes[]

[float]
=== Breaking changes for users
Expand Down
22 changes: 11 additions & 11 deletions docs/user/alerting/action-types/email.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ Password:: password for 'login' type authentication.

[source,text]
--
id: 'my-email'
name: preconfigured-email-action-type
actionTypeId: .email
config:
from: testsender@test.com <1.1>
host: validhostname <1.2>
port: 8080 <1.3>
secure: false <1.4>
secrets:
user: testuser <2.1>
password: passwordkeystorevalue <2.2>
my-email:
name: preconfigured-email-action-type
actionTypeId: .email
config:
from: testsender@test.com <1.1>
host: validhostname <1.2>
port: 8080 <1.3>
secure: false <1.4>
secrets:
user: testuser <2.1>
password: passwordkeystorevalue <2.2>
--

`config` defines the action type specific to the configuration and contains the following properties:
Expand Down
14 changes: 7 additions & 7 deletions docs/user/alerting/action-types/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ Execution time field:: This field will be automatically set to the time the ale

[source,text]
--
id: 'my-index'
name: action-type-index
actionTypeId: .index
config:
index: .kibana <1>
refresh: true <2>
executionTimeField: somedate <3>
my-index:
name: action-type-index
actionTypeId: .index
config:
index: .kibana <1>
refresh: true <2>
executionTimeField: somedate <3>
--

`config` defines the action type specific to the configuration and contains the following properties:
Expand Down
14 changes: 7 additions & 7 deletions docs/user/alerting/action-types/pagerduty.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,13 @@ Integration Key:: A 32 character PagerDuty Integration Key for an integration

[source,text]
--
id: 'my-pagerduty'
name: preconfigured-pagerduty-action-type
actionTypeId: .pagerduty
config:
apiUrl: https://test.host <1.1>
secrets:
routingKey: testroutingkey <2.1>
my-pagerduty:
name: preconfigured-pagerduty-action-type
actionTypeId: .pagerduty
config:
apiUrl: https://test.host <1.1>
secrets:
routingKey: testroutingkey <2.1>
--

`config` defines the action type specific to the configuration and contains the following properties:
Expand Down
6 changes: 3 additions & 3 deletions docs/user/alerting/action-types/server-log.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ Name:: The name of the connector. The name is used to identify a connector

[source,text]
--
id: 'my-server-log'
name: test
actionTypeId: .server-log
my-server-log:
name: test
actionTypeId: .server-log
--

[float]
Expand Down
10 changes: 5 additions & 5 deletions docs/user/alerting/action-types/slack.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ Webhook URL:: The URL of the incoming webhook. See https://api.slack.com/messa

[source,text]
--
id: 'my-slack'
name: preconfigured-slack-action-type
actionTypeId: .slack
config:
webhookUrl: 'https://hooks.slack.com/services/abcd/efgh/ijklmnopqrstuvwxyz' <1>
my-slack:
name: preconfigured-slack-action-type
actionTypeId: .slack
config:
webhookUrl: 'https://hooks.slack.com/services/abcd/efgh/ijklmnopqrstuvwxyz' <1>
--

`config` defines the action type specific to the configuration and contains the following properties:
Expand Down
22 changes: 11 additions & 11 deletions docs/user/alerting/action-types/webhook.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ Password:: An optional password. If set, HTTP basic authentication is used. Cur

[source,text]
--
id: 'my-webhook'
name: preconfigured-webhook-action-type
actionTypeId: .webhook
config:
url: https://test.host <1.1>
method: POST <1.2>
headers: <1.3>
testheader: testvalue
secrets:
user: testuser <2.1>
password: passwordkeystorevalue <2.2>
my-webhook:
name: preconfigured-webhook-action-type
actionTypeId: .webhook
config:
url: https://test.host <1.1>
method: POST <1.2>
headers: <1.3>
testheader: testvalue
secrets:
user: testuser <2.1>
password: passwordkeystorevalue <2.2>
--

`config` defines the action type specific to the configuration and contains the following properties:
Expand Down
8 changes: 4 additions & 4 deletions docs/user/alerting/pre-configured-connectors.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ The following example shows a valid configuration of two out-of-the box connecto

```js
xpack.actions.preconfigured:
- id: 'my-slack1' <1>
my-slack1: <1>
actionTypeId: .slack <2>
name: 'Slack #xyz' <3>
config: <4>
webhookUrl: 'https://hooks.slack.com/services/abcd/efgh/ijklmnopqrstuvwxyz'
- id: 'webhook-service'
webhook-service:
actionTypeId: .webhook
name: 'Email service'
config:
Expand All @@ -44,7 +44,7 @@ The following example shows a valid configuration of two out-of-the box connecto
password: changeme
```

<1> `id` is the action connector identifier.
<1> the key is the action connector identifier, eg `my-slack1` in this example.
<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.
Expand All @@ -69,7 +69,7 @@ The following example shows a valid configuration of preconfigured action type w
```js
xpack.actions.enabledActionTypes: ['.slack', '.email', '.index'] <1>
xpack.actions.preconfigured: <2>
- id: 'my-server-log'
my-server-log:
actionTypeId: .server-log
name: 'Server log #xyz'
```
Expand Down
50 changes: 50 additions & 0 deletions packages/kbn-dev-utils/src/precommit_hook/cli.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* 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 Path from 'path';
import { chmod, writeFile } from 'fs';
import { promisify } from 'util';

import { run } from '../run';
import { REPO_ROOT } from '../repo_root';
import { SCRIPT_SOURCE } from './script_source';
import { getGitDir } from './get_git_dir';

const chmodAsync = promisify(chmod);
const writeFileAsync = promisify(writeFile);

run(
async ({ log }) => {
try {
const gitDir = await getGitDir();
const installPath = Path.resolve(REPO_ROOT, gitDir, 'hooks/pre-commit');

log.info(`Registering Kibana pre-commit git hook...`);
await writeFileAsync(installPath, SCRIPT_SOURCE);
await chmodAsync(installPath, 0o755);
log.success(`Kibana pre-commit git hook was installed successfully.`);
} catch (e) {
log.error(`Kibana pre-commit git hook was not installed as an error occur.`);
throw e;
}
},
{
description: 'Register git hooks in the local repo',
}
);
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,16 @@
* under the License.
*/

export { registerPrecommitGitHook } from './register_git_hook';
import execa from 'execa';

import { REPO_ROOT } from '../repo_root';

// Retrieves the correct location for the .git dir for
// every git setup (including git worktree)
export async function getGitDir() {
return (
await execa('git', ['rev-parse', '--git-common-dir'], {
cwd: REPO_ROOT,
})
).stdout.trim();
}
Loading

0 comments on commit 421fefb

Please sign in to comment.