Skip to content

Commit

Permalink
Merge branch 'master' into lens-heatmap-chart
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Jun 3, 2021
2 parents feb2b45 + 4e5652d commit 3a4443f
Show file tree
Hide file tree
Showing 352 changed files with 8,030 additions and 2,645 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@
#CC# /x-pack/plugins/security_solution/ @elastic/security-solution

# Security Solution sub teams
/x-pack/plugins/case @elastic/security-threat-hunting
/x-pack/plugins/cases @elastic/security-threat-hunting
/x-pack/plugins/timelines @elastic/security-threat-hunting
/x-pack/test/case_api_integration @elastic/security-threat-hunting
/x-pack/plugins/lists @elastic/security-detections-response
Expand Down
8 changes: 3 additions & 5 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,16 @@ Delete any items that are not applicable to this PR.

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature release.
Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.

When forming the risk matrix, consider some of the following examples and how
they may potentially impact the change:
When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:

| Risk | Probability | Severity | Mitigation/Notes |
|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces—unexpected behavior in non-default Kibana Space. | Low | High | Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces. |
| Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. | High | Low | Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure. |
| Code should gracefully handle cases when feature X or plugin Y are disabled. | Medium | High | Unit tests will verify that any feature flag or plugin combination still results in our service operational. |
| [See more potential risk examples](../RISK_MATRIX.mdx) |
| [See more potential risk examples](https://github.com/elastic/kibana/blob/master/RISK_MATRIX.mdx) |


### For maintainers
Expand Down
13 changes: 11 additions & 2 deletions docs/developer/getting-started/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@ In order to support Windows development we currently require you to use one of t

As well as installing https://www.microsoft.com/en-us/download/details.aspx?id=48145[Visual C++ Redistributable for Visual Studio 2015].

In addition we also require you to do the following:

- Install https://www.microsoft.com/en-us/download/details.aspx?id=48145[Visual C++ Redistributable for Visual Studio 2015]
- Enable the https://docs.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-development[Windows Developer Mode]
- Enable https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/fsutil-8dot3name[8.3 filename support] by running the following command in a windows command prompt with admin rights `fsutil 8dot3name set 0`

Before running the steps listed below, please make sure you have installed everything
that we require and listed above and that you are running the mentioned commands
through Git bash or WSL.
that we require and listed above and that you are running all the commands from now on through Git bash or WSL.

[discrete]
[[get-kibana-code]]
Expand Down Expand Up @@ -92,6 +97,10 @@ may need to run:
yarn kbn clean
----

NOTE: Running this command is only necessary in rare circumstance where you need to recover
a consistent state when problems arise. If you need to run this command often, complete
this form to provide feedback: https://ela.st/yarn-kbn-clean

If you have failures during `yarn kbn bootstrap` you may have some
corrupted packages in your yarn cache which you can clean with:

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

[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [AggConfig](./kibana-plugin-plugins-data-public.aggconfig.md) &gt; [getTimeShift](./kibana-plugin-plugins-data-public.aggconfig.gettimeshift.md)

## AggConfig.getTimeShift() method

<b>Signature:</b>

```typescript
getTimeShift(): undefined | moment.Duration;
```
<b>Returns:</b>

`undefined | moment.Duration`

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

[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [AggConfig](./kibana-plugin-plugins-data-public.aggconfig.md) &gt; [hasTimeShift](./kibana-plugin-plugins-data-public.aggconfig.hastimeshift.md)

## AggConfig.hasTimeShift() method

<b>Signature:</b>

```typescript
hasTimeShift(): boolean;
```
<b>Returns:</b>

`boolean`

Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ export declare class AggConfig
| [getRequestAggs()](./kibana-plugin-plugins-data-public.aggconfig.getrequestaggs.md) | | |
| [getResponseAggs()](./kibana-plugin-plugins-data-public.aggconfig.getresponseaggs.md) | | |
| [getTimeRange()](./kibana-plugin-plugins-data-public.aggconfig.gettimerange.md) | | |
| [getTimeShift()](./kibana-plugin-plugins-data-public.aggconfig.gettimeshift.md) | | |
| [getValue(bucket)](./kibana-plugin-plugins-data-public.aggconfig.getvalue.md) | | |
| [getValueBucketPath()](./kibana-plugin-plugins-data-public.aggconfig.getvaluebucketpath.md) | | Returns the bucket path containing the main value the agg will produce (e.g. for sum of bytes it will point to the sum, for median it will point to the 50 percentile in the percentile multi value bucket) |
| [hasTimeShift()](./kibana-plugin-plugins-data-public.aggconfig.hastimeshift.md) | | |
| [isFilterable()](./kibana-plugin-plugins-data-public.aggconfig.isfilterable.md) | | |
| [makeLabel(percentageMode)](./kibana-plugin-plugins-data-public.aggconfig.makelabel.md) | | |
| [nextId(list)](./kibana-plugin-plugins-data-public.aggconfig.nextid.md) | <code>static</code> | Calculate the next id based on the ids in this list {<!-- -->array<!-- -->} list - a list of objects with id properties |
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-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [AggConfigs](./kibana-plugin-plugins-data-public.aggconfigs.md) &gt; [forceNow](./kibana-plugin-plugins-data-public.aggconfigs.forcenow.md)

## AggConfigs.forceNow property

<b>Signature:</b>

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

[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [AggConfigs](./kibana-plugin-plugins-data-public.aggconfigs.md) &gt; [getSearchSourceTimeFilter](./kibana-plugin-plugins-data-public.aggconfigs.getsearchsourcetimefilter.md)

## AggConfigs.getSearchSourceTimeFilter() method

<b>Signature:</b>

```typescript
getSearchSourceTimeFilter(forceNow?: Date): RangeFilter[] | {
meta: {
index: string | undefined;
params: {};
alias: string;
disabled: boolean;
negate: boolean;
};
query: {
bool: {
should: {
bool: {
filter: {
range: {
[x: string]: {
gte: string;
lte: string;
};
};
}[];
};
}[];
minimum_should_match: number;
};
};
}[];
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| forceNow | <code>Date</code> | |

<b>Returns:</b>

`RangeFilter[] | {
meta: {
index: string | undefined;
params: {};
alias: string;
disabled: boolean;
negate: boolean;
};
query: {
bool: {
should: {
bool: {
filter: {
range: {
[x: string]: {
gte: string;
lte: string;
};
};
}[];
};
}[];
minimum_should_match: number;
};
};
}[]`

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

[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [AggConfigs](./kibana-plugin-plugins-data-public.aggconfigs.md) &gt; [getTimeShiftInterval](./kibana-plugin-plugins-data-public.aggconfigs.gettimeshiftinterval.md)

## AggConfigs.getTimeShiftInterval() method

<b>Signature:</b>

```typescript
getTimeShiftInterval(): moment.Duration | undefined;
```
<b>Returns:</b>

`moment.Duration | undefined`

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

[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [AggConfigs](./kibana-plugin-plugins-data-public.aggconfigs.md) &gt; [getTimeShifts](./kibana-plugin-plugins-data-public.aggconfigs.gettimeshifts.md)

## AggConfigs.getTimeShifts() method

<b>Signature:</b>

```typescript
getTimeShifts(): Record<string, moment.Duration>;
```
<b>Returns:</b>

`Record<string, moment.Duration>`

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

[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [AggConfigs](./kibana-plugin-plugins-data-public.aggconfigs.md) &gt; [hasTimeShifts](./kibana-plugin-plugins-data-public.aggconfigs.hastimeshifts.md)

## AggConfigs.hasTimeShifts() method

<b>Signature:</b>

```typescript
hasTimeShifts(): boolean;
```
<b>Returns:</b>

`boolean`

Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export declare class AggConfigs
| --- | --- | --- | --- |
| [aggs](./kibana-plugin-plugins-data-public.aggconfigs.aggs.md) | | <code>IAggConfig[]</code> | |
| [createAggConfig](./kibana-plugin-plugins-data-public.aggconfigs.createaggconfig.md) | | <code>&lt;T extends AggConfig = AggConfig&gt;(params: CreateAggConfigParams, { addToAggConfigs }?: {</code><br/><code> addToAggConfigs?: boolean &#124; undefined;</code><br/><code> }) =&gt; T</code> | |
| [forceNow](./kibana-plugin-plugins-data-public.aggconfigs.forcenow.md) | | <code>Date</code> | |
| [hierarchical](./kibana-plugin-plugins-data-public.aggconfigs.hierarchical.md) | | <code>boolean</code> | |
| [indexPattern](./kibana-plugin-plugins-data-public.aggconfigs.indexpattern.md) | | <code>IndexPattern</code> | |
| [timeFields](./kibana-plugin-plugins-data-public.aggconfigs.timefields.md) | | <code>string[]</code> | |
Expand All @@ -43,8 +44,14 @@ export declare class AggConfigs
| [getRequestAggs()](./kibana-plugin-plugins-data-public.aggconfigs.getrequestaggs.md) | | |
| [getResponseAggById(id)](./kibana-plugin-plugins-data-public.aggconfigs.getresponseaggbyid.md) | | Find a response agg by it's id. This may be an agg in the aggConfigs, or one created specifically for a response value |
| [getResponseAggs()](./kibana-plugin-plugins-data-public.aggconfigs.getresponseaggs.md) | | Gets the AggConfigs (and possibly ResponseAggConfigs) that represent the values that will be produced when all aggs are run.<!-- -->With multi-value metric aggs it is possible for a single agg request to result in multiple agg values, which is why the length of a vis' responseValuesAggs may be different than the vis' aggs {<!-- -->array\[AggConfig\]<!-- -->} |
| [getSearchSourceTimeFilter(forceNow)](./kibana-plugin-plugins-data-public.aggconfigs.getsearchsourcetimefilter.md) | | |
| [getTimeShiftInterval()](./kibana-plugin-plugins-data-public.aggconfigs.gettimeshiftinterval.md) | | |
| [getTimeShifts()](./kibana-plugin-plugins-data-public.aggconfigs.gettimeshifts.md) | | |
| [hasTimeShifts()](./kibana-plugin-plugins-data-public.aggconfigs.hastimeshifts.md) | | |
| [jsonDataEquals(aggConfigs)](./kibana-plugin-plugins-data-public.aggconfigs.jsondataequals.md) | | Data-by-data comparison of this Aggregation Ignores the non-array indexes |
| [onSearchRequestStart(searchSource, options)](./kibana-plugin-plugins-data-public.aggconfigs.onsearchrequeststart.md) | | |
| [postFlightTransform(response)](./kibana-plugin-plugins-data-public.aggconfigs.postflighttransform.md) | | |
| [setForceNow(now)](./kibana-plugin-plugins-data-public.aggconfigs.setforcenow.md) | | |
| [setTimeFields(timeFields)](./kibana-plugin-plugins-data-public.aggconfigs.settimefields.md) | | |
| [setTimeRange(timeRange)](./kibana-plugin-plugins-data-public.aggconfigs.settimerange.md) | | |
| [toDsl()](./kibana-plugin-plugins-data-public.aggconfigs.todsl.md) | | |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [AggConfigs](./kibana-plugin-plugins-data-public.aggconfigs.md) &gt; [postFlightTransform](./kibana-plugin-plugins-data-public.aggconfigs.postflighttransform.md)

## AggConfigs.postFlightTransform() method

<b>Signature:</b>

```typescript
postFlightTransform(response: IEsSearchResponse<any>): IEsSearchResponse<any>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| response | <code>IEsSearchResponse&lt;any&gt;</code> | |

<b>Returns:</b>

`IEsSearchResponse<any>`

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

[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [AggConfigs](./kibana-plugin-plugins-data-public.aggconfigs.md) &gt; [setForceNow](./kibana-plugin-plugins-data-public.aggconfigs.setforcenow.md)

## AggConfigs.setForceNow() method

<b>Signature:</b>

```typescript
setForceNow(now: Date | undefined): void;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| now | <code>Date &#124; undefined</code> | |

<b>Returns:</b>

`void`

4 changes: 1 addition & 3 deletions docs/setup/install/brew.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@ brew tap elastic/tap
-------------------------

Once you've tapped the Elastic Homebrew repo, you can use `brew install` to
install the default distribution of {kib}:
install the **latest version** of {kib}:

[source,sh]
-------------------------
brew install elastic/tap/kibana-full
-------------------------

This installs the most recently released distribution of {kib}.

[[brew-layout]]
==== Directory layout for Homebrew installs

Expand Down
4 changes: 4 additions & 0 deletions docs/setup/settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,10 @@ inactive socket. *Default: `"120000"`*
| Paths to a PEM-encoded X.509 server certificate and its corresponding private key. These
are used by {kib} to establish trust when receiving inbound SSL/TLS connections from users.

|[[server-uuid]] `server.uuid:`
| The unique identifier for this {kib} instance.


|===

[NOTE]
Expand Down
3 changes: 2 additions & 1 deletion packages/kbn-ui-shared-deps/entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ export const Theme = require('./theme.ts');
export const Lodash = require('lodash');
export const LodashFp = require('lodash/fp');

export const Fflate = require('fflate/esm/browser');
import { unzlibSync, strFromU8 } from 'fflate';
export const Fflate = { unzlibSync, strFromU8 };

// runtime deps which don't need to be copied across all bundles
export const TsLib = require('tslib');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ const setup = () => {
};
};

describe('createStreamingBatchedFunction()', () => {
// FLAKY: https://github.com/elastic/kibana/issues/101126
describe.skip('createStreamingBatchedFunction()', () => {
test('returns a function', () => {
const { fetchStreaming } = setup();
const fn = createStreamingBatchedFunction({
Expand Down
27 changes: 27 additions & 0 deletions src/plugins/data/common/search/aggs/agg_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Side Public License, v 1.
*/

import moment from 'moment';
import _ from 'lodash';
import { i18n } from '@kbn/i18n';
import { Assign, Ensure } from '@kbn/utility-types';
Expand All @@ -20,6 +21,7 @@ import {
import { IAggType } from './agg_type';
import { writeParams } from './agg_params';
import { IAggConfigs } from './agg_configs';
import { parseTimeShift } from './utils';

type State = string | number | boolean | null | undefined | SerializableState;

Expand Down Expand Up @@ -172,6 +174,31 @@ export class AggConfig {
return _.get(this.params, key);
}

hasTimeShift(): boolean {
return Boolean(this.getParam('timeShift'));
}

getTimeShift(): undefined | moment.Duration {
const rawTimeShift = this.getParam('timeShift');
if (!rawTimeShift) return undefined;
const parsedTimeShift = parseTimeShift(rawTimeShift);
if (parsedTimeShift === 'invalid') {
throw new Error(`could not parse time shift ${rawTimeShift}`);
}
if (parsedTimeShift === 'previous') {
const timeShiftInterval = this.aggConfigs.getTimeShiftInterval();
if (timeShiftInterval) {
return timeShiftInterval;
} else if (!this.aggConfigs.timeRange) {
return;
}
return moment.duration(
moment(this.aggConfigs.timeRange.to).diff(this.aggConfigs.timeRange.from)
);
}
return parsedTimeShift;
}

write(aggs?: IAggConfigs) {
return writeParams<AggConfig>(this.type.params, this, aggs);
}
Expand Down
Loading

0 comments on commit 3a4443f

Please sign in to comment.