Skip to content

Commit

Permalink
Merge branch 'master' into disabling-ml-if-license-feature-is-disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Jul 29, 2020
2 parents 1325893 + 1cb177f commit 59cea0a
Show file tree
Hide file tree
Showing 588 changed files with 15,500 additions and 10,716 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))
}
}
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ kibanaPipeline(timeoutMinutes: 155, checkPrChanges: true, setCommitStatus: true)
'xpack-accessibility': kibanaPipeline.functionalTestProcess('xpack-accessibility', './test/scripts/jenkins_xpack_accessibility.sh'),
'xpack-savedObjectsFieldMetrics': kibanaPipeline.functionalTestProcess('xpack-savedObjectsFieldMetrics', './test/scripts/jenkins_xpack_saved_objects_field_metrics.sh'),
'xpack-securitySolutionCypress': { processNumber ->
whenChanged(['x-pack/plugins/security_solution/', 'x-pack/test/security_solution_cypress/']) {
whenChanged(['x-pack/plugins/security_solution/', 'x-pack/test/security_solution_cypress/', 'x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/', 'x-pack/plugins/triggers_actions_ui/public/application/context/actions_connectors_context.tsx']) {
kibanaPipeline.functionalTestProcess('xpack-securitySolutionCypress', './test/scripts/jenkins_security_solution_cypress.sh')(processNumber)
}
},
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;
```
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; [\_routing](./kibana-plugin-core-server.getresponse._routing.md)

## GetResponse.\_routing property

<b>Signature:</b>

```typescript
_routing?: 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; [\_seq\_no](./kibana-plugin-core-server.getresponse._seq_no.md)

## GetResponse.\_seq\_no property

<b>Signature:</b>

```typescript
_seq_no: number;
```
Loading

0 comments on commit 59cea0a

Please sign in to comment.