Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into kbn-xxx-remove-le…
Browse files Browse the repository at this point in the history
…gacy-es-plugin
  • Loading branch information
pgayvallet committed Sep 18, 2020
2 parents bbf6bf9 + 6122610 commit 407084a
Show file tree
Hide file tree
Showing 387 changed files with 12,416 additions and 4,217 deletions.
12 changes: 6 additions & 6 deletions .ci/Jenkinsfile_baseline_capture
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ kibanaPipeline(timeoutMinutes: 120) {
'CI_PARALLEL_PROCESS_NUMBER=1'
]) {
parallel([
'oss-visualRegression': {
workers.ci(name: 'oss-visualRegression', size: 's-highmem', ramDisk: true) {
kibanaPipeline.functionalTestProcess('oss-visualRegression', './test/scripts/jenkins_visual_regression.sh')()
'oss-baseline': {
workers.ci(name: 'oss-baseline', size: 's-highmem', ramDisk: true, runErrorReporter: false) {
kibanaPipeline.functionalTestProcess('oss-baseline', './test/scripts/jenkins_baseline.sh')()
}
},
'xpack-visualRegression': {
workers.ci(name: 'xpack-visualRegression', size: 's-highmem', ramDisk: true) {
kibanaPipeline.functionalTestProcess('xpack-visualRegression', './test/scripts/jenkins_xpack_visual_regression.sh')()
'xpack-baseline': {
workers.ci(name: 'xpack-baseline', size: 's-highmem', ramDisk: true, runErrorReporter: false) {
kibanaPipeline.functionalTestProcess('xpack-baseline', './test/scripts/jenkins_xpack_baseline.sh')()
}
},
])
Expand Down
2 changes: 0 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@

# Security
/src/core/server/csp/ @elastic/kibana-security @elastic/kibana-platform
/x-pack/legacy/plugins/security/ @elastic/kibana-security
/x-pack/legacy/plugins/spaces/ @elastic/kibana-security
/x-pack/plugins/spaces/ @elastic/kibana-security
/x-pack/plugins/encrypted_saved_objects/ @elastic/kibana-security
Expand Down Expand Up @@ -282,7 +281,6 @@ x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json @elastic/kib
# Core design
/src/plugins/dashboard/**/*.scss @elastic/kibana-core-ui-designers
/x-pack/plugins/canvas/**/*.scss @elastic/kibana-core-ui-designers
/x-pack/legacy/plugins/security/**/*.scss @elastic/kibana-core-ui-designers
/x-pack/legacy/plugins/spaces/**/*.scss @elastic/kibana-core-ui-designers
/x-pack/plugins/spaces/**/*.scss @elastic/kibana-core-ui-designers
/x-pack/plugins/security/**/*.scss @elastic/kibana-core-ui-designers
Expand Down
2 changes: 1 addition & 1 deletion docs/apm/troubleshooting.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ GET /_template/apm-{version}
*Using Logstash, Kafka, etc.*
If you're not outputting data directly from APM Server to Elasticsearch (perhaps you're using Logstash or Kafka),
then the index template will not be set up automatically. Instead, you'll need to
{apm-server-ref}/configuration-template.html[load the template manually].
{apm-server-ref}/apm-server-template.html[load the template manually].

*Using a custom index names*
This problem can also occur if you've customized the index name that you write APM data to.
Expand Down
54 changes: 26 additions & 28 deletions docs/settings/reporting-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,14 @@ security is enabled, `xpack.security.encryptionKey`.
[cols="2*<"]
|===
| `xpack.reporting.queue.pollInterval`
| Specifies the number of milliseconds that the reporting poller waits between polling the
index for any pending Reporting jobs. Defaults to `3000` (3 seconds).
| Specify the {ref}/common-options.html#time-units[time] that the reporting poller waits between polling the index for any
pending Reporting jobs. Can be specified as number of milliseconds. Defaults to `3s`.

| [[xpack-reporting-q-timeout]] `xpack.reporting.queue.timeout` {ess-icon}
| How long each worker has to produce a report. If your machine is slow or under
heavy load, you might need to increase this timeout. Specified in milliseconds.
If a Reporting job execution time goes over this time limit, the job will be
marked as a failure and there will not be a download available.
Defaults to `120000` (two minutes).
| {ref}/common-options.html#time-units[How long] each worker has to produce a report. If your machine is slow or under heavy
load, you might need to increase this timeout. If a Reporting job execution goes over this time limit, the job is marked as a
failure and no download will be available. Can be specified as number of milliseconds.
Defaults to `2m`.

|===

Expand All @@ -127,24 +126,24 @@ control the capturing process.
|===
a| `xpack.reporting.capture.timeouts`
`.openUrl` {ess-icon}
| Specify how long to allow the Reporting browser to wait for the "Loading..." screen
to dismiss and find the initial data for the Kibana page. If the time is
exceeded, a page screenshot is captured showing the current state, and the download link shows a warning message.
Defaults to `60000` (1 minute).
| Specify the {ref}/common-options.html#time-units[time] to allow the Reporting browser to wait for the "Loading..." screen
to dismiss and find the initial data for the page. If the time is exceeded, a screenshot is captured showing the current
page, and the download link shows a warning message. Can be specified as number of milliseconds.
Defaults to `1m`.

a| `xpack.reporting.capture.timeouts`
`.waitForElements` {ess-icon}
| Specify how long to allow the Reporting browser to wait for all visualization
panels to load on the Kibana page. If the time is exceeded, a page screenshot
is captured showing the current state, and the download link shows a warning message. Defaults to `30000` (30
seconds).
| Specify the {ref}/common-options.html#time-units[time] to allow the Reporting browser to wait for all visualization panels
to load on the page. If the time is exceeded, a screenshot is captured showing the current page, and the download link shows
a warning message. Can be specified as number of milliseconds.
Defaults to `30s`.

a| `xpack.reporting.capture.timeouts`
`.renderComplete` {ess-icon}
| Specify how long to allow the Reporting browser to wait for all visualizations to
fetch and render the data. If the time is exceeded, a
page screenshot is captured showing the current state, and the download link shows a warning message. Defaults to
`30000` (30 seconds).
| Specify the {ref}/common-options.html#time-units[time] to allow the Reporting browser to wait for all visualizations to
fetch and render the data. If the time is exceeded, a screenshot is captured showing the current page, and the download link shows a
warning message. Can be specified as number of milliseconds.
Defaults to `30s`.

|===

Expand All @@ -163,11 +162,10 @@ available, but there will likely be errors in the visualizations in the report.
job, as many times as this setting. Defaults to `3`.

| `xpack.reporting.capture.loadDelay`
| When visualizations are not evented, this is the amount of time before
taking a screenshot. All visualizations that ship with {kib} are evented, so this
setting should not have much effect. If you are seeing empty images instead of
visualizations, try increasing this value.
Defaults to `3000` (3 seconds).
| Specify the {ref}/common-options.html#time-units[amount of time] before taking a screenshot when visualizations are not evented.
All visualizations that ship with {kib} are evented, so this setting should not have much effect. If you are seeing empty images
instead of visualizations, try increasing this value.
Defaults to `3s`.

| [[xpack-reporting-browser]] `xpack.reporting.capture.browser.type` {ess-icon}
| Specifies the browser to use to capture screenshots. This setting exists for
Expand Down Expand Up @@ -213,17 +211,17 @@ a| `xpack.reporting.capture.browser`
[cols="2*<"]
|===
| [[xpack-reporting-csv]] `xpack.reporting.csv.maxSizeBytes` {ess-icon}
| The maximum size of a CSV file before being truncated. This setting exists to prevent
large exports from causing performance and storage issues.
Defaults to `10485760` (10mB).
| The maximum {ref}/common-options.html#byte-units[byte size] of a CSV file before being truncated. This setting exists to
prevent large exports from causing performance and storage issues. Can be specified as number of bytes.
Defaults to `10mb`.

| `xpack.reporting.csv.scroll.size`
| Number of documents retrieved from {es} for each scroll iteration during a CSV
export.
Defaults to `500`.

| `xpack.reporting.csv.scroll.duration`
| Amount of time allowed before {kib} cleans the scroll context during a CSV export.
| Amount of {ref}/common-options.html#time-units[time] allowed before {kib} cleans the scroll context during a CSV export.
Defaults to `30s`.

| `xpack.reporting.csv.checkForFormulas`
Expand Down
2 changes: 1 addition & 1 deletion docs/user/alerting/action-types/server-log.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[[server-log-action-type]]
=== Server log action

This action type writes and entry to the {kib} server log.
This action type writes an entry to the {kib} server log.

[float]
[[server-log-connector-configuration]]
Expand Down
17 changes: 17 additions & 0 deletions docs/user/dashboard/url-drilldown.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ context.panel.timeRange.indexPatternIds
| ID of saved object behind a panel.

| *Single click*

| event.value
| Value behind clicked data point.

Expand All @@ -208,6 +209,22 @@ context.panel.timeRange.indexPatternIds
| event.negate
| Boolean, indicating whether clicked data point resulted in negative filter.

|
| event.points
| Some visualizations have clickable points that emit more than one data point. Use list of data points in case a single value is insufficient. +

Example:

`{{json event.points}}` +
`{{event.points.[0].key}}` +
`{{event.points.[0].value}}`
`{{#each event.points}}key=value&{{/each}}`

Note:

`{{event.value}}` is a shorthand for `{{event.points.[0].value}}` +
`{{event.key}}` is a shorthand for `{{event.points.[0].key}}`

| *Range selection*
| event.from +
event.to
Expand Down
2 changes: 1 addition & 1 deletion src/dev/build/tasks/os_packages/docker_generator/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export async function runDockerGenerator(
ubi: boolean = false
) {
// UBI var config
const baseOSImage = ubi ? 'registry.access.redhat.com/ubi8/ubi-minimal:latest' : 'centos:8';
const baseOSImage = ubi ? 'docker.elastic.co/ubi8/ubi-minimal:latest' : 'centos:8';
const ubiVersionTag = 'ubi8';
const ubiImageFlavor = ubi ? `-${ubiVersionTag}` : '';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -546,13 +546,16 @@ export class QueryStringInputUI extends Component<Props, State> {
this.updateSuggestions.cancel();
this.componentIsUnmounting = true;
window.removeEventListener('resize', this.handleAutoHeight);
window.removeEventListener('scroll', this.handleListUpdate);
window.removeEventListener('scroll', this.handleListUpdate, { capture: true });
}

handleListUpdate = () =>
this.setState({
handleListUpdate = () => {
if (this.componentIsUnmounting) return;

return this.setState({
queryBarRect: this.queryBarInputDivRefInstance.current?.getBoundingClientRect(),
});
};

handleAutoHeight = () => {
if (this.inputRef !== null && document.activeElement === this.inputRef) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import React from 'react';
import React, { useState, useEffect } from 'react';
import { act } from 'react-dom/test-utils';
import { mount, ReactWrapper } from 'enzyme';
import sinon from 'sinon';
Expand Down Expand Up @@ -111,6 +111,13 @@ export const createUseRequestHelpers = (): UseRequestHelpers => {
requestConfig
);

// Force a re-render of the component to stress-test the useRequest hook and verify its
// state remains unaffected.
const [, setState] = useState(false);
useEffect(() => {
setState(true);
}, []);

hookResult.isInitialRequest = isInitialRequest;
hookResult.isLoading = isLoading;
hookResult.error = error;
Expand Down
7 changes: 5 additions & 2 deletions src/plugins/es_ui_shared/public/request/use_request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const useRequest = <D = any, E = Error>(

// Consumers can use isInitialRequest to implement a polling UX.
const requestCountRef = useRef<number>(0);
const isInitialRequest = requestCountRef.current === 0;
const isInitialRequestRef = useRef<boolean>(true);
const pollIntervalIdRef = useRef<any>(null);

const clearPollInterval = useCallback(() => {
Expand Down Expand Up @@ -98,6 +98,9 @@ export const useRequest = <D = any, E = Error>(
return;
}

// Surface to consumers that at least one request has resolved.
isInitialRequestRef.current = false;

setError(responseError);
// If there's an error, keep the data from the last request in case it's still useful to the user.
if (!responseError) {
Expand Down Expand Up @@ -146,7 +149,7 @@ export const useRequest = <D = any, E = Error>(
}, [clearPollInterval]);

return {
isInitialRequest,
isInitialRequest: isInitialRequestRef.current,
isLoading,
error,
data,
Expand Down
9 changes: 8 additions & 1 deletion src/plugins/telemetry/server/routes/telemetry_opt_in.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
StatsGetterConfig,
TelemetryCollectionManagerPluginSetup,
} from 'src/plugins/telemetry_collection_manager/server';
import { SavedObjectsErrorHelpers } from '../../../../core/server';
import { getTelemetryAllowChangingOptInStatus } from '../../common/telemetry_config';
import { sendTelemetryOptInStatus } from './telemetry_opt_in_stats';

Expand Down Expand Up @@ -109,7 +110,13 @@ export function registerTelemetryOptInRoutes({
});
}

await updateTelemetrySavedObject(context.core.savedObjects.client, attributes);
try {
await updateTelemetrySavedObject(context.core.savedObjects.client, attributes);
} catch (e) {
if (SavedObjectsErrorHelpers.isForbiddenError(e)) {
return res.forbidden();
}
}
return res.ok({ body: optInStatus });
}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ export const valueClickTrigger: Trigger<'VALUE_CLICK_TRIGGER'> = {
defaultMessage: 'Single click',
}),
description: i18n.translate('uiActions.triggers.valueClickDescription', {
defaultMessage: 'A single point on the visualization',
defaultMessage: 'A data point click on the visualization',
}),
};
10 changes: 5 additions & 5 deletions src/plugins/vis_type_timeseries/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { PluginInitializerContext, PluginConfigDescriptor } from 'src/core/serve
import { VisTypeTimeseriesConfig, config as configSchema } from './config';
import { VisTypeTimeseriesPlugin } from './plugin';

export { VisTypeTimeseriesSetup, Framework } from './plugin';
export { VisTypeTimeseriesSetup } from './plugin';

export const config: PluginConfigDescriptor<VisTypeTimeseriesConfig> = {
deprecations: ({ unused, renameFromRoot }) => [
Expand All @@ -39,10 +39,10 @@ export const config: PluginConfigDescriptor<VisTypeTimeseriesConfig> = {

export { ValidationTelemetryServiceSetup } from './validation_telemetry';

// @ts-ignore
export { AbstractSearchStrategy } from './lib/search_strategies/strategies/abstract_search_strategy';
// @ts-ignore
export { AbstractSearchRequest } from './lib/search_strategies/search_requests/abstract_request';
export {
AbstractSearchStrategy,
ReqFacade,
} from './lib/search_strategies/strategies/abstract_search_strategy';
// @ts-ignore
export { DefaultSearchCapabilities } from './lib/search_strategies/default_search_capabilities';

Expand Down
17 changes: 1 addition & 16 deletions src/plugins/vis_type_timeseries/server/lib/get_fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export async function getFields(
// level object passed from here. The layers should be refactored fully at some point, but for now
// this works and we are still using the New Platform services for these vis data portions.
const reqFacade: ReqFacade = {
requestContext,
...request,
framework,
payload: {},
Expand All @@ -48,22 +49,6 @@ export async function getFields(
},
getUiSettingsService: () => requestContext.core.uiSettings.client,
getSavedObjectsClient: () => requestContext.core.savedObjects.client,
server: {
plugins: {
elasticsearch: {
getCluster: () => {
return {
callWithRequest: async (req: any, endpoint: string, params: any) => {
return await requestContext.core.elasticsearch.legacy.client.callAsCurrentUser(
endpoint,
params
);
},
};
},
},
},
},
getEsShardTimeout: async () => {
return await framework.globalConfig$
.pipe(
Expand Down
19 changes: 2 additions & 17 deletions src/plugins/vis_type_timeseries/server/lib/get_vis_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { FakeRequest, RequestHandlerContext } from 'kibana/server';
import _ from 'lodash';
import { first, map } from 'rxjs/operators';
import { getPanelData } from './vis_data/get_panel_data';
import { Framework } from '../index';
import { Framework } from '../plugin';
import { ReqFacade } from './search_strategies/strategies/abstract_search_strategy';

interface GetVisDataResponse {
Expand Down Expand Up @@ -65,28 +65,13 @@ export function getVisData(
// level object passed from here. The layers should be refactored fully at some point, but for now
// this works and we are still using the New Platform services for these vis data portions.
const reqFacade: ReqFacade = {
requestContext,
...request,
framework,
pre: {},
payload: request.body,
getUiSettingsService: () => requestContext.core.uiSettings.client,
getSavedObjectsClient: () => requestContext.core.savedObjects.client,
server: {
plugins: {
elasticsearch: {
getCluster: () => {
return {
callWithRequest: async (req: any, endpoint: string, params: any) => {
return await requestContext.core.elasticsearch.legacy.client.callAsCurrentUser(
endpoint,
params
);
},
};
},
},
},
},
getEsShardTimeout: async () => {
return await framework.globalConfig$
.pipe(
Expand Down
Loading

0 comments on commit 407084a

Please sign in to comment.