Skip to content

Commit 5ff9202

Browse files
Merge branch 'master' of https://github.com/elastic/kibana into watcher/new_page_layout
2 parents 79cb5cc + d3c1f7c commit 5ff9202

108 files changed

Lines changed: 2182 additions & 336 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.ci/end2end.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ pipeline {
1313
BASE_DIR = 'src/github.com/elastic/kibana'
1414
HOME = "${env.WORKSPACE}"
1515
E2E_DIR = 'x-pack/plugins/apm/e2e'
16-
PIPELINE_LOG_LEVEL = 'DEBUG'
16+
PIPELINE_LOG_LEVEL = 'INFO'
1717
KBN_OPTIMIZER_THEMES = 'v7light'
1818
}
1919
options {
2020
timeout(time: 1, unit: 'HOURS')
21-
buildDiscarder(logRotator(numToKeepStr: '40', artifactNumToKeepStr: '20', daysToKeepStr: '30'))
21+
buildDiscarder(logRotator(numToKeepStr: '30', artifactNumToKeepStr: '10', daysToKeepStr: '30'))
2222
timestamps()
2323
ansiColor('xterm')
2424
disableResume()

docs/development/plugins/expressions/public/kibana-plugin-plugins-expressions-public.expressionfunctiondefinitions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export interface ExpressionFunctionDefinitions
2121
| [derivative](./kibana-plugin-plugins-expressions-public.expressionfunctiondefinitions.derivative.md) | <code>ExpressionFunctionDerivative</code> | |
2222
| [font](./kibana-plugin-plugins-expressions-public.expressionfunctiondefinitions.font.md) | <code>ExpressionFunctionFont</code> | |
2323
| [moving\_average](./kibana-plugin-plugins-expressions-public.expressionfunctiondefinitions.moving_average.md) | <code>ExpressionFunctionMovingAverage</code> | |
24+
| [overall\_metric](./kibana-plugin-plugins-expressions-public.expressionfunctiondefinitions.overall_metric.md) | <code>ExpressionFunctionOverallMetric</code> | |
2425
| [theme](./kibana-plugin-plugins-expressions-public.expressionfunctiondefinitions.theme.md) | <code>ExpressionFunctionTheme</code> | |
2526
| [var\_set](./kibana-plugin-plugins-expressions-public.expressionfunctiondefinitions.var_set.md) | <code>ExpressionFunctionVarSet</code> | |
2627
| [var](./kibana-plugin-plugins-expressions-public.expressionfunctiondefinitions.var.md) | <code>ExpressionFunctionVar</code> | |
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-plugins-expressions-public](./kibana-plugin-plugins-expressions-public.md) &gt; [ExpressionFunctionDefinitions](./kibana-plugin-plugins-expressions-public.expressionfunctiondefinitions.md) &gt; [overall\_metric](./kibana-plugin-plugins-expressions-public.expressionfunctiondefinitions.overall_metric.md)
4+
5+
## ExpressionFunctionDefinitions.overall\_metric property
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
overall_metric: ExpressionFunctionOverallMetric;
11+
```

docs/development/plugins/expressions/server/kibana-plugin-plugins-expressions-server.expressionfunctiondefinitions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export interface ExpressionFunctionDefinitions
2121
| [derivative](./kibana-plugin-plugins-expressions-server.expressionfunctiondefinitions.derivative.md) | <code>ExpressionFunctionDerivative</code> | |
2222
| [font](./kibana-plugin-plugins-expressions-server.expressionfunctiondefinitions.font.md) | <code>ExpressionFunctionFont</code> | |
2323
| [moving\_average](./kibana-plugin-plugins-expressions-server.expressionfunctiondefinitions.moving_average.md) | <code>ExpressionFunctionMovingAverage</code> | |
24+
| [overall\_metric](./kibana-plugin-plugins-expressions-server.expressionfunctiondefinitions.overall_metric.md) | <code>ExpressionFunctionOverallMetric</code> | |
2425
| [theme](./kibana-plugin-plugins-expressions-server.expressionfunctiondefinitions.theme.md) | <code>ExpressionFunctionTheme</code> | |
2526
| [var\_set](./kibana-plugin-plugins-expressions-server.expressionfunctiondefinitions.var_set.md) | <code>ExpressionFunctionVarSet</code> | |
2627
| [var](./kibana-plugin-plugins-expressions-server.expressionfunctiondefinitions.var.md) | <code>ExpressionFunctionVar</code> | |
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-plugins-expressions-server](./kibana-plugin-plugins-expressions-server.md) &gt; [ExpressionFunctionDefinitions](./kibana-plugin-plugins-expressions-server.expressionfunctiondefinitions.md) &gt; [overall\_metric](./kibana-plugin-plugins-expressions-server.expressionfunctiondefinitions.overall_metric.md)
4+
5+
## ExpressionFunctionDefinitions.overall\_metric property
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
overall_metric: ExpressionFunctionOverallMetric;
11+
```

docs/user/production-considerations/production.asciidoc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,6 @@ active in case of failure from the currently used instance.
122122
Kibana can be configured to connect to multiple Elasticsearch nodes in the same cluster. In situations where a node becomes unavailable,
123123
Kibana will transparently connect to an available node and continue operating. Requests to available hosts will be routed in a round robin fashion.
124124

125-
Currently the Console application is limited to connecting to the first node listed.
126-
127125
In kibana.yml:
128126
[source,js]
129127
--------

