Skip to content

Commit

Permalink
Merge branch 'master' into event-log/use-alerts-actions-clients
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Jul 30, 2020
2 parents 0ef59c3 + 2fb659a commit dcb7a21
Show file tree
Hide file tree
Showing 734 changed files with 25,120 additions and 14,088 deletions.
4 changes: 4 additions & 0 deletions .ci/pipeline-library/src/test/KibanaBasePipelineTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ class KibanaBasePipelineTest extends BasePipelineTest {
return helper.callStack.find { it.methodName == name }
}

def fnMocks(String name) {
helper.callStack.findAll { it.methodName == name }
}

void mockFailureBuild() {
props([
buildUtils: [
Expand Down
63 changes: 63 additions & 0 deletions .ci/pipeline-library/src/test/slackNotifications.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,67 @@ class SlackNotificationsTest extends KibanaBasePipelineTest {
args.blocks[2].text.text.toString()
)
}

@Test
void 'sendFailedBuild() should call slackSend() with a backup message when first attempt fails'() {
mockFailureBuild()
def counter = 0
helper.registerAllowedMethod('slackSend', [Map.class], { ++counter > 1 })
slackNotifications.sendFailedBuild()

def args = fnMocks('slackSend')[1].args[0]

def expected = [
channel: '#kibana-operations-alerts',
username: 'Kibana Operations',
iconEmoji: ':jenkins:',
color: 'danger',
message: ':broken_heart: elastic / kibana # master #1',
]

expected.each {
assertEquals(it.value.toString(), args[it.key].toString())
}

assertEquals(
":broken_heart: *<http://jenkins.localhost:8080/job/elastic+kibana+master/1/|elastic / kibana # master #1>*" +
"\n\nFirst attempt at sending this notification failed. Please check the build.",
args.blocks[0].text.text.toString()
)
}

@Test
void 'getTestFailures() should truncate list of failures to 10'() {
prop('testUtils', [
getFailures: {
return (1..12).collect {
return [
url: Mocks.TEST_FAILURE_URL,
fullDisplayName: "Failure #${it}",
]
}
},
])

def message = (String) slackNotifications.getTestFailures()

assertTrue("Message ends with truncated indicator", message.endsWith("...and 2 more"))
assertTrue("Message contains Failure #10", message.contains("Failure #10"))
assertTrue("Message does not contain Failure #11", !message.contains("Failure #11"))
}

@Test
void 'shortenMessage() should truncate a long message, but leave parts that fit'() {
assertEquals('Hello\nHello\n[...truncated...]', slackNotifications.shortenMessage('Hello\nHello\nthis is a long string', 29))
}

@Test
void 'shortenMessage() should not modify a short message'() {
assertEquals('Hello world', slackNotifications.shortenMessage('Hello world', 11))
}

@Test
void 'shortenMessage() should truncate an entire message with only one part'() {
assertEquals('[...truncated...]', slackNotifications.shortenMessage('Hello world this is a really long message', 40))
}
}
18 changes: 0 additions & 18 deletions docs/apm/error-reports-watcher.asciidoc

This file was deleted.

3 changes: 0 additions & 3 deletions docs/apm/how-to-guides.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Learn how to perform common APM app tasks.
* <<agent-configuration>>
* <<apm-alerts>>
* <<custom-links>>
* <<errors-alerts-with-watcher>>
* <<filters>>
* <<machine-learning-integration>>
* <<advanced-queries>>
Expand All @@ -21,8 +20,6 @@ include::apm-alerts.asciidoc[]

include::custom-links.asciidoc[]

include::error-reports-watcher.asciidoc[]

include::filters.asciidoc[]

include::machine-learning.asciidoc[]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [CountResponse](./kibana-plugin-core-server.countresponse.md) &gt; [\_shards](./kibana-plugin-core-server.countresponse._shards.md)

## CountResponse.\_shards property

<b>Signature:</b>

```typescript
_shards: ShardsInfo;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [CountResponse](./kibana-plugin-core-server.countresponse.md) &gt; [count](./kibana-plugin-core-server.countresponse.count.md)

## CountResponse.count property

<b>Signature:</b>

```typescript
count: number;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [CountResponse](./kibana-plugin-core-server.countresponse.md)

## CountResponse interface


<b>Signature:</b>

```typescript
export interface CountResponse
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [\_shards](./kibana-plugin-core-server.countresponse._shards.md) | <code>ShardsInfo</code> | |
| [count](./kibana-plugin-core-server.countresponse.count.md) | <code>number</code> | |

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [DeleteDocumentResponse](./kibana-plugin-core-server.deletedocumentresponse.md) &gt; [\_id](./kibana-plugin-core-server.deletedocumentresponse._id.md)

## DeleteDocumentResponse.\_id property

<b>Signature:</b>

```typescript
_id: string;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [DeleteDocumentResponse](./kibana-plugin-core-server.deletedocumentresponse.md) &gt; [\_index](./kibana-plugin-core-server.deletedocumentresponse._index.md)

## DeleteDocumentResponse.\_index property

<b>Signature:</b>

```typescript
_index: string;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [DeleteDocumentResponse](./kibana-plugin-core-server.deletedocumentresponse.md) &gt; [\_shards](./kibana-plugin-core-server.deletedocumentresponse._shards.md)

## DeleteDocumentResponse.\_shards property

<b>Signature:</b>

```typescript
_shards: ShardsResponse;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [DeleteDocumentResponse](./kibana-plugin-core-server.deletedocumentresponse.md) &gt; [\_type](./kibana-plugin-core-server.deletedocumentresponse._type.md)

## DeleteDocumentResponse.\_type property

<b>Signature:</b>

```typescript
_type: string;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [DeleteDocumentResponse](./kibana-plugin-core-server.deletedocumentresponse.md) &gt; [\_version](./kibana-plugin-core-server.deletedocumentresponse._version.md)

## DeleteDocumentResponse.\_version property

<b>Signature:</b>

```typescript
_version: number;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [DeleteDocumentResponse](./kibana-plugin-core-server.deletedocumentresponse.md) &gt; [error](./kibana-plugin-core-server.deletedocumentresponse.error.md)

## DeleteDocumentResponse.error property

<b>Signature:</b>

```typescript
error?: {
type: string;
};
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [DeleteDocumentResponse](./kibana-plugin-core-server.deletedocumentresponse.md) &gt; [found](./kibana-plugin-core-server.deletedocumentresponse.found.md)

## DeleteDocumentResponse.found property

<b>Signature:</b>

```typescript
found: boolean;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [DeleteDocumentResponse](./kibana-plugin-core-server.deletedocumentresponse.md)

## DeleteDocumentResponse interface


<b>Signature:</b>

```typescript
export interface DeleteDocumentResponse
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [\_id](./kibana-plugin-core-server.deletedocumentresponse._id.md) | <code>string</code> | |
| [\_index](./kibana-plugin-core-server.deletedocumentresponse._index.md) | <code>string</code> | |
| [\_shards](./kibana-plugin-core-server.deletedocumentresponse._shards.md) | <code>ShardsResponse</code> | |
| [\_type](./kibana-plugin-core-server.deletedocumentresponse._type.md) | <code>string</code> | |
| [\_version](./kibana-plugin-core-server.deletedocumentresponse._version.md) | <code>number</code> | |
| [error](./kibana-plugin-core-server.deletedocumentresponse.error.md) | <code>{</code><br/><code> type: string;</code><br/><code> }</code> | |
| [found](./kibana-plugin-core-server.deletedocumentresponse.found.md) | <code>boolean</code> | |
| [result](./kibana-plugin-core-server.deletedocumentresponse.result.md) | <code>string</code> | |

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [DeleteDocumentResponse](./kibana-plugin-core-server.deletedocumentresponse.md) &gt; [result](./kibana-plugin-core-server.deletedocumentresponse.result.md)

## DeleteDocumentResponse.result property

<b>Signature:</b>

```typescript
result: string;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [ElasticsearchClient](./kibana-plugin-core-server.elasticsearchclient.md)

## ElasticsearchClient type

Client used to query the elasticsearch cluster.

<b>Signature:</b>

```typescript
export declare type ElasticsearchClient = Omit<KibanaClient, 'connectionPool' | 'transport' | 'serializer' | 'extend' | 'child' | 'close'> & {
transport: {
request(params: TransportRequestParams, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse>;
};
};
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [Explanation](./kibana-plugin-core-server.explanation.md) &gt; [description](./kibana-plugin-core-server.explanation.description.md)

## Explanation.description property

<b>Signature:</b>

```typescript
description: string;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [Explanation](./kibana-plugin-core-server.explanation.md) &gt; [details](./kibana-plugin-core-server.explanation.details.md)

## Explanation.details property

<b>Signature:</b>

```typescript
details: Explanation[];
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [Explanation](./kibana-plugin-core-server.explanation.md)

## Explanation interface


<b>Signature:</b>

```typescript
export interface Explanation
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [description](./kibana-plugin-core-server.explanation.description.md) | <code>string</code> | |
| [details](./kibana-plugin-core-server.explanation.details.md) | <code>Explanation[]</code> | |
| [value](./kibana-plugin-core-server.explanation.value.md) | <code>number</code> | |

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [Explanation](./kibana-plugin-core-server.explanation.md) &gt; [value](./kibana-plugin-core-server.explanation.value.md)

## Explanation.value property

<b>Signature:</b>

```typescript
value: number;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [GetResponse](./kibana-plugin-core-server.getresponse.md) &gt; [\_id](./kibana-plugin-core-server.getresponse._id.md)

## GetResponse.\_id property

<b>Signature:</b>

```typescript
_id: string;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [GetResponse](./kibana-plugin-core-server.getresponse.md) &gt; [\_index](./kibana-plugin-core-server.getresponse._index.md)

## GetResponse.\_index property

<b>Signature:</b>

```typescript
_index: string;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [GetResponse](./kibana-plugin-core-server.getresponse.md) &gt; [\_primary\_term](./kibana-plugin-core-server.getresponse._primary_term.md)

## GetResponse.\_primary\_term property

<b>Signature:</b>

```typescript
_primary_term: number;
```
Loading

0 comments on commit dcb7a21

Please sign in to comment.