Skip to content

Commit

Permalink
Merge branch 'master' into index_patterns_to_data_views_user_content_…
Browse files Browse the repository at this point in the history
…feature_branch
  • Loading branch information
kibanamachine authored Oct 20, 2021
2 parents b2f38da + 9b3529a commit 7787e80
Show file tree
Hide file tree
Showing 241 changed files with 5,030 additions and 2,492 deletions.
11 changes: 11 additions & 0 deletions .buildkite/pipelines/pull_request/uptime.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
steps:
- command: .buildkite/scripts/steps/functional/uptime.sh
label: 'Uptime @elastic/synthetics Tests'
agents:
queue: ci-group-6
depends_on: build
timeout_in_minutes: 120
retry:
automatic:
- exit_status: '*'
limit: 1
4 changes: 4 additions & 0 deletions .buildkite/scripts/pipelines/pull_request/pipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ const uploadPipeline = (pipelineContent) => {
// pipeline.push(getPipeline('.buildkite/pipelines/pull_request/apm_cypress.yml'));
// }

if (await doAnyChangesMatch([/^x-pack\/plugins\/uptime/])) {
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/uptime.yml'));
}

pipeline.push(getPipeline('.buildkite/pipelines/pull_request/post_build.yml'));

uploadPipeline(pipeline.join('\n'));
Expand Down
2 changes: 2 additions & 0 deletions .buildkite/scripts/steps/functional/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

set -euo pipefail

# Note, changes here might also need to be made in other scripts, e.g. uptime.sh

source .buildkite/scripts/common/util.sh

.buildkite/scripts/bootstrap.sh
Expand Down
17 changes: 17 additions & 0 deletions .buildkite/scripts/steps/functional/uptime.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

set -euo pipefail

source .buildkite/scripts/common/util.sh

.buildkite/scripts/bootstrap.sh
.buildkite/scripts/download_build_artifacts.sh

export JOB=kibana-uptime-playwright

echo "--- Uptime @elastic/synthetics Tests"

cd "$XPACK_DIR"

checks-reporter-with-killswitch "Uptime @elastic/synthetics Tests" \
node plugins/uptime/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION"
12 changes: 6 additions & 6 deletions api_docs/security_solution.json
Original file line number Diff line number Diff line change
Expand Up @@ -772,17 +772,17 @@
"interfaces": [
{
"parentPluginId": "securitySolution",
"id": "def-server.AppRequestContext",
"id": "def-server.SecuritySolutionApiRequestHandlerContext",
"type": "Interface",
"tags": [],
"label": "AppRequestContext",
"label": "SecuritySolutionApiRequestHandlerContext",
"description": [],
"path": "x-pack/plugins/security_solution/server/types.ts",
"deprecated": false,
"children": [
{
"parentPluginId": "securitySolution",
"id": "def-server.AppRequestContext.getAppClient",
"id": "def-server.SecuritySolutionApiRequestHandlerContext.getAppClient",
"type": "Function",
"tags": [],
"label": "getAppClient",
Expand All @@ -804,7 +804,7 @@
},
{
"parentPluginId": "securitySolution",
"id": "def-server.AppRequestContext.getSpaceId",
"id": "def-server.SecuritySolutionApiRequestHandlerContext.getSpaceId",
"type": "Function",
"tags": [],
"label": "getSpaceId",
Expand All @@ -819,7 +819,7 @@
},
{
"parentPluginId": "securitySolution",
"id": "def-server.AppRequestContext.getExecutionLogClient",
"id": "def-server.SecuritySolutionApiRequestHandlerContext.getExecutionLogClient",
"type": "Function",
"tags": [],
"label": "getExecutionLogClient",
Expand Down Expand Up @@ -31438,4 +31438,4 @@
}
]
}
}
}
13 changes: 2 additions & 11 deletions examples/expressions_explorer/public/actions_and_expressions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ import {
EuiText,
EuiTitle,
} from '@elastic/eui';
import {
ExpressionsStart,
ReactExpressionRenderer,
ExpressionsInspectorAdapter,
} from '../../../src/plugins/expressions/public';
import { ExpressionsStart } from '../../../src/plugins/expressions/public';
import { ExpressionEditor } from './editor/expression_editor';
import { UiActionsStart } from '../../../src/plugins/ui_actions/public';
import { NAVIGATE_TRIGGER_ID } from './actions/navigate_trigger';
Expand All @@ -42,10 +38,6 @@ export function ActionsExpressionsExample({ expressions, actions }: Props) {
updateExpression(value);
};

const inspectorAdapters = {
expression: new ExpressionsInspectorAdapter(),
};