src/dev/typescript/build_ts_refs.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,20 @@ import { ToolingLog, REPO_ROOT } from '@kbn/dev-utils';
1313

1414
export const REF_CONFIG_PATHS = [Path.resolve(REPO_ROOT, 'tsconfig.refs.json')];
1515

16-
export async function buildAllTsRefs(log: ToolingLog) {
16+
export async function buildAllTsRefs(log: ToolingLog): Promise<{ failed: boolean }> {
1717
for (const path of REF_CONFIG_PATHS) {
1818
const relative = Path.relative(REPO_ROOT, path);
1919
log.debug(`Building TypeScript projects refs for ${relative}...`);
20-
await execa(require.resolve('typescript/bin/tsc'), ['-b', relative, '--pretty'], {
21-
cwd: REPO_ROOT,
22-
});
20+
const { failed, stdout } = await execa(
21+
require.resolve('typescript/bin/tsc'),
22+
['-b', relative, '--pretty'],
23+
{
24+
cwd: REPO_ROOT,
25+
reject: false,
26+
}
27+
);
28+
log.info(stdout);
29+
if (failed) return { failed };
2330
}
31+
return { failed: false };
2432
}

src/dev/typescript/run_type_check_cli.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ export async function runTypeCheckCli() {
6969
process.exit();
7070
}
7171

72-
await buildAllTsRefs(log);
72+
const { failed } = await buildAllTsRefs(log);
73+
if (failed) {
74+
log.error('Unable to build TS project refs');
75+
process.exit(1);
76+
}
7377

7478
const tscArgs = [
7579
// composite project cannot be used with --noEmit

src/plugins/data/common/search/aggs/buckets/_terms_other_bucket_helper.test.ts

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,57 @@ const nestedTermResponse = {
174174
status: 200,
175175
};
176176

177+
const exhaustiveNestedTermResponse = {
178+
took: 10,
179+
timed_out: false,
180+
_shards: {
181+
total: 1,
182+
successful: 1,
183+
skipped: 0,
184+
failed: 0,
185+
},
186+
hits: {
187+
total: 14005,
188+
max_score: 0,
189+
hits: [],
190+
},
191+
aggregations: {
192+
'1': {
193+
doc_count_error_upper_bound: 0,
194+
sum_other_doc_count: 8325,
195+
buckets: [
196+
{
197+
'2': {
198+
doc_count_error_upper_bound: 0,
199+
sum_other_doc_count: 0,
200+
buckets: [
201+
{ key: 'ios', doc_count: 2850 },
202+
{ key: 'win xp', doc_count: 2830 },
203+
{ key: '__missing__', doc_count: 1430 },
204+
],
205+
},
206+
key: 'US-with-dash',
207+
doc_count: 2850,
208+
},
209+
{
210+
'2': {
211+
doc_count_error_upper_bound: 0,
212+
sum_other_doc_count: 0,
213+
buckets: [
214+
{ key: 'ios', doc_count: 1850 },
215+
{ key: 'win xp', doc_count: 1830 },
216+
{ key: '__missing__', doc_count: 130 },
217+
],
218+
},
219+
key: 'IN-with-dash',
220+
doc_count: 2830,
221+
},
222+
],
223+
},
224+
},
225+
status: 200,
226+
};
227+
177228
const nestedTermResponseNoResults = {
178229
took: 10,
179230
timed_out: false,
@@ -326,6 +377,17 @@ describe('Terms Agg Other bucket helper', () => {
326377
}
327378
});
328379

380+
test('does not build query if sum_other_doc_count is 0 (exhaustive terms)', () => {
381+
const aggConfigs = getAggConfigs(nestedTerm.aggs);
382+
expect(
383+
buildOtherBucketAgg(
384+
aggConfigs,
385+
aggConfigs.aggs[1] as IBucketAggConfig,
386+
exhaustiveNestedTermResponse
387+
)
388+
).toBeFalsy();
389+
});
390+
329391
test('excludes exists filter for scripted fields', () => {
330392
const aggConfigs = getAggConfigs(nestedTerm.aggs);
331393
aggConfigs.aggs[1].params.field.scripted = true;

src/plugins/data/common/search/aggs/buckets/_terms_other_bucket_helper.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ export const buildOtherBucketAgg = (
156156
};
157157

158158
let noAggBucketResults = false;
159+
let exhaustiveBuckets = true;
159160

160161
// recursively create filters for all parent aggregation buckets
161162
const walkBucketTree = (
@@ -175,6 +176,9 @@ export const buildOtherBucketAgg = (
175176
const newAggIndex = aggIndex + 1;
176177
const newAgg = bucketAggs[newAggIndex];
177178
const currentAgg = bucketAggs[aggIndex];
179+
if (aggIndex === index && agg && agg.sum_other_doc_count > 0) {
180+
exhaustiveBuckets = false;
181+
}
178182
if (aggIndex < index) {
179183
each(agg.buckets, (bucket: any, bucketObjKey) => {
180184
const bucketKey = currentAgg.getKey(
@@ -223,7 +227,7 @@ export const buildOtherBucketAgg = (
223227
walkBucketTree(0, response.aggregations, bucketAggs[0].id, [], '');
224228

225229
// bail if there were no bucket results
226-
if (noAggBucketResults) {
230+
if (noAggBucketResults || exhaustiveBuckets) {
227231
return false;
228232
}
229233

0 commit comments

Comments
 (0)