const handleEvents = (event: any) => {
if (event.name !== 'NAVIGATE') return;
// enrich event context with some extra data
Expand Down Expand Up @@ -83,10 +75,9 @@ export function ActionsExpressionsExample({ expressions, actions }: Props) {
</EuiFlexItem>
<EuiFlexItem>
<EuiPanel paddingSize="none" role="figure">
<ReactExpressionRenderer
<expressions.ReactExpressionRenderer
expression={expression}
debug={true}
inspectorAdapters={inspectorAdapters}
onEvent={handleEvents}
renderError={(message: any) => {
return <div>{message}</div>;
Expand Down
13 changes: 2 additions & 11 deletions examples/expressions_explorer/public/actions_and_expressions2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ import {
EuiText,
EuiTitle,
} from '@elastic/eui';
import {
ExpressionsStart,
ReactExpressionRenderer,
ExpressionsInspectorAdapter,
} from '../../../src/plugins/expressions/public';
import { ExpressionsStart } from '../../../src/plugins/expressions/public';
import { ExpressionEditor } from './editor/expression_editor';
import { UiActionsStart } from '../../../src/plugins/ui_actions/public';

Expand All @@ -45,10 +41,6 @@ export function ActionsExpressionsExample2({ expressions, actions }: Props) {
updateExpression(value);
};

const inspectorAdapters = {
expression: new ExpressionsInspectorAdapter(),
};

const handleEvents = (event: any) => {
updateVariables({ color: event.data.href === 'http://www.google.com' ? 'red' : 'blue' });
};
Expand Down Expand Up @@ -81,11 +73,10 @@ export function ActionsExpressionsExample2({ expressions, actions }: Props) {
</EuiFlexItem>
<EuiFlexItem>
<EuiPanel paddingSize="none" role="figure">
<ReactExpressionRenderer
<expressions.ReactExpressionRenderer
data-test-subj="expressionsVariablesTestRenderer"
expression={expression}
debug={true}
inspectorAdapters={inspectorAdapters}
variables={variables}
onEvent={handleEvents}
renderError={(message: any) => {
Expand Down
16 changes: 6 additions & 10 deletions examples/expressions_explorer/public/render_expressions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ import {
EuiTitle,
EuiButton,
} from '@elastic/eui';
import {
ExpressionsStart,
ReactExpressionRenderer,
ExpressionsInspectorAdapter,
} from '../../../src/plugins/expressions/public';
import { ExpressionsStart } from '../../../src/plugins/expressions/public';
import { ExpressionEditor } from './editor/expression_editor';
import { Start as InspectorStart } from '../../../src/plugins/inspector/public';

Expand All @@ -42,9 +38,7 @@ export function RenderExpressionsExample({ expressions, inspector }: Props) {
updateExpression(value);
};

const inspectorAdapters = {
expression: new ExpressionsInspectorAdapter(),
};
const inspectorAdapters = {};

return (
<EuiPageBody>
Expand Down Expand Up @@ -83,10 +77,12 @@ export function RenderExpressionsExample({ expressions, inspector }: Props) {
</EuiFlexItem>
<EuiFlexItem>
<EuiPanel data-test-subj="expressionRender" paddingSize="none" role="figure">
<ReactExpressionRenderer
<expressions.ReactExpressionRenderer
expression={expression}
debug={true}
inspectorAdapters={inspectorAdapters}
onData$={(result, panels) => {
Object.assign(inspectorAdapters, panels);
}}
renderError={(message: any) => {
return <div>{message}</div>;
}}
Expand Down
28 changes: 12 additions & 16 deletions examples/expressions_explorer/public/run_expressions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import React, { useState, useEffect, useMemo } from 'react';
import React, { useState, useEffect } from 'react';
import { pluck } from 'rxjs/operators';
import {
EuiCodeBlock,
Expand All @@ -22,12 +22,9 @@ import {
EuiTitle,
EuiButton,
} from '@elastic/eui';
import {
ExpressionsStart,
ExpressionsInspectorAdapter,
} from '../../../src/plugins/expressions/public';
import { ExpressionsStart } from '../../../src/plugins/expressions/public';
import { ExpressionEditor } from './editor/expression_editor';
import { Start as InspectorStart } from '../../../src/plugins/inspector/public';
import { Adapters, Start as InspectorStart } from '../../../src/plugins/inspector/public';

interface Props {
expressions: ExpressionsStart;
Expand All @@ -37,25 +34,24 @@ interface Props {
export function RunExpressionsExample({ expressions, inspector }: Props) {
const [expression, updateExpression] = useState('markdownVis "## expressions explorer"');
const [result, updateResult] = useState<unknown>({});
const [inspectorAdapters, updateInspectorAdapters] = useState<Adapters>({});

const expressionChanged = (value: string) => {
updateExpression(value);
};

const inspectorAdapters = useMemo(
() => ({
expression: new ExpressionsInspectorAdapter(),
}),
[]
);

useEffect(() => {
const execution = expressions.execute(expression, null, {
debug: true,
inspectorAdapters,
});
const subscription = execution.getData().pipe(pluck('result')).subscribe(updateResult);

const subscription = execution
.getData()
.pipe(pluck('result'))
.subscribe((data) => {
updateResult(data);
updateInspectorAdapters(execution.inspect());
});
execution.inspect();
return () => subscription.unsubscribe();
}, [expression, expressions, inspectorAdapters]);

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@
"@types/reduce-reducers": "^1.0.0",
"@types/redux-actions": "^2.6.1",
"@types/seedrandom": ">=2.0.0 <4.0.0",
"@types/selenium-webdriver": "^4.0.9",
"@types/selenium-webdriver": "^4.0.15",
"@types/semver": "^7",
"@types/set-value": "^2.0.0",
"@types/sinon": "^7.0.13",
Expand Down Expand Up @@ -780,7 +780,7 @@
"rxjs-marbles": "^5.0.6",
"sass-loader": "^10.2.0",
"sass-resources-loader": "^2.0.1",
"selenium-webdriver": "^4.0.0-alpha.7",
"selenium-webdriver": "^4.0.0",
"serve-static": "1.14.1",
"shelljs": "^0.8.4",
"simple-git": "1.116.0",
Expand Down
1 change: 1 addition & 0 deletions src/plugins/data/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ export const UI_SETTINGS = {
FILTERS_EDITOR_SUGGEST_VALUES: 'filterEditor:suggestValues',
AUTOCOMPLETE_USE_TIMERANGE: 'autocomplete:useTimeRange',
AUTOCOMPLETE_VALUE_SUGGESTION_METHOD: 'autocomplete:valueSuggestionMethod',
DATE_FORMAT: 'dateFormat',
} as const;
7 changes: 1 addition & 6 deletions src/plugins/data/common/query/persistable_state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import uuid from 'uuid';
import { Filter } from '@kbn/es-query';
import type { SerializableRecord } from '@kbn/utility-types';
import { SavedObjectReference } from '../../../../core/types';

export const extract = (filters: Filter[]) => {
Expand Down Expand Up @@ -51,14 +50,10 @@ export const inject = (filters: Filter[], references: SavedObjectReference[]) =>
});
};

export const telemetry = (filters: SerializableRecord, collector: unknown) => {
export const telemetry = (filters: Filter[], collector: unknown) => {
return {};
};

export const migrateToLatest = (filters: Filter[], version: string) => {
return filters;
};

export const getAllMigrations = () => {
return {};
};
12 changes: 3 additions & 9 deletions src/plugins/data/public/query/filter_manager/filter_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@ import {
import { PersistableStateService } from '../../../../kibana_utils/common/persistable_state';
import {
getAllMigrations,
migrateToLatest,
inject,
extract,
telemetry,
} from '../../../common/query/persistable_state';

export class FilterManager implements PersistableStateService {
export class FilterManager implements PersistableStateService<Filter[]> {
private filters: Filter[] = [];
private updated$: Subject<void> = new Subject();
private fetch$: Subject<void> = new Subject();
Expand Down Expand Up @@ -228,16 +227,11 @@ export class FilterManager implements PersistableStateService {
});
}

// Filter needs to implement SerializableRecord
public extract = extract as any;
public extract = extract;

// Filter needs to implement SerializableRecord
public inject = inject as any;
public inject = inject;

public telemetry = telemetry;

// Filter needs to implement SerializableRecord
public migrateToLatest = migrateToLatest as any;

public getAllMigrations = getAllMigrations;
}
13 changes: 7 additions & 6 deletions src/plugins/data/public/search/expressions/esaggs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
EsaggsExpressionFunctionDefinition,
EsaggsStartDependencies,
getEsaggsMeta,
handleEsaggsRequest,
} from '../../../common/search/expressions';
import { DataPublicPluginStart, DataStartDependencies } from '../../types';

Expand Down Expand Up @@ -48,10 +47,12 @@ export function getFunctionDefinition({
);
aggConfigs.hierarchical = args.metricsAtAllLevels;

return { aggConfigs, indexPattern, searchSource, getNow };
const { handleEsaggsRequest } = await import('../../../common/search/expressions');

return { aggConfigs, indexPattern, searchSource, getNow, handleEsaggsRequest };
}).pipe(
switchMap(({ aggConfigs, indexPattern, searchSource, getNow }) =>
handleEsaggsRequest({
switchMap(({ aggConfigs, indexPattern, searchSource, getNow, handleEsaggsRequest }) => {
return handleEsaggsRequest({
abortSignal,
aggs: aggConfigs,
filters: get(input, 'filters', undefined),
Expand All @@ -65,8 +66,8 @@ export function getFunctionDefinition({
timeRange: get(input, 'timeRange', undefined),
getNow,
executionContext: getExecutionContext(),
})
)
});
})
);
},
});
Expand Down
Loading

0 comments on commit 7787e80

Please sign in to comment.