From 63e6666b1321ed8d57ec65b0e650249189d160e2 Mon Sep 17 00:00:00 2001 From: Aaron Caldwell Date: Thu, 16 Jul 2020 17:02:15 -0600 Subject: [PATCH 01/59] [Maps] Fix issue preventing TMS from rendering correctly (#71946) * Ensure getColors selector modifies and returns the same object * Call onSourceConfigChange on CreateSourceEditor mount * Back out selector update Co-authored-by: Elastic Machine --- .../kibana_tilemap_source/create_source_editor.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/x-pack/plugins/maps/public/classes/sources/kibana_tilemap_source/create_source_editor.js b/x-pack/plugins/maps/public/classes/sources/kibana_tilemap_source/create_source_editor.js index 1cbf4c1a87de3..ee557f6244f49 100644 --- a/x-pack/plugins/maps/public/classes/sources/kibana_tilemap_source/create_source_editor.js +++ b/x-pack/plugins/maps/public/classes/sources/kibana_tilemap_source/create_source_editor.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import React from 'react'; +import React, { useEffect } from 'react'; import PropTypes from 'prop-types'; import { EuiFieldText, EuiFormRow, EuiPanel } from '@elastic/eui'; @@ -13,10 +13,12 @@ import { i18n } from '@kbn/i18n'; export function CreateSourceEditor({ onSourceConfigChange }) { const tilemap = getKibanaTileMap(); - - if (tilemap.url) { - onSourceConfigChange(); - } + useEffect(() => { + if (tilemap.url) { + onSourceConfigChange(); + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); return ( @@ -33,7 +35,7 @@ export function CreateSourceEditor({ onSourceConfigChange }) { }) } > - + ); From fead1f2d1d51febe0772cd966b52e5bc633bef24 Mon Sep 17 00:00:00 2001 From: spalger Date: Thu, 16 Jul 2020 16:42:41 -0700 Subject: [PATCH 02/59] skip flaky suite (#77207) --- .../security_and_spaces/tests/alerting/alerts.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/tests/alerting/alerts.ts b/x-pack/test/alerting_api_integration/security_and_spaces/tests/alerting/alerts.ts index 0f339154bd948..db1e59746162b 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/tests/alerting/alerts.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/tests/alerting/alerts.ts @@ -30,7 +30,8 @@ export default function alertTests({ getService }: FtrProviderContext) { const esTestIndexTool = new ESTestIndexTool(es, retry); const taskManagerUtils = new TaskManagerUtils(es, retry); - describe('alerts', () => { + // FLAKY: https://github.com/elastic/kibana/issues/72207 + describe.skip('alerts', () => { const authorizationIndex = '.kibana-test-authorization'; const objectRemover = new ObjectRemover(supertest); From b695d60516ec9551a99ae6ab547657909be2c987 Mon Sep 17 00:00:00 2001 From: Spencer Date: Thu, 16 Jul 2020 17:13:32 -0700 Subject: [PATCH 03/59] [baseline/capture] use high-memory nodes with ramDisks (#71894) Co-authored-by: spalger --- .ci/Jenkinsfile_baseline_capture | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/Jenkinsfile_baseline_capture b/.ci/Jenkinsfile_baseline_capture index 7c7cc8d98c306..3f90a6bc05af0 100644 --- a/.ci/Jenkinsfile_baseline_capture +++ b/.ci/Jenkinsfile_baseline_capture @@ -8,12 +8,12 @@ kibanaPipeline(timeoutMinutes: 120) { catchError { parallel([ 'oss-visualRegression': { - workers.ci(name: 'oss-visualRegression', size: 's', ramDisk: false) { + workers.ci(name: 'oss-visualRegression', size: 's-highmem', ramDisk: true) { kibanaPipeline.functionalTestProcess('oss-visualRegression', './test/scripts/jenkins_visual_regression.sh')(1) } }, 'xpack-visualRegression': { - workers.ci(name: 'xpack-visualRegression', size: 's', ramDisk: false) { + workers.ci(name: 'xpack-visualRegression', size: 's-highmem', ramDisk: true) { kibanaPipeline.functionalTestProcess('xpack-visualRegression', './test/scripts/jenkins_xpack_visual_regression.sh')(1) } }, From 678dc309afbf2b30d1175374e2e516ec3f02157c Mon Sep 17 00:00:00 2001 From: Ryland Herrick Date: Thu, 16 Jul 2020 19:43:15 -0500 Subject: [PATCH 04/59] [Security Solution][Detections,Lists] Miscellaneous post-FF fixes (#71990) * Overview Alerts Histogram stacking defaults to signal.rule.name Since this is now the default for all AlertsHistograms, I've moved this default upstream into the histogram itself. * Replace magic strings with our constant ENDPOINT_LIST_ID Also replaced a few unintentional uses of this string with the non-reserved 'endpoint_list_id'. Co-authored-by: Elastic Machine --- .../schemas/response/exception_list_item_schema.mock.ts | 2 +- .../common/schemas/response/exception_list_schema.mock.ts | 6 ++++-- x-pack/plugins/lists/public/exceptions/api.test.ts | 2 +- .../detections/components/alerts_histogram_panel/index.tsx | 6 +++++- .../pages/detection_engine/rules/create/helpers.ts | 3 ++- .../detections/pages/detection_engine/rules/helpers.tsx | 3 ++- .../overview/components/signals_by_category/index.tsx | 5 ----- .../server/endpoint/lib/artifacts/lists.ts | 3 ++- .../apis/lists/create_exception_list_item.ts | 5 +++-- 9 files changed, 20 insertions(+), 15 deletions(-) diff --git a/x-pack/plugins/lists/common/schemas/response/exception_list_item_schema.mock.ts b/x-pack/plugins/lists/common/schemas/response/exception_list_item_schema.mock.ts index f7a6af98c8f0e..9e1a88ceb28bd 100644 --- a/x-pack/plugins/lists/common/schemas/response/exception_list_item_schema.mock.ts +++ b/x-pack/plugins/lists/common/schemas/response/exception_list_item_schema.mock.ts @@ -16,7 +16,7 @@ export const getExceptionListItemSchemaMock = (): ExceptionListItemSchema => ({ entries: ENTRIES, id: '1', item_id: 'endpoint_list_item', - list_id: 'endpoint_list', + list_id: 'endpoint_list_id', meta: {}, name: 'Sample Endpoint Exception List', namespace_type: 'single', diff --git a/x-pack/plugins/lists/common/schemas/response/exception_list_schema.mock.ts b/x-pack/plugins/lists/common/schemas/response/exception_list_schema.mock.ts index 017b959a2baf3..906dcf6560ee5 100644 --- a/x-pack/plugins/lists/common/schemas/response/exception_list_schema.mock.ts +++ b/x-pack/plugins/lists/common/schemas/response/exception_list_schema.mock.ts @@ -4,6 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ +import { ENDPOINT_LIST_ID } from '../..'; + import { ExceptionListSchema } from './exception_list_schema'; export const getExceptionListSchemaMock = (): ExceptionListSchema => ({ @@ -12,10 +14,10 @@ export const getExceptionListSchemaMock = (): ExceptionListSchema => ({ created_by: 'user_name', description: 'This is a sample endpoint type exception', id: '1', - list_id: 'endpoint_list', + list_id: ENDPOINT_LIST_ID, meta: {}, name: 'Sample Endpoint Exception List', - namespace_type: 'single', + namespace_type: 'agnostic', tags: ['user added string for a tag', 'malware'], tie_breaker_id: '77fd1909-6786-428a-a671-30229a719c1f', type: 'endpoint', diff --git a/x-pack/plugins/lists/public/exceptions/api.test.ts b/x-pack/plugins/lists/public/exceptions/api.test.ts index 1414d828fa6d4..455670098307f 100644 --- a/x-pack/plugins/lists/public/exceptions/api.test.ts +++ b/x-pack/plugins/lists/public/exceptions/api.test.ts @@ -508,7 +508,7 @@ describe('Exceptions Lists API', () => { test('it returns expected format when call succeeds', async () => { const exceptionResponse = await fetchExceptionListItemsByListId({ http: mockKibanaHttpService(), - listId: 'endpoint_list', + listId: 'endpoint_list_id', namespaceType: 'single', pagination: { page: 1, diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_histogram_panel/index.tsx b/x-pack/plugins/security_solution/public/detections/components/alerts_histogram_panel/index.tsx index 560c092d12076..3bc84bb7c32ee 100644 --- a/x-pack/plugins/security_solution/public/detections/components/alerts_histogram_panel/index.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/alerts_histogram_panel/index.tsx @@ -80,10 +80,14 @@ const getHistogramOption = (fieldName: string): MatrixHistogramOption => ({ const NO_LEGEND_DATA: LegendItem[] = []; +const DEFAULT_STACK_BY = 'signal.rule.name'; +const getDefaultStackByOption = (): AlertsHistogramOption => + alertsHistogramOptions.find(({ text }) => text === DEFAULT_STACK_BY) ?? alertsHistogramOptions[0]; + export const AlertsHistogramPanel = memo( ({ chartHeight, - defaultStackByOption = alertsHistogramOptions[8], // signal.rule.name + defaultStackByOption = getDefaultStackByOption(), deleteQuery, filters, headerChildren, diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/create/helpers.ts b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/create/helpers.ts index 226fa5313e34f..38f7836f678f9 100644 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/create/helpers.ts +++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/create/helpers.ts @@ -12,6 +12,7 @@ import { NOTIFICATION_THROTTLE_NO_ACTIONS } from '../../../../../../common/const import { transformAlertToRuleAction } from '../../../../../../common/detection_engine/transform_actions'; import { RuleType } from '../../../../../../common/detection_engine/types'; import { isMlRule } from '../../../../../../common/machine_learning/helpers'; +import { ENDPOINT_LIST_ID } from '../../../../../shared_imports'; import { NewRule } from '../../../../containers/detection_engine/rules'; import { @@ -167,7 +168,7 @@ export const formatAboutStepData = (aboutStepData: AboutStepRule): AboutStepRule ...(isAssociatedToEndpointList ? { exceptions_list: [ - { id: 'endpoint_list', namespace_type: 'agnostic', type: 'endpoint' }, + { id: ENDPOINT_LIST_ID, namespace_type: 'agnostic', type: 'endpoint' }, ] as AboutStepRuleJson['exceptions_list'], } : {}), diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/helpers.tsx b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/helpers.tsx index 3de508dcbb3be..11b779e71b9b2 100644 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/helpers.tsx +++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/helpers.tsx @@ -13,6 +13,7 @@ import { RuleAlertAction, RuleType } from '../../../../../common/detection_engin import { isMlRule } from '../../../../../common/machine_learning/helpers'; import { transformRuleToAlertAction } from '../../../../../common/detection_engine/transform_actions'; import { Filter } from '../../../../../../../../src/plugins/data/public'; +import { ENDPOINT_LIST_ID } from '../../../../shared_imports'; import { Rule } from '../../../containers/detection_engine/rules'; import { AboutStepRule, @@ -137,7 +138,7 @@ export const getAboutStepsData = (rule: Rule, detailsView: boolean): AboutStepRu return { isNew: false, author, - isAssociatedToEndpointList: exceptionsList?.some(({ id }) => id === 'endpoint_list') ?? false, + isAssociatedToEndpointList: exceptionsList?.some(({ id }) => id === ENDPOINT_LIST_ID) ?? false, isBuildingBlock: buildingBlockType !== undefined, license: license ?? '', ruleNameOverride: ruleNameOverride ?? '', diff --git a/x-pack/plugins/security_solution/public/overview/components/signals_by_category/index.tsx b/x-pack/plugins/security_solution/public/overview/components/signals_by_category/index.tsx index fbfdefa13d738..0ac136044c06d 100644 --- a/x-pack/plugins/security_solution/public/overview/components/signals_by_category/index.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/signals_by_category/index.tsx @@ -17,7 +17,6 @@ import { UpdateDateRange } from '../../../common/components/charts/common'; import { GlobalTimeArgs } from '../../../common/containers/use_global_time'; const DEFAULT_QUERY: Query = { query: '', language: 'kuery' }; -const DEFAULT_STACK_BY = 'signal.rule.threat.tactic.name'; const NO_FILTERS: Filter[] = []; interface Props extends Pick { @@ -62,13 +61,9 @@ const SignalsByCategoryComponent: React.FC = ({ [setAbsoluteRangeDatePicker] ); - const defaultStackByOption = - alertsHistogramOptions.find((o) => o.text === DEFAULT_STACK_BY) ?? alertsHistogramOptions[0]; - return ( Date: Thu, 16 Jul 2020 20:49:55 -0500 Subject: [PATCH 05/59] [Security Solution][Detections] Disable exceptions for Threshold and ML rules (#72137) * Move isThresholdRule predicate into our common folder This is very similar to isMlRule, which is already used extensively and lives at this level. * Disable endpoint association checkbox for ML and Threshold rules The fullWidth and isDisabled props were not used; what we want is disabled. * Fix react warning about nesting buttons This removes the AdvancedSettingsAccordion in favor of a plain EuiAccordion with buttonContent, as that seems to be all that's needed here. * Disable Exceptions tab on Details for ML or Threshold rules These rule types do not currently support exceptions. * Fix type error Unused import --- .../common/detection_engine/utils.ts | 3 ++ .../rules/select_rule_type/index.tsx | 3 +- .../rules/step_about_rule/index.tsx | 40 ++++++------------ .../detection_engine/rules/details/index.tsx | 42 +++++++++++-------- 4 files changed, 40 insertions(+), 48 deletions(-) diff --git a/x-pack/plugins/security_solution/common/detection_engine/utils.ts b/x-pack/plugins/security_solution/common/detection_engine/utils.ts index fa1812235f897..153130fc16d60 100644 --- a/x-pack/plugins/security_solution/common/detection_engine/utils.ts +++ b/x-pack/plugins/security_solution/common/detection_engine/utils.ts @@ -5,6 +5,7 @@ */ import { EntriesArray } from '../shared_imports'; +import { RuleType } from './types'; export const hasLargeValueList = (entries: EntriesArray): boolean => { const found = entries.filter(({ type }) => type === 'list'); @@ -15,3 +16,5 @@ export const hasNestedEntry = (entries: EntriesArray): boolean => { const found = entries.filter(({ type }) => type === 'nested'); return found.length > 0; }; + +export const isThresholdRule = (ruleType: RuleType) => ruleType === 'threshold'; diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/select_rule_type/index.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/select_rule_type/index.tsx index 6546c1ba59d84..c6ea269e1a355 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/select_rule_type/index.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/select_rule_type/index.tsx @@ -8,14 +8,13 @@ import React, { useCallback, useMemo } from 'react'; import { EuiCard, EuiFlexGrid, EuiFlexItem, EuiFormRow, EuiIcon } from '@elastic/eui'; import { isMlRule } from '../../../../../common/machine_learning/helpers'; +import { isThresholdRule } from '../../../../../common/detection_engine/utils'; import { RuleType } from '../../../../../common/detection_engine/types'; import { FieldHook } from '../../../../shared_imports'; import { useKibana } from '../../../../common/lib/kibana'; import * as i18n from './translations'; import { MlCardDescription } from './ml_card_description'; -const isThresholdRule = (ruleType: RuleType) => ruleType === 'threshold'; - interface SelectRuleTypeProps { describedByIds?: string[]; field: FieldHook; diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/step_about_rule/index.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/step_about_rule/index.tsx index 1fc88da5fd7c7..ec812fa63eadf 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/step_about_rule/index.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/step_about_rule/index.tsx @@ -4,10 +4,12 @@ * you may not use this file except in compliance with the Elastic License. */ -import { EuiAccordion, EuiFlexItem, EuiSpacer, EuiButtonEmpty, EuiFormRow } from '@elastic/eui'; +import { EuiAccordion, EuiFlexItem, EuiSpacer, EuiFormRow } from '@elastic/eui'; import React, { FC, memo, useCallback, useEffect, useState } from 'react'; import styled from 'styled-components'; +import { isMlRule } from '../../../../../common/machine_learning/helpers'; +import { isThresholdRule } from '../../../../../common/detection_engine/utils'; import { RuleStepProps, RuleStep, @@ -58,26 +60,6 @@ const TagContainer = styled.div` TagContainer.displayName = 'TagContainer'; -const AdvancedSettingsAccordion = styled(EuiAccordion)` - .euiAccordion__iconWrapper { - display: none; - } - - .euiAccordion__childWrapper { - transition-duration: 1ms; /* hack to fire Step accordion to set proper content's height */ - } - - &.euiAccordion-isOpen .euiButtonEmpty__content > svg { - transform: rotate(90deg); - } -`; - -const AdvancedSettingsAccordionButton = ( - - {I18n.ADVANCED_SETTINGS} - -); - const StepAboutRuleComponent: FC = ({ addPadding = false, defaultValues, @@ -94,6 +76,10 @@ const StepAboutRuleComponent: FC = ({ const [{ isLoading: indexPatternLoading, indexPatterns }] = useFetchIndexPatterns( defineRuleData?.index ?? [] ); + const canUseExceptions = + defineRuleData?.ruleType && + !isMlRule(defineRuleData.ruleType) && + !isThresholdRule(defineRuleData.ruleType); const { form } = useForm({ defaultValue: initialState, @@ -193,10 +179,10 @@ const StepAboutRuleComponent: FC = ({ /> - = ({ idAria: 'detectionEngineStepAboutRuleAssociatedToEndpointList', 'data-test-subj': 'detectionEngineStepAboutRuleAssociatedToEndpointList', euiFieldProps: { - fullWidth: true, - isDisabled: isLoading, + disabled: isLoading || !canUseExceptions, }, }} /> @@ -287,8 +272,7 @@ const StepAboutRuleComponent: FC = ({ idAria: 'detectionEngineStepAboutRuleBuildingBlock', 'data-test-subj': 'detectionEngineStepAboutRuleBuildingBlock', euiFieldProps: { - fullWidth: true, - isDisabled: isLoading, + disabled: isLoading, }, }} /> @@ -319,7 +303,7 @@ const StepAboutRuleComponent: FC = ({ placeholder: '', }} /> - + {({ severity }) => { const newRiskScore = defaultRiskScoreBySeverity[severity as SeverityValue]; diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/details/index.tsx b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/details/index.tsx index 7eb5c3a535377..484c28b4b428c 100644 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/details/index.tsx +++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/details/index.tsx @@ -37,7 +37,7 @@ import { } from '../../../../../common/components/link_to/redirect_to_detection_engine'; import { SiemSearchBar } from '../../../../../common/components/search_bar'; import { WrapperPage } from '../../../../../common/components/wrapper_page'; -import { useRule } from '../../../../containers/detection_engine/rules'; +import { useRule, Rule } from '../../../../containers/detection_engine/rules'; import { useListsConfig } from '../../../../containers/detection_engine/lists/use_lists_config'; import { useWithSource } from '../../../../../common/containers/source'; @@ -90,6 +90,8 @@ import { MIN_EVENTS_VIEWER_BODY_HEIGHT, } from '../../../../../timelines/components/timeline/body/helpers'; import { footerHeight } from '../../../../../timelines/components/timeline/footer'; +import { isMlRule } from '../../../../../../common/machine_learning/helpers'; +import { isThresholdRule } from '../../../../../../common/detection_engine/utils'; enum RuleDetailTabs { alerts = 'alerts', @@ -97,23 +99,26 @@ enum RuleDetailTabs { exceptions = 'exceptions', } -const ruleDetailTabs = [ - { - id: RuleDetailTabs.alerts, - name: detectionI18n.ALERT, - disabled: false, - }, - { - id: RuleDetailTabs.exceptions, - name: i18n.EXCEPTIONS_TAB, - disabled: false, - }, - { - id: RuleDetailTabs.failures, - name: i18n.FAILURE_HISTORY_TAB, - disabled: false, - }, -]; +const getRuleDetailsTabs = (rule: Rule | null) => { + const canUseExceptions = rule && !isMlRule(rule.type) && !isThresholdRule(rule.type); + return [ + { + id: RuleDetailTabs.alerts, + name: detectionI18n.ALERT, + disabled: false, + }, + { + id: RuleDetailTabs.exceptions, + name: i18n.EXCEPTIONS_TAB, + disabled: !canUseExceptions, + }, + { + id: RuleDetailTabs.failures, + name: i18n.FAILURE_HISTORY_TAB, + disabled: false, + }, + ]; +}; export const RuleDetailsPageComponent: FC = ({ filters, @@ -160,6 +165,7 @@ export const RuleDetailsPageComponent: FC = ({ // TODO: Refactor license check + hasMlAdminPermissions to common check const hasMlPermissions = mlCapabilities.isPlatinumOrTrialLicense && hasMlAdminPermissions(mlCapabilities); + const ruleDetailTabs = getRuleDetailsTabs(rule); const title = isLoading === true || rule === null ? : rule.name; const subTitle = useMemo( From 55da30d17a7489a95c158b5cea01b5ddb785dbc9 Mon Sep 17 00:00:00 2001 From: spalger Date: Thu, 16 Jul 2020 19:11:08 -0700 Subject: [PATCH 06/59] skip flaky suite (#64696) --- x-pack/test/api_integration/apis/fleet/unenroll_agent.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/test/api_integration/apis/fleet/unenroll_agent.ts b/x-pack/test/api_integration/apis/fleet/unenroll_agent.ts index bc6c44e590cc4..4e1443ad1fc68 100644 --- a/x-pack/test/api_integration/apis/fleet/unenroll_agent.ts +++ b/x-pack/test/api_integration/apis/fleet/unenroll_agent.ts @@ -16,7 +16,8 @@ export default function (providerContext: FtrProviderContext) { const supertest = getService('supertest'); const esClient = getService('es'); - describe('fleet_unenroll_agent', () => { + // FLAKY: https://github.com/elastic/kibana/issues/64696 + describe.skip('fleet_unenroll_agent', () => { let accessAPIKeyId: string; let outputAPIKeyId: string; before(async () => { From effab78a94524a6ab428b57f407a045f27ae4954 Mon Sep 17 00:00:00 2001 From: Ryland Herrick Date: Thu, 16 Jul 2020 23:00:22 -0500 Subject: [PATCH 07/59] [Security Solution][Detections] Better toast errors (#72205) * Add new hook to wrap the toasts service When receiving error responses from our APIs, this gives us better toast messages. * Replace useToasts with useAppToasts in trivial case * WIP: prevent infinite polling when server is unresponsive The crux of this issue was that we had no steady state when the server returned a non-API error (!isApiError), as it would if the server was throwing 500s or just generally misbehaving. The solution, then, is to addresse these non-API errors in our underlying useListsIndex and useListsPrivileges hooks. This also refactors those hooks to: * collapse multiple error states into one (that's all we currently need) * use useAppToasts for better UI TODO: I don't think I need the changes in useListsConfig's useEffect. * Slightly more legible variables The only task in this hook is our readPrivileges task right now, so I'm shortening the variable until we have a need to disambiguate it further. * Remove unnecessary conditions around creating our index If the index hook has an error needsIndex will not be true. * Better toast errors for Kibana API errors Our isApiError predicate does not work for errors coming back from Kibana platform itself, e.g. for a request payload error. I've added a separate predicate for that case, isKibanaError, and then a wrapping isAppError predicate since most of our use cases just care about error.body.message, which is common to both. * Use new toasts hook on our exceptions modals This fixes two issues: * toast appears above modal overlay * Error message from response is now presented in the toast * Fix bug with toasts dependencies Because of the way some of the exception modal's hooks are written, a change to one of its callbacks means that the request will be canceled. Because the toasts service exports instance methods, the context within the function (and thus the function itself) can change leading to a mutable ref. Because we don't want/need this behavior, we store our exported functions in refs to 'freeze' them for react. With our bound functions, we should now be able to declare e.g. `toast.addError` as a dependency, however react cannot determine that it is bound (and thus that toast.addError() is equivalent to addError()), and so we must destructure our functions in order to use them as dependencies. * Alert clipboard toasts through new Toasts service This fixes the z-index issue between modals and toasts. * Fix type errors * Mock external dependency These tests now call out to the Notifications service (in a context) instead of our redux implementation. --- .../exceptions/add_exception_modal/index.tsx | 12 ++-- .../exceptions/edit_exception_modal/index.tsx | 12 ++-- .../viewer/exception_item/index.test.tsx | 2 + .../common/components/toasters/utils.ts | 4 +- .../common/hooks/use_app_toasts.test.ts | 63 +++++++++++++++++ .../public/common/hooks/use_app_toasts.ts | 48 +++++++++++++ .../public/common/lib/clipboard/clipboard.tsx | 23 ++----- .../common/lib/kibana/__mocks__/index.ts | 2 + .../public/common/utils/api/index.ts | 23 ++++++- .../value_lists_management_modal/modal.tsx | 13 ++-- .../alerts/use_signal_index.tsx | 6 +- .../lists/use_lists_config.tsx | 6 +- .../lists/use_lists_index.tsx | 69 ++++++++----------- .../lists/use_lists_privileges.tsx | 29 ++++---- 14 files changed, 211 insertions(+), 101 deletions(-) create mode 100644 x-pack/plugins/security_solution/public/common/hooks/use_app_toasts.test.ts create mode 100644 x-pack/plugins/security_solution/public/common/hooks/use_app_toasts.ts diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/add_exception_modal/index.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/add_exception_modal/index.tsx index d5eeef0f1e768..79383676266f5 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/add_exception_modal/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/add_exception_modal/index.tsx @@ -29,8 +29,8 @@ import { } from '../../../../../public/lists_plugin_deps'; import * as i18n from './translations'; import { TimelineNonEcsData, Ecs } from '../../../../graphql/types'; +import { useAppToasts } from '../../../hooks/use_app_toasts'; import { useKibana } from '../../../lib/kibana'; -import { errorToToaster, displaySuccessToast, useStateToaster } from '../../toasters'; import { ExceptionBuilder } from '../builder'; import { Loader } from '../../loader'; import { useAddOrUpdateException } from '../use_add_exception'; @@ -115,7 +115,7 @@ export const AddExceptionModal = memo(function AddExceptionModal({ Array >([]); const [fetchOrCreateListError, setFetchOrCreateListError] = useState(false); - const [, dispatchToaster] = useStateToaster(); + const { addError, addSuccess } = useAppToasts(); const { loading: isSignalIndexLoading, signalIndexName } = useSignalIndex(); const [{ isLoading: indexPatternLoading, indexPatterns }] = useFetchIndexPatterns( @@ -124,15 +124,15 @@ export const AddExceptionModal = memo(function AddExceptionModal({ const onError = useCallback( (error: Error) => { - errorToToaster({ title: i18n.ADD_EXCEPTION_ERROR, error, dispatchToaster }); + addError(error, { title: i18n.ADD_EXCEPTION_ERROR }); onCancel(); }, - [dispatchToaster, onCancel] + [addError, onCancel] ); const onSuccess = useCallback(() => { - displaySuccessToast(i18n.ADD_EXCEPTION_SUCCESS, dispatchToaster); + addSuccess(i18n.ADD_EXCEPTION_SUCCESS); onConfirm(shouldCloseAlert); - }, [dispatchToaster, onConfirm, shouldCloseAlert]); + }, [addSuccess, onConfirm, shouldCloseAlert]); const [{ isLoading: addExceptionIsLoading }, addOrUpdateExceptionItems] = useAddOrUpdateException( { diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/edit_exception_modal/index.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/edit_exception_modal/index.tsx index 73933d483e2cb..dbc70dfe21dd0 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/edit_exception_modal/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/edit_exception_modal/index.tsx @@ -30,7 +30,7 @@ import { } from '../../../../../public/lists_plugin_deps'; import * as i18n from './translations'; import { useKibana } from '../../../lib/kibana'; -import { errorToToaster, displaySuccessToast, useStateToaster } from '../../toasters'; +import { useAppToasts } from '../../../hooks/use_app_toasts'; import { ExceptionBuilder } from '../builder'; import { useAddOrUpdateException } from '../use_add_exception'; import { AddExceptionComments } from '../add_exception_comments'; @@ -93,7 +93,7 @@ export const EditExceptionModal = memo(function EditExceptionModal({ const [exceptionItemsToAdd, setExceptionItemsToAdd] = useState< Array >([]); - const [, dispatchToaster] = useStateToaster(); + const { addError, addSuccess } = useAppToasts(); const { loading: isSignalIndexLoading, signalIndexName } = useSignalIndex(); const [{ isLoading: indexPatternLoading, indexPatterns }] = useFetchIndexPatterns( @@ -102,15 +102,15 @@ export const EditExceptionModal = memo(function EditExceptionModal({ const onError = useCallback( (error) => { - errorToToaster({ title: i18n.EDIT_EXCEPTION_ERROR, error, dispatchToaster }); + addError(error, { title: i18n.EDIT_EXCEPTION_ERROR }); onCancel(); }, - [dispatchToaster, onCancel] + [addError, onCancel] ); const onSuccess = useCallback(() => { - displaySuccessToast(i18n.EDIT_EXCEPTION_SUCCESS, dispatchToaster); + addSuccess(i18n.EDIT_EXCEPTION_SUCCESS); onConfirm(); - }, [dispatchToaster, onConfirm]); + }, [addSuccess, onConfirm]); const [{ isLoading: addExceptionIsLoading }, addOrUpdateExceptionItems] = useAddOrUpdateException( { diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/index.test.tsx index 0e2908fc34232..90752f9450e4c 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/index.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/index.test.tsx @@ -13,6 +13,8 @@ import { ExceptionItem } from './'; import { getExceptionListItemSchemaMock } from '../../../../../../../lists/common/schemas/response/exception_list_item_schema.mock'; import { getCommentsArrayMock } from '../../../../../../../lists/common/schemas/types/comments.mock'; +jest.mock('../../../../lib/kibana'); + describe('ExceptionItem', () => { it('it renders ExceptionDetails and ExceptionEntries', () => { const exceptionItem = getExceptionListItemSchemaMock(); diff --git a/x-pack/plugins/security_solution/public/common/components/toasters/utils.ts b/x-pack/plugins/security_solution/public/common/components/toasters/utils.ts index e7cc389d4c06b..47c5588a12830 100644 --- a/x-pack/plugins/security_solution/public/common/components/toasters/utils.ts +++ b/x-pack/plugins/security_solution/public/common/components/toasters/utils.ts @@ -9,7 +9,7 @@ import { isError } from 'lodash/fp'; import { AppToast, ActionToaster } from './'; import { isToasterError } from './errors'; -import { isApiError } from '../../utils/api'; +import { isAppError } from '../../utils/api'; /** * Displays an error toast for the provided title and message @@ -114,7 +114,7 @@ export const errorToToaster = ({ iconType, errors: error.messages, }; - } else if (isApiError(error)) { + } else if (isAppError(error)) { toast = { id, title, diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_app_toasts.test.ts b/x-pack/plugins/security_solution/public/common/hooks/use_app_toasts.test.ts new file mode 100644 index 0000000000000..e0e629793952a --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/hooks/use_app_toasts.test.ts @@ -0,0 +1,63 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { renderHook } from '@testing-library/react-hooks'; + +import { useToasts } from '../lib/kibana'; +import { useAppToasts } from './use_app_toasts'; + +jest.mock('../lib/kibana'); + +describe('useDeleteList', () => { + let addErrorMock: jest.Mock; + let addSuccessMock: jest.Mock; + + beforeEach(() => { + addErrorMock = jest.fn(); + addSuccessMock = jest.fn(); + (useToasts as jest.Mock).mockImplementation(() => ({ + addError: addErrorMock, + addSuccess: addSuccessMock, + })); + }); + + it('works normally with a regular error', async () => { + const error = new Error('regular error'); + const { result } = renderHook(() => useAppToasts()); + + result.current.addError(error, { title: 'title' }); + + expect(addErrorMock).toHaveBeenCalledWith(error, { title: 'title' }); + }); + + it("uses a AppError's body.message as the toastMessage", async () => { + const kibanaApiError = { + message: 'Not Found', + body: { status_code: 404, message: 'Detailed Message' }, + }; + + const { result } = renderHook(() => useAppToasts()); + + result.current.addError(kibanaApiError, { title: 'title' }); + + expect(addErrorMock).toHaveBeenCalledWith(kibanaApiError, { + title: 'title', + toastMessage: 'Detailed Message', + }); + }); + + it('converts an unknown error to an Error', () => { + const unknownError = undefined; + + const { result } = renderHook(() => useAppToasts()); + + result.current.addError(unknownError, { title: 'title' }); + + expect(addErrorMock).toHaveBeenCalledWith(Error(`${undefined}`), { + title: 'title', + }); + }); +}); diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_app_toasts.ts b/x-pack/plugins/security_solution/public/common/hooks/use_app_toasts.ts new file mode 100644 index 0000000000000..bc59d87100058 --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/hooks/use_app_toasts.ts @@ -0,0 +1,48 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { useCallback, useRef } from 'react'; + +import { ErrorToastOptions, ToastsStart, Toast } from '../../../../../../src/core/public'; +import { useToasts } from '../lib/kibana'; +import { isAppError, AppError } from '../utils/api'; + +export type UseAppToasts = Pick & { + api: ToastsStart; + addError: (error: unknown, options: ErrorToastOptions) => Toast; +}; + +export const useAppToasts = (): UseAppToasts => { + const toasts = useToasts(); + const addError = useRef(toasts.addError.bind(toasts)).current; + const addSuccess = useRef(toasts.addSuccess.bind(toasts)).current; + + const addAppError = useCallback( + (error: AppError, options: ErrorToastOptions) => + addError(error, { + ...options, + toastMessage: error.body.message, + }), + [addError] + ); + + const _addError = useCallback( + (error: unknown, options: ErrorToastOptions) => { + if (isAppError(error)) { + return addAppError(error, options); + } else { + if (error instanceof Error) { + return addError(error, options); + } else { + return addError(new Error(String(error)), options); + } + } + }, + [addAppError, addError] + ); + + return { api: toasts, addError: _addError, addSuccess }; +}; diff --git a/x-pack/plugins/security_solution/public/common/lib/clipboard/clipboard.tsx b/x-pack/plugins/security_solution/public/common/lib/clipboard/clipboard.tsx index fdb6ed130a525..75b7308ab61f1 100644 --- a/x-pack/plugins/security_solution/public/common/lib/clipboard/clipboard.tsx +++ b/x-pack/plugins/security_solution/public/common/lib/clipboard/clipboard.tsx @@ -4,13 +4,12 @@ * you may not use this file except in compliance with the Elastic License. */ -import { EuiGlobalToastListToast as Toast, EuiButtonIcon } from '@elastic/eui'; +import { EuiButtonIcon } from '@elastic/eui'; import copy from 'copy-to-clipboard'; import React from 'react'; -import uuid from 'uuid'; import * as i18n from './translations'; -import { useStateToaster } from '../../components/toasters'; +import { useAppToasts } from '../../hooks/use_app_toasts'; export type OnCopy = ({ content, @@ -20,17 +19,6 @@ export type OnCopy = ({ isSuccess: boolean; }) => void; -interface GetSuccessToastParams { - titleSummary?: string; -} - -const getSuccessToast = ({ titleSummary }: GetSuccessToastParams): Toast => ({ - id: `copy-success-${uuid.v4()}`, - color: 'success', - iconType: 'copyClipboard', - title: `${i18n.COPIED} ${titleSummary} ${i18n.TO_THE_CLIPBOARD}`, -}); - interface Props { children?: JSX.Element; content: string | number; @@ -40,7 +28,7 @@ interface Props { } export const Clipboard = ({ children, content, onCopy, titleSummary, toastLifeTimeMs }: Props) => { - const dispatchToaster = useStateToaster()[1]; + const { addSuccess } = useAppToasts(); const onClick = (event: React.MouseEvent) => { event.preventDefault(); event.stopPropagation(); @@ -52,10 +40,7 @@ export const Clipboard = ({ children, content, onCopy, titleSummary, toastLifeTi } if (isSuccess) { - dispatchToaster({ - type: 'addToaster', - toast: { toastLifeTimeMs, ...getSuccessToast({ titleSummary }) }, - }); + addSuccess(`${i18n.COPIED} ${titleSummary} ${i18n.TO_THE_CLIPBOARD}`, { toastLifeTimeMs }); } }; diff --git a/x-pack/plugins/security_solution/public/common/lib/kibana/__mocks__/index.ts b/x-pack/plugins/security_solution/public/common/lib/kibana/__mocks__/index.ts index c3e1f35f37356..6ada887ece175 100644 --- a/x-pack/plugins/security_solution/public/common/lib/kibana/__mocks__/index.ts +++ b/x-pack/plugins/security_solution/public/common/lib/kibana/__mocks__/index.ts @@ -4,6 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ +import { notificationServiceMock } from '../../../../../../../../src/core/public/mocks'; import { createKibanaContextProviderMock, createUseUiSettingMock, @@ -19,6 +20,7 @@ export const useUiSetting$ = jest.fn(createUseUiSetting$Mock()); export const useTimeZone = jest.fn(); export const useDateFormat = jest.fn(); export const useBasePath = jest.fn(() => '/test/base/path'); +export const useToasts = jest.fn(() => notificationServiceMock.createStartContract().toasts); export const useCurrentUser = jest.fn(); export const withKibana = jest.fn(createWithKibanaMock()); export const KibanaContextProvider = jest.fn(createKibanaContextProviderMock()); diff --git a/x-pack/plugins/security_solution/public/common/utils/api/index.ts b/x-pack/plugins/security_solution/public/common/utils/api/index.ts index ab442d0d09cf9..e8934259fe43e 100644 --- a/x-pack/plugins/security_solution/public/common/utils/api/index.ts +++ b/x-pack/plugins/security_solution/public/common/utils/api/index.ts @@ -6,14 +6,33 @@ import { has } from 'lodash/fp'; -export interface KibanaApiError { +export interface AppError { name: string; message: string; + body: { + message: string; + }; +} + +export interface KibanaError extends AppError { + body: { + message: string; + statusCode: number; + }; +} + +export interface SecurityAppError extends AppError { body: { message: string; status_code: number; }; } -export const isApiError = (error: unknown): error is KibanaApiError => +export const isKibanaError = (error: unknown): error is KibanaError => + has('message', error) && has('body.message', error) && has('body.statusCode', error); + +export const isSecurityAppError = (error: unknown): error is SecurityAppError => has('message', error) && has('body.message', error) && has('body.status_code', error); + +export const isAppError = (error: unknown): error is AppError => + isKibanaError(error) || isSecurityAppError(error); diff --git a/x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal/modal.tsx b/x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal/modal.tsx index 0a935a9cdb1c4..d7d4be6d951b8 100644 --- a/x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal/modal.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal/modal.tsx @@ -23,7 +23,8 @@ import { useDeleteList, useCursor, } from '../../../shared_imports'; -import { useToasts, useKibana } from '../../../common/lib/kibana'; +import { useKibana } from '../../../common/lib/kibana'; +import { useAppToasts } from '../../../common/hooks/use_app_toasts'; import { GenericDownloader } from '../../../common/components/generic_downloader'; import * as i18n from './translations'; import { ValueListsTable } from './table'; @@ -45,7 +46,7 @@ export const ValueListsModalComponent: React.FC = ({ const { start: findLists, ...lists } = useFindLists(); const { start: deleteList, result: deleteResult } = useDeleteList(); const [exportListId, setExportListId] = useState(); - const toasts = useToasts(); + const { addError, addSuccess } = useAppToasts(); const fetchLists = useCallback(() => { findLists({ cursor, http, pageIndex: pageIndex + 1, pageSize }); @@ -82,21 +83,21 @@ export const ValueListsModalComponent: React.FC = ({ const handleUploadError = useCallback( (error: Error) => { if (error.name !== 'AbortError') { - toasts.addError(error, { title: i18n.UPLOAD_ERROR }); + addError(error, { title: i18n.UPLOAD_ERROR }); } }, - [toasts] + [addError] ); const handleUploadSuccess = useCallback( (response: ListSchema) => { - toasts.addSuccess({ + addSuccess({ text: i18n.uploadSuccessMessage(response.name), title: i18n.UPLOAD_SUCCESS_TITLE, }); fetchLists(); }, // eslint-disable-next-line react-hooks/exhaustive-deps - [toasts] + [addSuccess] ); useEffect(() => { diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_signal_index.tsx b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_signal_index.tsx index 65a2721013b5e..14fd9ffa50843 100644 --- a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_signal_index.tsx +++ b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_signal_index.tsx @@ -9,7 +9,7 @@ import { useEffect, useState } from 'react'; import { errorToToaster, useStateToaster } from '../../../../common/components/toasters'; import { createSignalIndex, getSignalIndex } from './api'; import * as i18n from './translations'; -import { isApiError } from '../../../../common/utils/api'; +import { isSecurityAppError } from '../../../../common/utils/api'; type Func = () => void; @@ -59,7 +59,7 @@ export const useSignalIndex = (): ReturnSignalIndex => { signalIndexName: null, createDeSignalIndex: createIndex, }); - if (isApiError(error) && error.body.status_code !== 404) { + if (isSecurityAppError(error) && error.body.status_code !== 404) { errorToToaster({ title: i18n.SIGNAL_GET_NAME_FAILURE, error, dispatchToaster }); } } @@ -81,7 +81,7 @@ export const useSignalIndex = (): ReturnSignalIndex => { } } catch (error) { if (isSubscribed) { - if (isApiError(error) && error.body.status_code === 409) { + if (isSecurityAppError(error) && error.body.status_code === 409) { fetchData(); } else { setSignalIndex({ diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_config.tsx b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_config.tsx index e21cbceeaef27..71847e7b7d8cb 100644 --- a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_config.tsx +++ b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_config.tsx @@ -19,16 +19,16 @@ export interface UseListsConfigReturn { } export const useListsConfig = (): UseListsConfigReturn => { - const { createIndex, createIndexError, indexExists, loading: indexLoading } = useListsIndex(); + const { createIndex, indexExists, loading: indexLoading, error: indexError } = useListsIndex(); const { canManageIndex, canWriteIndex, loading: privilegesLoading } = useListsPrivileges(); const { lists } = useKibana().services; const enabled = lists != null; const loading = indexLoading || privilegesLoading; const needsIndex = indexExists === false; - const indexCreationFailed = createIndexError != null; + const hasIndexError = indexError != null; const needsIndexConfiguration = - needsIndex && (canManageIndex === false || (canManageIndex === true && indexCreationFailed)); + needsIndex && (canManageIndex === false || (canManageIndex === true && hasIndexError)); const needsConfiguration = !enabled || canWriteIndex === false || needsIndexConfiguration; useEffect(() => { diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_index.tsx b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_index.tsx index 75f12bd07d3ae..ee1316eb8a1fd 100644 --- a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_index.tsx +++ b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_index.tsx @@ -7,28 +7,24 @@ import { useEffect, useState, useCallback } from 'react'; import { useReadListIndex, useCreateListIndex } from '../../../../shared_imports'; -import { useHttp, useToasts, useKibana } from '../../../../common/lib/kibana'; -import { isApiError } from '../../../../common/utils/api'; +import { useHttp, useKibana } from '../../../../common/lib/kibana'; +import { isSecurityAppError } from '../../../../common/utils/api'; import * as i18n from './translations'; +import { useAppToasts } from '../../../../common/hooks/use_app_toasts'; -export interface UseListsIndexState { +export interface UseListsIndexReturn { + createIndex: () => void; indexExists: boolean | null; -} - -export interface UseListsIndexReturn extends UseListsIndexState { + error: unknown; loading: boolean; - createIndex: () => void; - createIndexError: unknown; - createIndexResult: { acknowledged: boolean } | undefined; } export const useListsIndex = (): UseListsIndexReturn => { - const [state, setState] = useState({ - indexExists: null, - }); + const [indexExists, setIndexExists] = useState(null); + const [error, setError] = useState(null); const { lists } = useKibana().services; const http = useHttp(); - const toasts = useToasts(); + const { addError } = useAppToasts(); const { loading: readLoading, start: readListIndex, ...readListIndexState } = useReadListIndex(); const { loading: createLoading, @@ -51,18 +47,17 @@ export const useListsIndex = (): UseListsIndexReturn => { // initial read list useEffect(() => { - if (!readLoading && state.indexExists === null) { + if (!readLoading && !error && indexExists === null) { readIndex(); } - }, [readIndex, readLoading, state.indexExists]); + }, [error, indexExists, readIndex, readLoading]); // handle read result useEffect(() => { if (readListIndexState.result != null) { - setState({ - indexExists: - readListIndexState.result.list_index && readListIndexState.result.list_item_index, - }); + setIndexExists( + readListIndexState.result.list_index && readListIndexState.result.list_item_index + ); } }, [readListIndexState.result]); @@ -75,34 +70,30 @@ export const useListsIndex = (): UseListsIndexReturn => { // handle read error useEffect(() => { - const error = readListIndexState.error; - if (isApiError(error)) { - setState({ indexExists: false }); - if (error.body.status_code !== 404) { - toasts.addError(error, { - title: i18n.LISTS_INDEX_FETCH_FAILURE, - toastMessage: error.body.message, - }); + const err = readListIndexState.error; + if (err != null) { + if (isSecurityAppError(err) && err.body.status_code === 404) { + setIndexExists(false); + } else { + setError(err); + addError(err, { title: i18n.LISTS_INDEX_FETCH_FAILURE }); } } - }, [readListIndexState.error, toasts]); + }, [addError, readListIndexState.error]); // handle create error useEffect(() => { - const error = createListIndexState.error; - if (isApiError(error)) { - toasts.addError(error, { - title: i18n.LISTS_INDEX_CREATE_FAILURE, - toastMessage: error.body.message, - }); + const err = createListIndexState.error; + if (err != null) { + setError(err); + addError(err, { title: i18n.LISTS_INDEX_CREATE_FAILURE }); } - }, [createListIndexState.error, toasts]); + }, [addError, createListIndexState.error]); return { - loading, createIndex, - createIndexError: createListIndexState.error, - createIndexResult: createListIndexState.result, - ...state, + error, + indexExists, + loading, }; }; diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_privileges.tsx b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_privileges.tsx index fbbcff33402c3..f99f62b1948e6 100644 --- a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_privileges.tsx +++ b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_privileges.tsx @@ -7,8 +7,8 @@ import { useEffect, useState, useCallback } from 'react'; import { useReadListPrivileges } from '../../../../shared_imports'; -import { useHttp, useToasts, useKibana } from '../../../../common/lib/kibana'; -import { isApiError } from '../../../../common/utils/api'; +import { useHttp, useKibana } from '../../../../common/lib/kibana'; +import { useAppToasts } from '../../../../common/hooks/use_app_toasts'; import * as i18n from './translations'; export interface UseListsPrivilegesState { @@ -79,8 +79,8 @@ export const useListsPrivileges = (): UseListsPrivilegesReturn => { }); const { lists } = useKibana().services; const http = useHttp(); - const toasts = useToasts(); - const { loading, start: readListPrivileges, ...privilegesState } = useReadListPrivileges(); + const { addError } = useAppToasts(); + const { loading, start: readListPrivileges, ...readState } = useReadListPrivileges(); const readPrivileges = useCallback(() => { if (lists) { @@ -90,20 +90,20 @@ export const useListsPrivileges = (): UseListsPrivilegesReturn => { // initRead useEffect(() => { - if (!loading && state.isAuthenticated === null) { + if (!loading && !readState.error && state.isAuthenticated === null) { readPrivileges(); } - }, [loading, readPrivileges, state.isAuthenticated]); + }, [loading, readState.error, readPrivileges, state.isAuthenticated]); // handleReadResult useEffect(() => { - if (privilegesState.result != null) { + if (readState.result != null) { try { const { is_authenticated: isAuthenticated, lists: { index: listsPrivileges }, listItems: { index: listItemsPrivileges }, - } = privilegesState.result as ListPrivileges; + } = readState.result as ListPrivileges; setState({ isAuthenticated, @@ -114,19 +114,18 @@ export const useListsPrivileges = (): UseListsPrivilegesReturn => { setState({ isAuthenticated: null, canManageIndex: false, canWriteIndex: false }); } } - }, [privilegesState.result]); + }, [readState.result]); // handleReadError useEffect(() => { - const error = privilegesState.error; - if (isApiError(error)) { - setState({ isAuthenticated: null, canManageIndex: false, canWriteIndex: false }); - toasts.addError(error, { + const error = readState.error; + if (error != null) { + setState({ isAuthenticated: false, canManageIndex: false, canWriteIndex: false }); + addError(error, { title: i18n.LISTS_PRIVILEGES_READ_FAILURE, - toastMessage: error.body.message, }); } - }, [privilegesState.error, toasts]); + }, [addError, readState.error]); return { loading, ...state }; }; From 5cd1f6e562a558a6d725806e6a5bc5eb722c4b57 Mon Sep 17 00:00:00 2001 From: Jen Huang Date: Thu, 16 Jul 2020 22:42:28 -0700 Subject: [PATCH 08/59] Call setupIngest before fleet_install tests (#72214) --- x-pack/test/api_integration/apis/fleet/install.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/x-pack/test/api_integration/apis/fleet/install.ts b/x-pack/test/api_integration/apis/fleet/install.ts index 3a122463fae55..59b040e30fb48 100644 --- a/x-pack/test/api_integration/apis/fleet/install.ts +++ b/x-pack/test/api_integration/apis/fleet/install.ts @@ -6,11 +6,15 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../ftr_provider_context'; +import { setupIngest } from './agents/services'; -export default function ({ getService }: FtrProviderContext) { +export default function (providerContext: FtrProviderContext) { + const { getService } = providerContext; const supertest = getService('supertest'); describe('fleet_install', () => { + setupIngest(providerContext); + it('should return a 400 if we try download an install script for a not supported OS', async () => { await supertest.get(`/api/ingest_manager/fleet/install/gameboy`).expect(400); }); From 6164037f18b4d715f16bc42fc932576d089692c3 Mon Sep 17 00:00:00 2001 From: patrykkopycinski Date: Fri, 17 Jul 2020 09:14:37 +0200 Subject: [PATCH 09/59] Fix value for process.hash.sha256 draggable (#72142) --- .../system/generic_file_details.test.tsx | 18 ++++++++++++++++++ .../renderers/system/generic_file_details.tsx | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_file_details.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_file_details.test.tsx index 2c207ea8a1562..dd5b182c8c124 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_file_details.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_file_details.test.tsx @@ -11,6 +11,7 @@ import { BrowserFields } from '../../../../../../common/containers/source'; import { mockBrowserFields } from '../../../../../../common/containers/source/mock'; import '../../../../../../common/mock/match_media'; import { mockTimelineData, TestProviders } from '../../../../../../common/mock'; +import { mockEndgameCreationEvent } from '../../../../../../common/mock/mock_endgame_ecs_data'; import { SystemGenericFileDetails, SystemGenericFileLine } from './generic_file_details'; import { useMountAppended } from '../../../../../../common/utils/use_mount_appended'; @@ -61,6 +62,23 @@ describe('SystemGenericFileDetails', () => { 'Evan@zeek-london[generic-text-123](6278)with resultfailureSource128.199.212.120' ); }); + + test('it passes string value for processHashSha256', () => { + const wrapper = mount( + + + + ); + expect(wrapper.find('SystemGenericFileLine').prop('processHashSha256')).toEqual( + 'd4c97ed46046893141652e2ec0056a698f6445109949d7fcabbce331146889ee' + ); + }); }); describe('#SystemGenericFileLine', () => { diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_file_details.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_file_details.tsx index 8dd513539a96a..3a95c0ea927c8 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_file_details.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_file_details.tsx @@ -240,7 +240,7 @@ export const SystemGenericFileDetails = React.memo( const packageVersion: string | null | undefined = get('system.audit.package.version[0]', data); const processHashMd5: string | null | undefined = get('process.hash.md5[0]', data); const processHashSha1: string | null | undefined = get('process.hash.sha1[0]', data); - const processHashSha256: string | null | undefined = get('process.hash.sha256', data); + const processHashSha256: string | null | undefined = get('process.hash.sha256[0]', data); const processPid: number | null | undefined = get('process.pid[0]', data); const processPpid: number | null | undefined = get('process.ppid[0]', data); const processName: string | null | undefined = get('process.name[0]', data); From 99e14aad761ddc5f4db53d8e23815a85241c0bf0 Mon Sep 17 00:00:00 2001 From: Larry Gregory Date: Fri, 17 Jul 2020 05:38:55 -0400 Subject: [PATCH 10/59] Register navLink actions for declared applications (#72109) --- .../feature_privilege_builder/navlink.ts | 5 ++++- .../privileges/privileges.test.ts | 18 ++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/navlink.ts b/x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/navlink.ts index dd076477a9c11..f25632407be86 100644 --- a/x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/navlink.ts +++ b/x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/navlink.ts @@ -9,6 +9,9 @@ import { BaseFeaturePrivilegeBuilder } from './feature_privilege_builder'; export class FeaturePrivilegeNavlinkBuilder extends BaseFeaturePrivilegeBuilder { public getActions(privilegeDefinition: FeatureKibanaPrivileges, feature: Feature): string[] { - return feature.navLinkId ? [this.actions.ui.get('navLinks', feature.navLinkId)] : []; + const appNavLinks = feature.app.map((app) => this.actions.ui.get('navLinks', app)); + return feature.navLinkId + ? [this.actions.ui.get('navLinks', feature.navLinkId), ...appNavLinks] + : appNavLinks; } } diff --git a/x-pack/plugins/security/server/authorization/privileges/privileges.test.ts b/x-pack/plugins/security/server/authorization/privileges/privileges.test.ts index 8a499a3eba8fa..d8ece8f68d425 100644 --- a/x-pack/plugins/security/server/authorization/privileges/privileges.test.ts +++ b/x-pack/plugins/security/server/authorization/privileges/privileges.test.ts @@ -54,8 +54,20 @@ describe('features', () => { const actual = privileges.get(); expect(actual).toHaveProperty('features.foo-feature', { - all: [actions.login, actions.version, actions.ui.get('navLinks', 'kibana:foo')], - read: [actions.login, actions.version, actions.ui.get('navLinks', 'kibana:foo')], + all: [ + actions.login, + actions.version, + actions.ui.get('navLinks', 'kibana:foo'), + actions.ui.get('navLinks', 'app-1'), + actions.ui.get('navLinks', 'app-2'), + ], + read: [ + actions.login, + actions.version, + actions.ui.get('navLinks', 'kibana:foo'), + actions.ui.get('navLinks', 'app-1'), + actions.ui.get('navLinks', 'app-2'), + ], }); }); @@ -635,6 +647,8 @@ describe('reserved', () => { expect(actual).toHaveProperty('reserved.foo', [ actions.version, actions.ui.get('navLinks', 'kibana:foo'), + actions.ui.get('navLinks', 'app-1'), + actions.ui.get('navLinks', 'app-2'), ]); }); From 9296369bfd8cc3325460fd3e761e2a9648436bdb Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Fri, 17 Jul 2020 11:04:14 +0100 Subject: [PATCH 11/59] chore(NA): teardown dynamic dll plugin (#72096) * chore(NA): teardown dynamic dll plugin * chore(NA): remove missing ts-ignore * chore(NA): remove last mentions to the DLL machinery * chore(NA): update notice file * prevent duplication and searching target/public * remove changes to es-ui code to unblock pr * add node internals override for legacy tests bundle Co-authored-by: spalger Co-authored-by: Elastic Machine --- NOTICE.txt | 3 - package.json | 1 - packages/kbn-babel-code-parser/.babelrc | 3 - packages/kbn-babel-code-parser/README.md | 19 - packages/kbn-babel-code-parser/package.json | 26 -- .../kbn-babel-code-parser/src/can_require.js | 36 -- .../kbn-babel-code-parser/src/code_parser.js | 105 ----- packages/kbn-babel-code-parser/src/index.js | 22 -- .../kbn-babel-code-parser/src/strategies.js | 103 ----- .../src/strategies.test.js | 108 ------ .../kbn-babel-code-parser/src/visitors.js | 124 ------ .../src/visitors.test.js | 68 ---- packages/kbn-babel-code-parser/yarn.lock | 1 - src/dev/build/README.md | 11 - src/dev/build/build_distributables.js | 2 - src/dev/build/tasks/index.js | 1 - .../clean_client_modules_on_dll_task.js | 126 ------ .../tasks/nodejs_modules/get_dependencies.js | 27 -- src/dev/build/tasks/nodejs_modules/index.js | 20 - .../build/tasks/nodejs_modules/webpack_dll.js | 131 ------- .../tasks/nodejs_modules/webpack_dll.test.js | 123 ------ src/dev/build/tasks/optimize_task.js | 1 - src/dev/notice/generate_notice_from_source.ts | 9 +- src/legacy/core_plugins/tests_bundle/index.js | 7 + .../server/logging/log_format_string.js | 2 - src/legacy/ui/ui_render/ui_render_mixin.js | 11 - src/optimize/base_optimizer.js | 8 - .../bundles_route/__tests__/bundles_route.js | 12 - src/optimize/bundles_route/bundles_route.ts | 19 +- .../bundles_route/proxy_bundles_route.ts | 1 - .../dynamic_dll_plugin/dll_allowed_modules.js | 36 -- .../dynamic_dll_plugin/dll_compiler.js | 366 ------------------ .../dynamic_dll_plugin/dll_config_model.js | 278 ------------- .../dynamic_dll_plugin/dll_entry_template.js | 37 -- .../dynamic_dll_plugin/dynamic_dll_plugin.js | 354 ----------------- src/optimize/dynamic_dll_plugin/index.js | 21 - src/optimize/optimize_mixin.ts | 5 +- src/optimize/watch/optmzr_role.js | 10 - src/optimize/watch/watch.js | 2 +- src/optimize/watch/watch_cache.ts | 189 --------- src/optimize/watch/watch_optimizer.js | 6 - tasks/config/karma.js | 12 - 42 files changed, 15 insertions(+), 2431 deletions(-) delete mode 100644 packages/kbn-babel-code-parser/.babelrc delete mode 100755 packages/kbn-babel-code-parser/README.md delete mode 100755 packages/kbn-babel-code-parser/package.json delete mode 100644 packages/kbn-babel-code-parser/src/can_require.js delete mode 100644 packages/kbn-babel-code-parser/src/code_parser.js delete mode 100644 packages/kbn-babel-code-parser/src/index.js delete mode 100644 packages/kbn-babel-code-parser/src/strategies.js delete mode 100644 packages/kbn-babel-code-parser/src/strategies.test.js delete mode 100644 packages/kbn-babel-code-parser/src/visitors.js delete mode 100644 packages/kbn-babel-code-parser/src/visitors.test.js delete mode 120000 packages/kbn-babel-code-parser/yarn.lock delete mode 100644 src/dev/build/tasks/nodejs_modules/clean_client_modules_on_dll_task.js delete mode 100644 src/dev/build/tasks/nodejs_modules/get_dependencies.js delete mode 100644 src/dev/build/tasks/nodejs_modules/index.js delete mode 100644 src/dev/build/tasks/nodejs_modules/webpack_dll.js delete mode 100644 src/dev/build/tasks/nodejs_modules/webpack_dll.test.js delete mode 100644 src/optimize/dynamic_dll_plugin/dll_allowed_modules.js delete mode 100644 src/optimize/dynamic_dll_plugin/dll_compiler.js delete mode 100644 src/optimize/dynamic_dll_plugin/dll_config_model.js delete mode 100644 src/optimize/dynamic_dll_plugin/dll_entry_template.js delete mode 100644 src/optimize/dynamic_dll_plugin/dynamic_dll_plugin.js delete mode 100644 src/optimize/dynamic_dll_plugin/index.js delete mode 100644 src/optimize/watch/watch_cache.ts diff --git a/NOTICE.txt b/NOTICE.txt index 56280e6e3883e..e1552852d0349 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -26,9 +26,6 @@ This module was heavily inspired by the externals plugin that ships with webpack MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra ---- -This product has relied on ASTExplorer that is licensed under MIT. - --- This product includes code that is based on Ace editor, which was available under a "BSD" license. diff --git a/package.json b/package.json index 541fcc46a3d6e..593e8f82f0541 100644 --- a/package.json +++ b/package.json @@ -137,7 +137,6 @@ "@hapi/good-squeeze": "5.2.1", "@hapi/wreck": "^15.0.2", "@kbn/analytics": "1.0.0", - "@kbn/babel-code-parser": "1.0.0", "@kbn/babel-preset": "1.0.0", "@kbn/config-schema": "1.0.0", "@kbn/i18n": "1.0.0", diff --git a/packages/kbn-babel-code-parser/.babelrc b/packages/kbn-babel-code-parser/.babelrc deleted file mode 100644 index 7da72d1779128..0000000000000 --- a/packages/kbn-babel-code-parser/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"] -} diff --git a/packages/kbn-babel-code-parser/README.md b/packages/kbn-babel-code-parser/README.md deleted file mode 100755 index f99d01541ee22..0000000000000 --- a/packages/kbn-babel-code-parser/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @kbn/babel-code-parser - -Simple abstraction over the `@babel/parser` and the `@babel/traverse` in order -to build a code parser on top. - -We have two main functions `parseSingleFile` (sync and sync version) and the -`parseEntries` (only async version). The first one just parse one entry file -and the second one parses recursively all the files from a list of -start entry points. - -Then we have `visitors` and `strategies`. The first ones are basically the -`visitors` to use into the ast from the `@babel/traverse`. They are the only -way to collect info when using the `parseSingleFile`. The `strategies` are -meant to be used with the `parseEntries` and configures the info we want -to collect from our parsed code. After each loop, one per entry file, the -`parseEntries` method will call the given `strategy` expecting that -`strategy` would call the desired visitors, assemble the important -information to collect and adds them to the final results. - diff --git a/packages/kbn-babel-code-parser/package.json b/packages/kbn-babel-code-parser/package.json deleted file mode 100755 index 6f42c086ecaab..0000000000000 --- a/packages/kbn-babel-code-parser/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@kbn/babel-code-parser", - "description": "babel code parser for Kibana", - "private": true, - "version": "1.0.0", - "main": "./target/index.js", - "license": "Apache-2.0", - "repository": { - "type": "git", - "url": "https://github.com/elastic/kibana/tree/master/packages/kbn-babel-code-parser" - }, - "scripts": { - "build": "babel src --out-dir target", - "kbn:bootstrap": "yarn build --quiet", - "kbn:watch": "yarn build --watch" - }, - "devDependencies": { - "@babel/cli": "^7.10.1" - }, - "dependencies": { - "@kbn/babel-preset": "1.0.0", - "@babel/parser": "^7.10.2", - "@babel/traverse": "^7.10.1", - "lodash": "^4.17.15" - } -} diff --git a/packages/kbn-babel-code-parser/src/can_require.js b/packages/kbn-babel-code-parser/src/can_require.js deleted file mode 100644 index b410611237766..0000000000000 --- a/packages/kbn-babel-code-parser/src/can_require.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -export function canRequire(entry, cwd = require.resolve.paths(entry) || []) { - try { - // We will try to test if we can resolve - // this entry through the require.resolve - // setting as the start looking path the - // given cwd. That cwd variable could be - // a path or an array of paths - // from where Require.resolve will keep - // looking recursively as normal starting - // from those locations. - return require.resolve(entry, { - paths: [].concat(cwd), - }); - } catch (e) { - return false; - } -} diff --git a/packages/kbn-babel-code-parser/src/code_parser.js b/packages/kbn-babel-code-parser/src/code_parser.js deleted file mode 100644 index 91927780363ac..0000000000000 --- a/packages/kbn-babel-code-parser/src/code_parser.js +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { canRequire } from './can_require'; -import { readFile, readFileSync } from 'fs'; -import { extname } from 'path'; -import { promisify } from 'util'; -import * as parser from '@babel/parser'; -import traverse from '@babel/traverse'; -import * as babelParserOptions from '@kbn/babel-preset/common_babel_parser_options'; - -const read = promisify(readFile); - -function _cannotParseFile(filePath) { - return extname(filePath) !== '.js'; -} - -function _parseAndTraverseFileContent(fileContent, visitorsGenerator) { - const results = []; - - // Parse and get the code AST - // All the babel parser plugins - // were enabled - const ast = parser.parse(fileContent, babelParserOptions); - - // Loop through the code AST with - // the defined visitors - traverse(ast, visitorsGenerator(results)); - - return results; -} - -export async function parseSingleFile(filePath, visitorsGenerator) { - // Don't parse any other files than .js ones - if (_cannotParseFile(filePath)) { - return []; - } - - // Read the file - const content = await read(filePath, { encoding: 'utf8' }); - - // return the results found on parse and traverse - // the file content with the given visitors - return _parseAndTraverseFileContent(content, visitorsGenerator); -} - -export function parseSingleFileSync(filePath, visitorsGenerator) { - // Don't parse any other files than .js ones - if (_cannotParseFile(filePath)) { - return []; - } - - // Read the file - const content = readFileSync(filePath, { encoding: 'utf8' }); - - // return the results found on parse and traverse - // the file content with the given visitors - return _parseAndTraverseFileContent(content, visitorsGenerator); -} - -export async function parseEntries(cwd, entries, strategy, results, wasParsed = {}) { - // Assure that we always have a cwd - const sanitizedCwd = cwd || process.cwd(); - - // Test each entry against canRequire function - const entriesQueue = entries.map((entry) => canRequire(entry)); - - while (entriesQueue.length) { - // Get the first element in the queue as - // select it as our current entry to parse - const mainEntry = entriesQueue.shift(); - - // Avoid parse the current entry if it is not valid - // or it was already parsed - if (typeof mainEntry !== 'string' || wasParsed[mainEntry]) { - continue; - } - - // Find new entries and adds them to the end of the queue - entriesQueue.push( - ...(await strategy(sanitizedCwd, parseSingleFile, mainEntry, wasParsed, results)) - ); - - // Mark the current main entry as already parsed - wasParsed[mainEntry] = true; - } - - return results; -} diff --git a/packages/kbn-babel-code-parser/src/index.js b/packages/kbn-babel-code-parser/src/index.js deleted file mode 100644 index 70e4eb18068b0..0000000000000 --- a/packages/kbn-babel-code-parser/src/index.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -export { dependenciesParseStrategy } from './strategies'; -export { dependenciesVisitorsGenerator } from './visitors'; -export { parseSingleFile, parseSingleFileSync, parseEntries } from './code_parser'; diff --git a/packages/kbn-babel-code-parser/src/strategies.js b/packages/kbn-babel-code-parser/src/strategies.js deleted file mode 100644 index 2369692ad434b..0000000000000 --- a/packages/kbn-babel-code-parser/src/strategies.js +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { canRequire } from './can_require'; -import { dependenciesVisitorsGenerator } from './visitors'; -import { dirname, isAbsolute, resolve } from 'path'; -import { builtinModules } from 'module'; - -export function _calculateTopLevelDependency(inputDep, outputDep = '') { - // The path separator will be always the forward slash - // as at this point we only have the found entries into - // the provided source code entries where we just use it - const pathSeparator = '/'; - const depSplitPaths = inputDep.split(pathSeparator); - const firstPart = depSplitPaths.shift(); - const outputDepFirstArgAppend = outputDep ? pathSeparator : ''; - - outputDep += `${outputDepFirstArgAppend}${firstPart}`; - - // In case our dependency isn't started by @ - // we are already done and we can return the - // dependency value we already have - if (firstPart.charAt(0) !== '@') { - return outputDep; - } - - // Otherwise we need to keep constructing the dependency - // value because dependencies starting with @ points to - // folders of dependencies. For example, in case we found - // dependencies values with '@the-deps/a' and '@the-deps/a/b' - // we don't want to map it to '@the-deps' but also to @'the-deps/a' - // because inside '@the-deps' we can also have '@the-dep/b' - return _calculateTopLevelDependency(depSplitPaths.join(pathSeparator), outputDep); -} - -export async function dependenciesParseStrategy( - cwd, - parseSingleFile, - mainEntry, - wasParsed, - results -) { - // Get dependencies from a single file and filter - // out node native modules from the result - const dependencies = (await parseSingleFile(mainEntry, dependenciesVisitorsGenerator)).filter( - (dep) => !builtinModules.includes(dep) - ); - - // Return the list of all the new entries found into - // the current mainEntry that we could use to look for - // new dependencies - return dependencies.reduce((filteredEntries, entry) => { - const absEntryPath = resolve(cwd, dirname(mainEntry), entry); - - // NOTE: cwd for following canRequires is absEntryPath - // because we should start looking from there - const requiredPath = canRequire(absEntryPath, absEntryPath); - const requiredRelativePath = canRequire(entry, absEntryPath); - - const isRelativeFile = !isAbsolute(entry); - const isNodeModuleDep = isRelativeFile && !requiredPath && requiredRelativePath; - const isNewEntry = isRelativeFile && requiredPath; - - // If it is a node_module add it to the results and also - // add the resolved path for the node_module main file - // as an entry point to look for dependencies it was - // not already parsed - if (isNodeModuleDep) { - // Save the result as the top level dependency - results[_calculateTopLevelDependency(entry)] = true; - - if (!wasParsed[requiredRelativePath]) { - filteredEntries.push(requiredRelativePath); - } - } - - // If a new, not yet parsed, relative entry were found - // add it to the list of entries to be parsed - if (isNewEntry && !wasParsed[requiredPath]) { - if (!wasParsed[requiredPath]) { - filteredEntries.push(requiredPath); - } - } - - return filteredEntries; - }, []); -} diff --git a/packages/kbn-babel-code-parser/src/strategies.test.js b/packages/kbn-babel-code-parser/src/strategies.test.js deleted file mode 100644 index e61c784cdcd54..0000000000000 --- a/packages/kbn-babel-code-parser/src/strategies.test.js +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { readFile } from 'fs'; -import { canRequire } from './can_require'; -import { parseSingleFile } from './code_parser'; -import { _calculateTopLevelDependency, dependenciesParseStrategy } from './strategies'; - -jest.mock('./can_require', () => ({ - canRequire: jest.fn(), -})); - -jest.mock('fs', () => ({ - readFile: jest.fn(), -})); - -const mockCwd = '/tmp/project/dir/'; - -describe('Code Parser Strategies', () => { - it('should calculate the top level dependencies correctly', () => { - const plainDep = 'dep1/file'; - const foldedDep = '@kbn/es/file'; - const otherFoldedDep = '@kbn/es'; - - expect(_calculateTopLevelDependency(plainDep)).toEqual('dep1'); - expect(_calculateTopLevelDependency(foldedDep)).toEqual('@kbn/es'); - expect(_calculateTopLevelDependency(otherFoldedDep)).toEqual('@kbn/es'); - }); - - it('should exclude native modules', async () => { - readFile.mockImplementationOnce((path, options, cb) => { - cb(null, `require('fs')`); - }); - - const results = []; - await dependenciesParseStrategy(mockCwd, parseSingleFile, 'dep1/file.js', {}, results); - - expect(results.length).toBe(0); - }); - - it('should return a dep from_modules', async () => { - readFile.mockImplementationOnce((path, options, cb) => { - cb(null, `require('dep_from_node_modules')`); - }); - - canRequire.mockImplementation((entry, cwd) => { - if (entry === `${cwd}dep1/dep_from_node_modules`) { - return false; - } - - if (entry === 'dep_from_node_modules') { - return `${mockCwd}node_modules/dep_from_node_modules/index.js`; - } - }); - - const results = await dependenciesParseStrategy( - mockCwd, - parseSingleFile, - 'dep1/file.js', - {}, - {} - ); - expect(results[0]).toBe(`${mockCwd}node_modules/dep_from_node_modules/index.js`); - }); - - it('should return a relative dep file', async () => { - readFile.mockImplementationOnce((path, options, cb) => { - cb(null, `require('./relative_dep')`); - }); - - canRequire.mockImplementation((entry) => { - if (entry === `${mockCwd}dep1/relative_dep`) { - return `${entry}/index.js`; - } - - return false; - }); - - const results = await dependenciesParseStrategy( - mockCwd, - parseSingleFile, - 'dep1/file.js', - {}, - {} - ); - expect(results[0]).toBe(`${mockCwd}dep1/relative_dep/index.js`); - }); - - afterAll(() => { - jest.clearAllMocks(); - }); -}); diff --git a/packages/kbn-babel-code-parser/src/visitors.js b/packages/kbn-babel-code-parser/src/visitors.js deleted file mode 100644 index b159848d424fa..0000000000000 --- a/packages/kbn-babel-code-parser/src/visitors.js +++ /dev/null @@ -1,124 +0,0 @@ -/* eslint-disable @kbn/eslint/require-license-header */ - -import { matches } from 'lodash'; - -/* @notice - * - * This product has relied on ASTExplorer that is licensed under MIT. - */ -export function dependenciesVisitorsGenerator(dependenciesAcc) { - return (() => { - // This was built with help on an ast explorer and some ESTree docs - // like the babel parser ast spec and the main docs for the Esprima - // which is a complete and useful docs for the ESTree spec. - // - // https://astexplorer.net - // https://github.com/babel/babel/blob/master/packages/babel-parser/ast/spec.md - // https://esprima.readthedocs.io/en/latest/syntax-tree-format.html - // https://github.com/estree/estree - return { - // Visitors to traverse and found dependencies - // raw values on require + require.resolve - CallExpression: ({ node }) => { - // AST check for require expressions - const isRequire = (node) => { - return matches({ - callee: { - type: 'Identifier', - name: 'require', - }, - })(node); - }; - - // AST check for require.resolve expressions - const isRequireResolve = (node) => { - return matches({ - callee: { - type: 'MemberExpression', - object: { - type: 'Identifier', - name: 'require', - }, - property: { - type: 'Identifier', - name: 'resolve', - }, - }, - })(node); - }; - - // Get string values inside the expressions - // whether they are require or require.resolve - if (isRequire(node) || isRequireResolve(node)) { - const nodeArguments = node.arguments; - const reqArg = Array.isArray(nodeArguments) ? nodeArguments.shift() : null; - - if (!reqArg) { - return; - } - - if (reqArg.type === 'StringLiteral') { - dependenciesAcc.push(reqArg.value); - } - } - }, - // Visitors to traverse and found dependencies - // raw values on import - ImportDeclaration: ({ node }) => { - // AST check for supported import expressions - const isImport = (node) => { - return matches({ - type: 'ImportDeclaration', - source: { - type: 'StringLiteral', - }, - })(node); - }; - - // Get string values from import expressions - if (isImport(node)) { - const importSource = node.source; - dependenciesAcc.push(importSource.value); - } - }, - // Visitors to traverse and found dependencies - // raw values on export from - ExportNamedDeclaration: ({ node }) => { - // AST check for supported export from expressions - const isExportFrom = (node) => { - return matches({ - type: 'ExportNamedDeclaration', - source: { - type: 'StringLiteral', - }, - })(node); - }; - - // Get string values from export from expressions - if (isExportFrom(node)) { - const exportFromSource = node.source; - dependenciesAcc.push(exportFromSource.value); - } - }, - // Visitors to traverse and found dependencies - // raw values on export * from - ExportAllDeclaration: ({ node }) => { - // AST check for supported export * from expressions - const isExportAllFrom = (node) => { - return matches({ - type: 'ExportAllDeclaration', - source: { - type: 'StringLiteral', - }, - })(node); - }; - - // Get string values from export * from expressions - if (isExportAllFrom(node)) { - const exportAllFromSource = node.source; - dependenciesAcc.push(exportAllFromSource.value); - } - }, - }; - })(); -} diff --git a/packages/kbn-babel-code-parser/src/visitors.test.js b/packages/kbn-babel-code-parser/src/visitors.test.js deleted file mode 100644 index d2704fa9dfb72..0000000000000 --- a/packages/kbn-babel-code-parser/src/visitors.test.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import * as parser from '@babel/parser'; -import traverse from '@babel/traverse'; -import { dependenciesVisitorsGenerator } from './visitors'; - -const visitorsApplier = (code) => { - const result = []; - traverse( - parser.parse(code, { - sourceType: 'unambiguous', - plugins: ['exportDefaultFrom'], - }), - dependenciesVisitorsGenerator(result) - ); - return result; -}; - -describe('Code Parser Visitors', () => { - it('should get values from require', () => { - const rawCode = `/*foo*/require('dep1'); const bar = 1;`; - const foundDeps = visitorsApplier(rawCode); - expect(foundDeps[0] === 'dep1'); - }); - - it('should get values from require.resolve', () => { - const rawCode = `/*foo*/require.resolve('dep2'); const bar = 1;`; - const foundDeps = visitorsApplier(rawCode); - expect(foundDeps[0] === 'dep2'); - }); - - it('should get values from import', () => { - const rawCode = `/*foo*/import dep1 from 'dep1'; import dep2 from 'dep2';const bar = 1;`; - const foundDeps = visitorsApplier(rawCode); - expect(foundDeps[0] === 'dep1'); - expect(foundDeps[1] === 'dep2'); - }); - - it('should get values from export from', () => { - const rawCode = `/*foo*/export dep1 from 'dep1'; import dep2 from 'dep2';const bar = 1;`; - const foundDeps = visitorsApplier(rawCode); - expect(foundDeps[0] === 'dep1'); - }); - - it('should get values from export * from', () => { - const rawCode = `/*foo*/export * from 'dep1'; export dep2 from 'dep2';const bar = 1;`; - const foundDeps = visitorsApplier(rawCode); - expect(foundDeps[0] === 'dep1'); - expect(foundDeps[1] === 'dep2'); - }); -}); diff --git a/packages/kbn-babel-code-parser/yarn.lock b/packages/kbn-babel-code-parser/yarn.lock deleted file mode 120000 index 3f82ebc9cdbae..0000000000000 --- a/packages/kbn-babel-code-parser/yarn.lock +++ /dev/null @@ -1 +0,0 @@ -../../yarn.lock \ No newline at end of file diff --git a/src/dev/build/README.md b/src/dev/build/README.md index ed8750f6fee56..460ab01794334 100644 --- a/src/dev/build/README.md +++ b/src/dev/build/README.md @@ -39,14 +39,3 @@ The majority of this logic is extracted from the grunt build that has existed fo [lib/build.js]: ./lib/build.js [build_distributables.js]: ./build_distributables.js [../tooling_log/tooling_log.js]: ../tooling_log/tooling_log.js - -# Client Node Modules Cleaning - -We have introduced in our bundle a webpack dll for the client vendor modules in order to improve -the optimization time both in dev and in production. As for those modules we already have the -code into the vendors_${chunk_number}.bundle.dll.js we have decided to delete those bundled modules from the -distributable node_modules folder. However, in order to accomplish this, we need to exclude -every node_module used in the server side code. This logic is performed -under `nodejs_modules/clean_client_modules_on_dll_task.js`. In case we need to add any new cli -or any other piece of server code other than `x-pack` or `core_plugins` we'll need -to update the globs present on `clean_client_modules_on_dll_task.js` accordingly. diff --git a/src/dev/build/build_distributables.js b/src/dev/build/build_distributables.js index 22a348b78dc0a..39a32fff891c2 100644 --- a/src/dev/build/build_distributables.js +++ b/src/dev/build/build_distributables.js @@ -22,7 +22,6 @@ import { getConfig, createRunner } from './lib'; import { BuildKibanaPlatformPluginsTask, BuildPackagesTask, - CleanClientModulesOnDLLTask, CleanEmptyFoldersTask, CleanExtraBinScriptsTask, CleanExtraFilesFromModulesTask, @@ -127,7 +126,6 @@ export async function buildDistributables(options) { await run(TranspileScssTask); await run(BuildKibanaPlatformPluginsTask); await run(OptimizeBuildTask); - await run(CleanClientModulesOnDLLTask); await run(CleanTypescriptTask); await run(CleanExtraFilesFromModulesTask); await run(CleanEmptyFoldersTask); diff --git a/src/dev/build/tasks/index.js b/src/dev/build/tasks/index.js index d96e745c10776..0a3a67313d6a4 100644 --- a/src/dev/build/tasks/index.js +++ b/src/dev/build/tasks/index.js @@ -30,7 +30,6 @@ export * from './create_readme_task'; export * from './install_chromium'; export * from './install_dependencies_task'; export * from './license_file_task'; -export * from './nodejs_modules'; export * from './nodejs'; export * from './notice_file_task'; export * from './optimize_task'; diff --git a/src/dev/build/tasks/nodejs_modules/clean_client_modules_on_dll_task.js b/src/dev/build/tasks/nodejs_modules/clean_client_modules_on_dll_task.js deleted file mode 100644 index 05bfd3ca31a65..0000000000000 --- a/src/dev/build/tasks/nodejs_modules/clean_client_modules_on_dll_task.js +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { - getDllEntries, - cleanDllModuleFromEntryPath, - writeEmptyFileForDllEntry, -} from './webpack_dll'; -import { getDependencies } from './get_dependencies'; -import globby from 'globby'; -import normalizePosixPath from 'normalize-path'; - -export const CleanClientModulesOnDLLTask = { - description: 'Cleaning client node_modules bundled into the DLL', - - async run(config, log, build) { - const baseDir = normalizePosixPath(build.resolvePath('.')); - const kbnPkg = config.getKibanaPkg(); - const kbnPkgDependencies = (kbnPkg && kbnPkg.dependencies) || {}; - const kbnWebpackLoaders = Object.keys(kbnPkgDependencies).filter( - (dep) => !!dep.includes('-loader') - ); - - // Define the entry points for the server code in order to - // start here later looking for the server side dependencies - const mainCodeEntries = [ - `${baseDir}/src/cli`, - `${baseDir}/src/cli_keystore`, - `${baseDir}/src/cli_plugin`, - `${baseDir}/x-pack`, - ...kbnWebpackLoaders.map((loader) => `${baseDir}/node_modules/${loader}`), - ]; - const discoveredLegacyCorePluginEntries = await globby([ - `${baseDir}/src/legacy/core_plugins/*/index.js`, - `!${baseDir}/src/legacy/core_plugins/**/public`, - ]); - const discoveredPluginEntries = await globby([ - `${baseDir}/src/plugins/*/server/index.js`, - // Small exception to load dynamically discovered functions for timelion plugin - `${baseDir}/src/plugins/vis_type_timelion/server/*_functions/**/*.js`, - `!${baseDir}/src/plugins/**/public`, - ]); - const discoveredNewPlatformXpackPlugins = await globby([ - `${baseDir}/x-pack/plugins/*/server/index.js`, - `!${baseDir}/x-pack/plugins/**/public`, - ]); - - // Compose all the needed entries - const serverEntries = [ - ...mainCodeEntries, - ...discoveredLegacyCorePluginEntries, - ...discoveredPluginEntries, - ...discoveredNewPlatformXpackPlugins, - ]; - - // Get the dependencies found searching through the server - // side code entries that were provided - const serverDependencies = await getDependencies(baseDir, serverEntries); - - // This fulfill a particular exceptional case where - // we need to keep loading a file from a node_module - // only used in the front-end like we do when using the file-loader - // in https://github.com/elastic/kibana/blob/master/x-pack/legacy/plugins/maps/public/connected_components/map/mb/view.js - // - // manual list of exception modules - const manualExceptionModules = ['mapbox-gl']; - - // consider the top modules as exceptions as the entry points - // to look for other exceptions dependent on that one - const manualExceptionEntries = [ - ...manualExceptionModules.map((module) => `${baseDir}/node_modules/${module}`), - ]; - - // dependencies for declared exception modules - const manualExceptionModulesDependencies = await getDependencies(baseDir, [ - ...manualExceptionEntries, - ]); - - // final list of manual exceptions to add - const manualExceptions = [...manualExceptionModules, ...manualExceptionModulesDependencies]; - - // Consider this as our whiteList for the modules we can't delete - const whiteListedModules = [...serverDependencies, ...kbnWebpackLoaders, ...manualExceptions]; - - // Resolve the client vendors dll manifest paths - // excluding the runtime one - const dllManifestPaths = await globby([ - `${baseDir}/built_assets/dlls/vendors_*.manifest.dll.json`, - `!${baseDir}/built_assets/dlls/vendors_runtime.manifest.dll.json`, - ]); - - // Get dll entries filtering out the ones - // from any whitelisted module - const dllEntries = await getDllEntries(dllManifestPaths, whiteListedModules, baseDir); - - for (const relativeEntryPath of dllEntries) { - const entryPath = `${baseDir}/${relativeEntryPath}`; - - if (entryPath.endsWith('package.json')) { - continue; - } - - // Clean a module included into the dll - // and then write a blank file for each - // entry file present into the dll - await cleanDllModuleFromEntryPath(log, entryPath); - await writeEmptyFileForDllEntry(entryPath); - } - }, -}; diff --git a/src/dev/build/tasks/nodejs_modules/get_dependencies.js b/src/dev/build/tasks/nodejs_modules/get_dependencies.js deleted file mode 100644 index 5a39448f57d14..0000000000000 --- a/src/dev/build/tasks/nodejs_modules/get_dependencies.js +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { parseEntries, dependenciesParseStrategy } from '@kbn/babel-code-parser'; - -export async function getDependencies(cwd, entries) { - // Return the dependencies retrieve from the - // provided code entries (sanitized) and - // parseStrategy (dependencies one) - return Object.keys(await parseEntries(cwd, entries, dependenciesParseStrategy, {})); -} diff --git a/src/dev/build/tasks/nodejs_modules/index.js b/src/dev/build/tasks/nodejs_modules/index.js deleted file mode 100644 index 1c5392662ad13..0000000000000 --- a/src/dev/build/tasks/nodejs_modules/index.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -export { CleanClientModulesOnDLLTask } from './clean_client_modules_on_dll_task'; diff --git a/src/dev/build/tasks/nodejs_modules/webpack_dll.js b/src/dev/build/tasks/nodejs_modules/webpack_dll.js deleted file mode 100644 index 8de5e582c3d36..0000000000000 --- a/src/dev/build/tasks/nodejs_modules/webpack_dll.js +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { deleteAll, isFileAccessible, read, write } from '../../lib'; -import { dirname, relative, resolve } from 'path'; -import pkgUp from 'pkg-up'; -import globby from 'globby'; -import normalizePosixPath from 'normalize-path'; - -function checkDllEntryAccess(entry, baseDir = '') { - const resolvedPath = baseDir ? resolve(baseDir, entry) : entry; - return isFileAccessible(resolvedPath); -} - -export async function getDllEntries(manifestPaths, whiteListedModules, baseDir = '') { - // Read and parse all manifests - const manifests = await Promise.all( - manifestPaths.map(async (manifestPath) => JSON.parse(await read(manifestPath))) - ); - - // Process and group modules from all manifests - const manifestsModules = manifests.flatMap((manifest, idx) => { - if (!manifest || !manifest.content) { - // It should fails because if we don't have the manifest file - // or it is malformed something wrong is happening and we - // should stop - throw new Error(`The following dll manifest doesn't exists: ${manifestPaths[idx]}`); - } - - const modules = Object.keys(manifest.content); - if (!modules.length) { - // It should fails because if we don't have any - // module inside the client vendors dll something - // wrong is happening and we should stop too - throw new Error( - `The following dll manifest is reporting an empty dll: ${manifestPaths[idx]}` - ); - } - - return modules; - }); - - // Only includes modules who are not in the white list of modules - // and that are node_modules - return manifestsModules.filter((entry) => { - const isWhiteListed = whiteListedModules.some((nonEntry) => - normalizePosixPath(entry).includes(`node_modules/${nonEntry}`) - ); - const isNodeModule = entry.includes('node_modules'); - - // NOTE: when using dynamic imports on webpack the entry paths could be created - // with special context module (ex: lazy recursive) values over directories that are not real files - // and only exists in runtime, so we need to check if the entry is a real file. - // We found that problem through the issue https://github.com/elastic/kibana/issues/38481 - // - // More info: - // https://github.com/webpack/webpack/blob/master/examples/code-splitting-harmony/README.md - // https://webpack.js.org/guides/dependency-management/#require-with-expression - const isAccessible = checkDllEntryAccess(entry, baseDir); - - return !isWhiteListed && isNodeModule && isAccessible; - }); -} - -export async function cleanDllModuleFromEntryPath(logger, entryPath) { - const modulePkgPath = await pkgUp(entryPath); - const modulePkg = JSON.parse(await read(modulePkgPath)); - const moduleDir = dirname(modulePkgPath); - const normalizedModuleDir = normalizePosixPath(moduleDir); - - // Cancel the cleanup for this module as it - // was already done. - if (modulePkg.cleaned) { - return; - } - - // Clear dependencies from dll module package.json - if (modulePkg.dependencies) { - modulePkg.dependencies = {}; - } - - // Clear devDependencies from dll module package.json - if (modulePkg.devDependencies) { - modulePkg.devDependencies = {}; - } - - // Delete module contents. It will delete everything - // excepts package.json, images and css - // - // NOTE: We can't use cwd option with globby - // until the following issue gets closed - // https://github.com/sindresorhus/globby/issues/87 - const filesToDelete = await globby([ - `${normalizedModuleDir}/**`, - `!${normalizedModuleDir}/**/*.+(css)`, - `!${normalizedModuleDir}/**/*.+(gif|ico|jpeg|jpg|tiff|tif|svg|png|webp)`, - ]); - - await deleteAll( - filesToDelete.filter((path) => { - const relativePath = relative(moduleDir, path); - return !relativePath.endsWith('package.json') || relativePath.includes('node_modules'); - }) - ); - - // Mark this module as cleaned - modulePkg.cleaned = true; - - // Rewrite modified package.json - await write(modulePkgPath, JSON.stringify(modulePkg, null, 2)); -} - -export async function writeEmptyFileForDllEntry(entryPath) { - await write(entryPath, ''); -} diff --git a/src/dev/build/tasks/nodejs_modules/webpack_dll.test.js b/src/dev/build/tasks/nodejs_modules/webpack_dll.test.js deleted file mode 100644 index ce305169a777b..0000000000000 --- a/src/dev/build/tasks/nodejs_modules/webpack_dll.test.js +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { isFileAccessible, read } from '../../lib'; -import { getDllEntries } from './webpack_dll'; - -jest.mock('../../lib', () => ({ - read: jest.fn(), - isFileAccessible: jest.fn(), -})); - -const manifestContentMock = JSON.stringify({ - name: 'vendors', - content: { - '/mock/node_modules/dep1': {}, - '/mock/node_modules/dep2': {}, - '/mock/node_modules/dep3': {}, - '/mock/tmp/dep2': {}, - }, -}); - -const emptyManifestContentMock = JSON.stringify({ - name: 'vendors', - content: {}, -}); - -const noManifestMock = JSON.stringify(null); - -const noContentFieldManifestMock = JSON.stringify({ - name: 'vendors', -}); - -describe('Webpack DLL Build Tasks Utils', () => { - it('should get dll entries correctly', async () => { - read.mockImplementationOnce(async () => manifestContentMock); - - isFileAccessible.mockImplementation(() => true); - - const mockManifestPath = ['/mock/mock_dll_manifest.json']; - const mockModulesWhitelist = ['dep1']; - const dllEntries = await getDllEntries(mockManifestPath, mockModulesWhitelist); - - expect(dllEntries).toEqual( - expect.arrayContaining(['/mock/node_modules/dep2', '/mock/node_modules/dep3']) - ); - }); - - it('should only include accessible files', async () => { - read.mockImplementationOnce(async () => manifestContentMock); - - isFileAccessible.mockImplementation(() => false); - - const mockManifestPath = ['/mock/mock_dll_manifest.json']; - const mockModulesWhitelist = ['dep1']; - const dllEntries = await getDllEntries(mockManifestPath, mockModulesWhitelist); - - isFileAccessible.mockRestore(); - - expect(dllEntries.length).toEqual(0); - }); - - it('should throw an error for no manifest file', async () => { - read.mockImplementationOnce(async () => noManifestMock); - - const mockManifestPath = ['/mock/mock_dll_manifest.json']; - - try { - await getDllEntries(mockManifestPath, []); - } catch (error) { - expect(error.message).toEqual( - `The following dll manifest doesn't exists: /mock/mock_dll_manifest.json` - ); - } - }); - - it('should throw an error for no manifest content field', async () => { - read.mockImplementation(async () => noContentFieldManifestMock); - - const mockManifestPath = ['/mock/mock_dll_manifest.json']; - - try { - await getDllEntries(mockManifestPath, []); - } catch (error) { - expect(error.message).toEqual( - `The following dll manifest doesn't exists: /mock/mock_dll_manifest.json` - ); - } - }); - - it('should throw an error for manifest file without any content', async () => { - read.mockImplementation(async () => emptyManifestContentMock); - - const mockManifestPath = ['/mock/mock_dll_manifest.json']; - - try { - await getDllEntries(mockManifestPath, []); - } catch (error) { - expect(error.message).toEqual( - `The following dll manifest is reporting an empty dll: /mock/mock_dll_manifest.json` - ); - } - }); - - afterAll(() => { - jest.clearAllMocks(); - }); -}); diff --git a/src/dev/build/tasks/optimize_task.js b/src/dev/build/tasks/optimize_task.js index 4034092273239..16a7537b8ac9e 100644 --- a/src/dev/build/tasks/optimize_task.js +++ b/src/dev/build/tasks/optimize_task.js @@ -41,7 +41,6 @@ export const OptimizeBuildTask = { await exec(log, kibanaScript, kibanaArgs, { cwd: build.resolvePath('.'), env: { - FORCE_DLL_CREATION: 'true', KBN_CACHE_LOADER_WRITABLE: 'true', NODE_OPTIONS: '--max-old-space-size=4096', }, diff --git a/src/dev/notice/generate_notice_from_source.ts b/src/dev/notice/generate_notice_from_source.ts index fb74bed0f26f4..37bbcce72e497 100644 --- a/src/dev/notice/generate_notice_from_source.ts +++ b/src/dev/notice/generate_notice_from_source.ts @@ -47,10 +47,11 @@ export async function generateNoticeFromSource({ productName, directory, log }: cwd: directory, nodir: true, ignore: [ - '{node_modules,build,target,dist,data,built_assets}/**', - 'packages/*/{node_modules,build,target,dist}/**', - 'x-pack/{node_modules,build,target,dist,data}/**', - 'x-pack/packages/*/{node_modules,build,target,dist}/**', + '{node_modules,build,dist,data,built_assets}/**', + 'packages/*/{node_modules,build,dist}/**', + 'x-pack/{node_modules,build,dist,data}/**', + 'x-pack/packages/*/{node_modules,build,dist}/**', + '**/target/**', ], }; diff --git a/src/legacy/core_plugins/tests_bundle/index.js b/src/legacy/core_plugins/tests_bundle/index.js index 431c161585fe0..da7c1c4f4527e 100644 --- a/src/legacy/core_plugins/tests_bundle/index.js +++ b/src/legacy/core_plugins/tests_bundle/index.js @@ -108,6 +108,13 @@ export default (kibana) => { resolve: { extensions: ['.karma_mock.js', '.karma_mock.tsx', '.karma_mock.ts'], }, + node: { + fs: 'empty', + child_process: 'empty', + dns: 'empty', + net: 'empty', + tls: 'empty', + }, }, webpackConfig ); diff --git a/src/legacy/server/logging/log_format_string.js b/src/legacy/server/logging/log_format_string.js index 3c18aab2e3d09..cbbf71dd894ac 100644 --- a/src/legacy/server/logging/log_format_string.js +++ b/src/legacy/server/logging/log_format_string.js @@ -41,8 +41,6 @@ const typeColors = { optmzr: 'white', manager: 'green', optimize: 'magentaBright', - 'optimize:dynamic_dll_plugin': 'magentaBright', - 'optimize:watch_cache': 'magentaBright', listening: 'magentaBright', scss: 'magentaBright', }; diff --git a/src/legacy/ui/ui_render/ui_render_mixin.js b/src/legacy/ui/ui_render/ui_render_mixin.js index 168dddf0253d9..7788aeaee72e5 100644 --- a/src/legacy/ui/ui_render/ui_render_mixin.js +++ b/src/legacy/ui/ui_render/ui_render_mixin.js @@ -24,7 +24,6 @@ import { i18n } from '@kbn/i18n'; import * as UiSharedDeps from '@kbn/ui-shared-deps'; import { AppBootstrap } from './bootstrap'; import { getApmConfig } from '../apm'; -import { DllCompiler } from '../../../optimize/dynamic_dll_plugin'; /** * @typedef {import('../../server/kbn_server').default} KbnServer @@ -106,17 +105,8 @@ export function uiRenderMixin(kbnServer, server, config) { const basePath = config.get('server.basePath'); const regularBundlePath = `${basePath}/${buildHash}/bundles`; - const dllBundlePath = `${basePath}/${buildHash}/built_assets/dlls`; - - const dllStyleChunks = DllCompiler.getRawDllConfig().chunks.map( - (chunk) => `${dllBundlePath}/vendors${chunk}.style.dll.css` - ); - const dllJsChunks = DllCompiler.getRawDllConfig().chunks.map( - (chunk) => `${dllBundlePath}/vendors${chunk}.bundle.dll.js` - ); const styleSheetPaths = [ - ...(isCore ? [] : dllStyleChunks), `${regularBundlePath}/kbn-ui-shared-deps/${UiSharedDeps.baseCssDistFilename}`, ...(darkMode ? [ @@ -173,7 +163,6 @@ export function uiRenderMixin(kbnServer, server, config) { (filename) => `${regularBundlePath}/kbn-ui-shared-deps/${filename}` ), `${regularBundlePath}/kbn-ui-shared-deps/${UiSharedDeps.jsFilename}`, - ...(isCore ? [] : [`${dllBundlePath}/vendors_runtime.bundle.dll.js`, ...dllJsChunks]), `${regularBundlePath}/core/core.entry.js`, ...kpPluginBundlePaths, diff --git a/src/optimize/base_optimizer.js b/src/optimize/base_optimizer.js index 55752db55e28a..41628a2264193 100644 --- a/src/optimize/base_optimizer.js +++ b/src/optimize/base_optimizer.js @@ -30,8 +30,6 @@ import webpackMerge from 'webpack-merge'; import WrapperPlugin from 'wrapper-webpack-plugin'; import * as UiSharedDeps from '@kbn/ui-shared-deps'; -import { DynamicDllPlugin } from './dynamic_dll_plugin'; - import { IS_KIBANA_DISTRIBUTABLE } from '../legacy/utils'; import { fromRoot } from '../core/server/utils'; import { PUBLIC_PATH_PLACEHOLDER } from './public_path_placeholder'; @@ -286,12 +284,6 @@ export default class BaseOptimizer { }, plugins: [ - new DynamicDllPlugin({ - uiBundles: this.uiBundles, - threadLoaderPoolConfig: this.getThreadLoaderPoolConfig(), - logWithMetadata: this.logWithMetadata, - }), - new MiniCssExtractPlugin({ filename: '[name].style.css', }), diff --git a/src/optimize/bundles_route/__tests__/bundles_route.js b/src/optimize/bundles_route/__tests__/bundles_route.js index 902fa59b20569..5b42b658300fe 100644 --- a/src/optimize/bundles_route/__tests__/bundles_route.js +++ b/src/optimize/bundles_route/__tests__/bundles_route.js @@ -56,7 +56,6 @@ describe('optimizer/bundle route', () => { function createServer(options = {}) { const { regularBundlesPath = outputFixture, - dllBundlesPath = outputFixture, basePublicPath = '', builtCssPath = outputFixture, npUiPluginPublicDirs = [], @@ -70,7 +69,6 @@ describe('optimizer/bundle route', () => { server.route( createBundlesRoute({ regularBundlesPath, - dllBundlesPath, basePublicPath, builtCssPath, npUiPluginPublicDirs, @@ -89,28 +87,24 @@ describe('optimizer/bundle route', () => { expect(() => { createBundlesRoute({ regularBundlesPath: null, - dllBundlesPath: '/absolute/path', basePublicPath: '', }); }).to.throwError(/absolute path/); expect(() => { createBundlesRoute({ regularBundlesPath: './relative', - dllBundlesPath: '/absolute/path', basePublicPath: '', }); }).to.throwError(/absolute path/); expect(() => { createBundlesRoute({ regularBundlesPath: 1234, - dllBundlesPath: '/absolute/path', basePublicPath: '', }); }).to.throwError(/absolute path/); expect(() => { createBundlesRoute({ regularBundlesPath: '/absolute/path', - dllBundlesPath: '/absolute/path', basePublicPath: '', }); }).to.not.throwError(); @@ -119,42 +113,36 @@ describe('optimizer/bundle route', () => { expect(() => { createBundlesRoute({ regularBundlesPath: '/bundles', - dllBundlesPath: '/absolute/path', basePublicPath: 123, }); }).to.throwError(/string/); expect(() => { createBundlesRoute({ regularBundlesPath: '/bundles', - dllBundlesPath: '/absolute/path', basePublicPath: {}, }); }).to.throwError(/string/); expect(() => { createBundlesRoute({ regularBundlesPath: '/bundles', - dllBundlesPath: '/absolute/path', basePublicPath: '/a/', }); }).to.throwError(/start and not end with a \//); expect(() => { createBundlesRoute({ regularBundlesPath: '/bundles', - dllBundlesPath: '/absolute/path', basePublicPath: 'a/', }); }).to.throwError(/start and not end with a \//); expect(() => { createBundlesRoute({ regularBundlesPath: '/bundles', - dllBundlesPath: '/absolute/path', basePublicPath: '/a', }); }).to.not.throwError(); expect(() => { createBundlesRoute({ regularBundlesPath: '/bundles', - dllBundlesPath: '/absolute/path', basePublicPath: '', }); }).to.not.throwError(); diff --git a/src/optimize/bundles_route/bundles_route.ts b/src/optimize/bundles_route/bundles_route.ts index e9cfba0130d95..8c1092efed252 100644 --- a/src/optimize/bundles_route/bundles_route.ts +++ b/src/optimize/bundles_route/bundles_route.ts @@ -28,22 +28,19 @@ import { assertIsNpUiPluginPublicDirs, NpUiPluginPublicDirs } from '../np_ui_plu import { fromRoot } from '../../core/server/utils'; /** - * Creates the routes that serves files from `bundlesPath` or from - * `dllBundlesPath` (if they are dll bundle's related files). If the + * Creates the routes that serves files from `bundlesPath`. If the * file is js or css then it is searched for instances of * PUBLIC_PATH_PLACEHOLDER and replaces them with `publicPath`. * * @param {Object} options * @property {Array<{id,path}>} options.npUiPluginPublicDirs array of ids and paths that should be served for new platform plugins * @property {string} options.regularBundlesPath - * @property {string} options.dllBundlesPath * @property {string} options.basePublicPath * * @return Array.of({Hapi.Route}) */ export function createBundlesRoute({ regularBundlesPath, - dllBundlesPath, basePublicPath, builtCssPath, npUiPluginPublicDirs = [], @@ -51,7 +48,6 @@ export function createBundlesRoute({ isDist = false, }: { regularBundlesPath: string; - dllBundlesPath: string; basePublicPath: string; builtCssPath: string; npUiPluginPublicDirs?: NpUiPluginPublicDirs; @@ -70,12 +66,6 @@ export function createBundlesRoute({ ); } - if (typeof dllBundlesPath !== 'string' || !isAbsolute(dllBundlesPath)) { - throw new TypeError( - 'dllBundlesPath must be an absolute path to the directory containing the dll bundles' - ); - } - if (typeof basePublicPath !== 'string') { throw new TypeError('basePublicPath must be a string'); } @@ -118,13 +108,6 @@ export function createBundlesRoute({ fileHashCache, isDist, }), - buildRouteForBundles({ - publicPath: `${basePublicPath}/${buildHash}/built_assets/dlls/`, - routePath: `/${buildHash}/built_assets/dlls/`, - bundlesPath: dllBundlesPath, - fileHashCache, - isDist, - }), buildRouteForBundles({ publicPath: `${basePublicPath}/`, routePath: `/${buildHash}/built_assets/css/`, diff --git a/src/optimize/bundles_route/proxy_bundles_route.ts b/src/optimize/bundles_route/proxy_bundles_route.ts index 1d189054324a1..108d253d45202 100644 --- a/src/optimize/bundles_route/proxy_bundles_route.ts +++ b/src/optimize/bundles_route/proxy_bundles_route.ts @@ -28,7 +28,6 @@ export function createProxyBundlesRoute({ }) { return [ buildProxyRouteForBundles(`/${buildHash}/bundles/`, host, port), - buildProxyRouteForBundles(`/${buildHash}/built_assets/dlls/`, host, port), buildProxyRouteForBundles(`/${buildHash}/built_assets/css/`, host, port), ]; } diff --git a/src/optimize/dynamic_dll_plugin/dll_allowed_modules.js b/src/optimize/dynamic_dll_plugin/dll_allowed_modules.js deleted file mode 100644 index 4314cebd3b7e9..0000000000000 --- a/src/optimize/dynamic_dll_plugin/dll_allowed_modules.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import path from 'path'; - -export function notInNodeModules(checkPath) { - return !checkPath.includes(`${path.sep}node_modules${path.sep}`); -} - -export function notInNodeModulesOrWebpackShims(checkPath) { - return notInNodeModules(checkPath) && !checkPath.includes(`${path.sep}webpackShims${path.sep}`); -} - -export function inPluginNodeModules(checkPath) { - return checkPath.match(/[\/\\]plugins.*[\/\\]node_modules/); -} - -export function inDllPluginPublic(checkPath) { - return checkPath.includes(`${path.sep}dynamic_dll_plugin${path.sep}public${path.sep}`); -} diff --git a/src/optimize/dynamic_dll_plugin/dll_compiler.js b/src/optimize/dynamic_dll_plugin/dll_compiler.js deleted file mode 100644 index 9ab21ee0e9076..0000000000000 --- a/src/optimize/dynamic_dll_plugin/dll_compiler.js +++ /dev/null @@ -1,366 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { configModel } from './dll_config_model'; -import { - notInNodeModulesOrWebpackShims, - notInNodeModules, - inDllPluginPublic, -} from './dll_allowed_modules'; -import { - dllEntryFileContentArrayToString, - dllEntryFileContentStringToArray, - dllMergeAllEntryFilesContent, -} from './dll_entry_template'; -import { fromRoot } from '../../core/server/utils'; -import { PUBLIC_PATH_PLACEHOLDER } from '../public_path_placeholder'; -import fs from 'fs'; -import webpack from 'webpack'; -import { promisify } from 'util'; -import path from 'path'; -import del from 'del'; -import { chunk } from 'lodash'; -import seedrandom from 'seedrandom'; - -const readFileAsync = promisify(fs.readFile); -const mkdirAsync = promisify(fs.mkdir); -const accessAsync = promisify(fs.access); -const writeFileAsync = promisify(fs.writeFile); - -export class DllCompiler { - static getRawDllConfig( - uiBundles = {}, - babelLoaderCacheDir = '', - threadLoaderPoolConfig = {}, - chunks = Array.from(Array(4).keys()).map((chunkN) => `_${chunkN}`) - ) { - return { - uiBundles, - babelLoaderCacheDir, - threadLoaderPoolConfig, - chunks, - context: fromRoot('.'), - entryName: 'vendors', - dllName: '[name]', - manifestName: '[name]', - styleName: '[name]', - entryExt: '.entry.dll.js', - dllExt: '.bundle.dll.js', - manifestExt: '.manifest.dll.json', - styleExt: '.style.dll.css', - outputPath: fromRoot('built_assets/dlls'), - publicPath: PUBLIC_PATH_PLACEHOLDER, - }; - } - - constructor(uiBundles, threadLoaderPoolConfig, logWithMetadata) { - this.rawDllConfig = DllCompiler.getRawDllConfig( - uiBundles, - uiBundles.getCacheDirectory('babel'), - threadLoaderPoolConfig - ); - this.logWithMetadata = logWithMetadata || (() => null); - } - - async init() { - await this.ensureEntryFilesExists(); - await this.ensureManifestFilesExists(); - await this.ensureOutputPathExists(); - } - - seededShuffle(array) { - // Implementation based on https://github.com/TimothyGu/knuth-shuffle-seeded/blob/gh-pages/index.js#L46 - let currentIndex; - let temporaryValue; - let randomIndex; - const rand = seedrandom('predictable', { global: false }); - - if (array.constructor !== Array) throw new Error('Input is not an array'); - currentIndex = array.length; - - // While there remain elements to shuffle... - while (0 !== currentIndex) { - // Pick a remaining element... - randomIndex = Math.floor(rand() * currentIndex--); - - // And swap it with the current element. - temporaryValue = array[currentIndex]; - array[currentIndex] = array[randomIndex]; - array[randomIndex] = temporaryValue; - } - - return array; - } - - async upsertEntryFiles(content) { - const arrayContent = this.seededShuffle(dllEntryFileContentStringToArray(content)); - const chunks = chunk( - arrayContent, - Math.ceil(arrayContent.length / this.rawDllConfig.chunks.length) - ); - const entryPaths = this.getEntryPaths(); - - await Promise.all( - entryPaths.map( - async (entryPath, idx) => - await this.upsertFile(entryPath, dllEntryFileContentArrayToString(chunks[idx])) - ) - ); - } - - async upsertFile(filePath, content = '') { - await this.ensurePathExists(filePath); - await writeFileAsync(filePath, content, 'utf8'); - } - - getDllPaths() { - return this.rawDllConfig.chunks.map((chunk) => - this.resolvePath(`${this.rawDllConfig.entryName}${chunk}${this.rawDllConfig.dllExt}`) - ); - } - - getEntryPaths() { - return this.rawDllConfig.chunks.map((chunk) => - this.resolvePath(`${this.rawDllConfig.entryName}${chunk}${this.rawDllConfig.entryExt}`) - ); - } - - getManifestPaths() { - return this.rawDllConfig.chunks.map((chunk) => - this.resolvePath(`${this.rawDllConfig.entryName}${chunk}${this.rawDllConfig.manifestExt}`) - ); - } - - getStylePaths() { - return this.rawDllConfig.chunks.map((chunk) => - this.resolvePath(`${this.rawDllConfig.entryName}${chunk}${this.rawDllConfig.styleExt}`) - ); - } - - async ensureEntryFilesExists() { - const entryPaths = this.getEntryPaths(); - - await Promise.all(entryPaths.map(async (entryPath) => await this.ensureFileExists(entryPath))); - } - - async ensureManifestFilesExists() { - const manifestPaths = this.getManifestPaths(); - - await Promise.all( - manifestPaths.map( - async (manifestPath, idx) => - await this.ensureFileExists( - manifestPath, - JSON.stringify({ - name: `${this.rawDllConfig.entryName}${this.rawDllConfig.chunks[idx]}`, - content: {}, - }) - ) - ) - ); - } - - async ensureStyleFileExists() { - const stylePaths = this.getStylePaths(); - - await Promise.all(stylePaths.map(async (stylePath) => await this.ensureFileExists(stylePath))); - } - - async ensureFileExists(filePath, content) { - const exists = await this.ensurePathExists(filePath); - - if (!exists) { - await this.upsertFile(filePath, content); - } - } - - async ensurePathExists(filePath) { - try { - await accessAsync(filePath); - } catch (e) { - await mkdirAsync(path.dirname(filePath), { recursive: true }); - return false; - } - - return true; - } - - async ensureOutputPathExists() { - await this.ensurePathExists(this.rawDllConfig.outputPath); - } - - dllsExistsSync() { - const dllPaths = this.getDllPaths(); - - return dllPaths.every((dllPath) => this.existsSync(dllPath)); - } - - existsSync(filePath) { - return fs.existsSync(filePath); - } - - resolvePath() { - return path.resolve(this.rawDllConfig.outputPath, ...arguments); - } - - async readEntryFiles() { - const entryPaths = this.getEntryPaths(); - - const entryFilesContent = await Promise.all( - entryPaths.map(async (entryPath) => await this.readFile(entryPath)) - ); - - // merge all the module contents from entry files again into - // sorted single one - return dllMergeAllEntryFilesContent(entryFilesContent); - } - - async readFile(filePath, content) { - await this.ensureFileExists(filePath, content); - return await readFileAsync(filePath, 'utf8'); - } - - async run(dllEntries) { - const dllConfig = this.dllConfigGenerator(this.rawDllConfig); - await this.upsertEntryFiles(dllEntries); - - try { - this.logWithMetadata( - ['info', 'optimize:dynamic_dll_plugin'], - 'Client vendors dll compilation started' - ); - - await this.runWebpack(dllConfig()); - - this.logWithMetadata( - ['info', 'optimize:dynamic_dll_plugin'], - `Client vendors dll compilation finished with success` - ); - } catch (e) { - this.logWithMetadata( - ['fatal', 'optimize:dynamic_dll_plugin'], - `Client vendors dll compilation failed` - ); - - // Still throw the original error has here we just want - // log the fail message - throw e; - } - - // Style dll file isn't always created but we are - // expecting it to exist always as we are referencing - // it from the bootstrap template - // - // NOTE: We should review the way we deal with the css extraction - // in ours webpack builds. The industry standard is about to - // only extract css for production but we are extracting it - // in every single compilation. - await this.ensureStyleFileExists(); - } - - dllConfigGenerator(dllConfig) { - return configModel.bind(this, dllConfig); - } - - async runWebpack(config) { - return new Promise((resolve, reject) => { - webpack(config, async (err, stats) => { - // If a critical error occurs or we have - // errors in the stats compilation, - // reject the promise and logs the errors - const webpackErrors = - err || - (stats.hasErrors() && - stats.toString({ - all: false, - colors: true, - errors: true, - errorDetails: true, - moduleTrace: true, - })); - - if (webpackErrors) { - // Reject with webpack fatal errors - return reject(webpackErrors); - } - - // Identify if we have not allowed modules - // bundled inside the dll bundle - const notAllowedModules = []; - - stats.compilation.modules.forEach((module) => { - // ignore if no module or userRequest are defined - if (!module || !module.resource) { - return; - } - - // ignore if this module represents the - // dll entry file - if (this.getEntryPaths().includes(module.resource)) { - return; - } - - // ignore if this module is part of the - // files inside dynamic dll plugin public folder - if (inDllPluginPublic(module.resource)) { - return; - } - - // A module is not allowed if it's not a node_module, a webpackShim - // or the reasons from being bundled into the dll are not node_modules - if (notInNodeModulesOrWebpackShims(module.resource)) { - const reasons = module.reasons || []; - - reasons.forEach((reason) => { - // Skip if we can't read the reason info - if (!reason || !reason.module || !reason.module.resource) { - return; - } - - // Is the reason for this module being bundle a - // node_module or no? - if (notInNodeModules(reason.module.resource)) { - notAllowedModules.push(module.resource); - } - }); - } - }); - - if (notAllowedModules.length) { - // Delete the built dll, as it contains invalid modules, and reject listing - // all the not allowed modules - try { - await del(this.rawDllConfig.outputPath); - } catch (e) { - return reject(e); - } - - return reject( - `The following modules are not allowed to be bundled into the dll: \n${notAllowedModules.join( - '\n' - )}` - ); - } - - // Otherwise it has succeed - return resolve(stats); - }); - }); - } -} diff --git a/src/optimize/dynamic_dll_plugin/dll_config_model.js b/src/optimize/dynamic_dll_plugin/dll_config_model.js deleted file mode 100644 index eec369b194fef..0000000000000 --- a/src/optimize/dynamic_dll_plugin/dll_config_model.js +++ /dev/null @@ -1,278 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { IS_KIBANA_DISTRIBUTABLE } from '../../legacy/utils'; -import { fromRoot } from '../../core/server/utils'; -import webpack from 'webpack'; -import webpackMerge from 'webpack-merge'; -import MiniCssExtractPlugin from 'mini-css-extract-plugin'; -import TerserPlugin from 'terser-webpack-plugin'; -import * as UiSharedDeps from '@kbn/ui-shared-deps'; - -function generateDLL(config) { - const { - dllAlias, - dllValidateSyntax, - dllNoParseRules, - dllContext, - dllEntry, - dllOutputPath, - dllPublicPath, - dllBundleName, - dllBundleFilename, - dllStyleFilename, - dllManifestPath, - babelLoaderCacheDir, - threadLoaderPoolConfig, - } = config; - - const BABEL_PRESET_PATH = require.resolve('@kbn/babel-preset/webpack_preset'); - const BABEL_EXCLUDE_RE = [/[\/\\](webpackShims|node_modules|bower_components)[\/\\]/]; - - /** - * Wrap plugin loading in a function so that we can require - * `@kbn/optimizer` only when absolutely necessary since we - * don't ship this package in the distributable but this code - * is still shipped, though it's not used. - */ - const getValidateSyntaxPlugins = () => { - if (!dllValidateSyntax) { - return []; - } - - // only require @kbn/optimizer - const { DisallowedSyntaxPlugin } = require('@kbn/optimizer'); - return [new DisallowedSyntaxPlugin()]; - }; - - return { - entry: dllEntry, - context: dllContext, - output: { - futureEmitAssets: true, // TODO: remove on webpack 5 - filename: dllBundleFilename, - path: dllOutputPath, - publicPath: dllPublicPath, - library: dllBundleName, - }, - node: { fs: 'empty', child_process: 'empty', dns: 'empty', net: 'empty', tls: 'empty' }, - resolve: { - extensions: ['.js', '.json'], - mainFields: ['browser', 'browserify', 'main'], - alias: dllAlias, - modules: ['webpackShims', fromRoot('webpackShims'), 'node_modules', fromRoot('node_modules')], - }, - module: { - rules: [ - { - resource: [ - { - test: /\.js$/, - exclude: BABEL_EXCLUDE_RE.concat(dllNoParseRules), - }, - { - test: /\.js$/, - include: /[\/\\]node_modules[\/\\]x-pack[\/\\]/, - exclude: /[\/\\]node_modules[\/\\]x-pack[\/\\](.+?[\/\\])*node_modules[\/\\]/, - }, - // TODO: remove when we drop support for IE11 - // We need because normalize-url is distributed without - // any kind of transpilation - // More info: https://github.com/elastic/kibana/pull/35804 - { - test: /\.js$/, - include: /[\/\\]node_modules[\/\\]normalize-url[\/\\]/, - exclude: /[\/\\]node_modules[\/\\]normalize-url[\/\\](.+?[\/\\])*node_modules[\/\\]/, - }, - ], - // Self calling function with the equivalent logic - // from maybeAddCacheLoader one from base optimizer - use: ((babelLoaderCacheDirPath, loaders) => { - return [ - { - loader: 'cache-loader', - options: { - cacheContext: fromRoot('.'), - cacheDirectory: babelLoaderCacheDirPath, - readOnly: process.env.KBN_CACHE_LOADER_WRITABLE ? false : IS_KIBANA_DISTRIBUTABLE, - }, - }, - ...loaders, - ]; - })(babelLoaderCacheDir, [ - { - loader: 'thread-loader', - options: threadLoaderPoolConfig, - }, - { - loader: 'babel-loader', - options: { - babelrc: false, - presets: [BABEL_PRESET_PATH], - }, - }, - ]), - }, - { - test: /\.(html|tmpl)$/, - loader: 'raw-loader', - }, - { - test: /\.css$/, - use: [MiniCssExtractPlugin.loader, 'css-loader'], - }, - { - test: /\.png$/, - loader: 'url-loader', - }, - { - test: /\.(woff|woff2|ttf|eot|svg|ico)(\?|$)/, - loader: 'file-loader', - }, - ], - noParse: dllNoParseRules, - }, - plugins: [ - new webpack.DllPlugin({ - context: dllContext, - name: dllBundleName, - path: dllManifestPath, - }), - new MiniCssExtractPlugin({ - filename: dllStyleFilename, - }), - ...getValidateSyntaxPlugins(), - ], - // Single runtime for the dll bundles which assures that common transient dependencies won't be evaluated twice. - // The module cache will be shared, even when module code may be duplicated across chunks. - optimization: { - runtimeChunk: { - name: 'vendors_runtime', - }, - }, - performance: { - // NOTE: we are disabling this as those hints - // are more tailored for the final bundles result - // and not for the webpack compilations performance itself - hints: false, - }, - externals: { - ...UiSharedDeps.externals, - }, - }; -} - -function extendRawConfig(rawConfig) { - // Build all extended configs from raw config - const dllAlias = rawConfig.uiBundles.getAliases(); - const dllValidateSyntax = rawConfig.uiBundles.shouldValidateSyntaxOfNodeModules(); - const dllNoParseRules = rawConfig.uiBundles.getWebpackNoParseRules(); - const dllDevMode = rawConfig.uiBundles.isDevMode(); - const dllContext = rawConfig.context; - const dllChunks = rawConfig.chunks; - const dllEntry = {}; - const dllEntryName = rawConfig.entryName; - const dllBundleName = rawConfig.dllName; - const dllManifestName = rawConfig.dllName; - const dllStyleName = rawConfig.styleName; - const dllEntryExt = rawConfig.entryExt; - const dllBundleExt = rawConfig.dllExt; - const dllManifestExt = rawConfig.manifestExt; - const dllStyleExt = rawConfig.styleExt; - const dllOutputPath = rawConfig.outputPath; - const dllPublicPath = rawConfig.publicPath; - const dllBundleFilename = `${dllBundleName}${dllBundleExt}`; - const dllManifestPath = `${dllOutputPath}/${dllManifestName}${dllManifestExt}`; - const dllStyleFilename = `${dllStyleName}${dllStyleExt}`; - const babelLoaderCacheDir = rawConfig.babelLoaderCacheDir; - const threadLoaderPoolConfig = rawConfig.threadLoaderPoolConfig; - - // Create webpack entry object key with the provided dllEntryName - dllChunks.reduce((dllEntryObj, chunk) => { - dllEntryObj[`${dllEntryName}${chunk}`] = [ - `${dllOutputPath}/${dllEntryName}${chunk}${dllEntryExt}`, - ]; - return dllEntryObj; - }, dllEntry); - - // Export dll config map - return { - dllAlias, - dllValidateSyntax, - dllNoParseRules, - dllDevMode, - dllContext, - dllEntry, - dllOutputPath, - dllPublicPath, - dllBundleName, - dllBundleFilename, - dllStyleFilename, - dllManifestPath, - babelLoaderCacheDir, - threadLoaderPoolConfig, - }; -} - -function common(config) { - return webpackMerge(generateDLL(config)); -} - -function optimized() { - return webpackMerge({ - mode: 'production', - optimization: { - minimizer: [ - new TerserPlugin({ - // NOTE: we should not enable that option for now - // Since 2.0.0 terser-webpack-plugin is using jest-worker - // to run tasks in a pool of workers. Currently it looks like - // is requiring too much memory and break on large entry points - // compilations (like this) one. Also the gain we have enabling - // that option was barely noticed. - // https://github.com/webpack-contrib/terser-webpack-plugin/issues/143 - parallel: false, - sourceMap: false, - cache: false, - extractComments: false, - terserOptions: { - compress: false, - mangle: false, - }, - }), - ], - }, - }); -} - -function unoptimized() { - return webpackMerge({ - mode: 'development', - }); -} - -export function configModel(rawConfig = {}) { - const config = extendRawConfig(rawConfig); - - if (config.dllDevMode) { - return webpackMerge(common(config), unoptimized()); - } - - return webpackMerge(common(config), optimized()); -} diff --git a/src/optimize/dynamic_dll_plugin/dll_entry_template.js b/src/optimize/dynamic_dll_plugin/dll_entry_template.js deleted file mode 100644 index 351bed4e591ba..0000000000000 --- a/src/optimize/dynamic_dll_plugin/dll_entry_template.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -export function dllEntryTemplate(requirePaths = []) { - return requirePaths - .map((path) => `require('${path}');`) - .sort() - .join('\n'); -} - -export function dllEntryFileContentStringToArray(content = '') { - return content.split('\n'); -} - -export function dllEntryFileContentArrayToString(content = []) { - return content.join('\n'); -} - -export function dllMergeAllEntryFilesContent(content = []) { - return content.join('\n').split('\n').sort().join('\n'); -} diff --git a/src/optimize/dynamic_dll_plugin/dynamic_dll_plugin.js b/src/optimize/dynamic_dll_plugin/dynamic_dll_plugin.js deleted file mode 100644 index fb6f6e097b5cd..0000000000000 --- a/src/optimize/dynamic_dll_plugin/dynamic_dll_plugin.js +++ /dev/null @@ -1,354 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { DllCompiler } from './dll_compiler'; -import { notInNodeModulesOrWebpackShims, inPluginNodeModules } from './dll_allowed_modules'; -import { IS_KIBANA_DISTRIBUTABLE } from '../../legacy/utils'; -import { dllEntryTemplate } from './dll_entry_template'; -import RawModule from 'webpack/lib/RawModule'; -import webpack from 'webpack'; -import path from 'path'; -import normalizePosixPath from 'normalize-path'; -import fs from 'fs'; -import { promisify } from 'util'; - -const realPathAsync = promisify(fs.realpath); -const DLL_ENTRY_STUB_MODULE_TYPE = 'javascript/dll-entry-stub'; - -export class DynamicDllPlugin { - constructor({ uiBundles, threadLoaderPoolConfig, logWithMetadata, maxCompilations = 1 }) { - this.logWithMetadata = logWithMetadata || (() => null); - this.dllCompiler = new DllCompiler(uiBundles, threadLoaderPoolConfig, logWithMetadata); - this.entryPaths = dllEntryTemplate(); - this.afterCompilationEntryPaths = dllEntryTemplate(); - this.maxCompilations = maxCompilations; - this.performedCompilations = 0; - this.forceDLLCreationFlag = !!(process && process.env && process.env.FORCE_DLL_CREATION); - } - - async init() { - await this.dllCompiler.init(); - this.entryPaths = await this.dllCompiler.readEntryFiles(); - } - - apply(compiler) { - // Just register the init basic hooks - // in order to run the init function - this.registerInitBasicHooks(compiler); - // The dll reference should always be bind to the - // main webpack config. - this.bindDllReferencePlugin(compiler); - - // Verify if we must init and run the dynamic dll plugin tasks. - // We must run it every time we are not under a distributable env - if (!this.mustRunDynamicDllPluginTasks()) { - return; - } - - // This call init all the DynamicDllPlugin tasks - // as it attaches the plugin to the main webpack - // lifecycle hooks needed to perform the logic - this.registerTasksHooks(compiler); - } - - bindDllReferencePlugin(compiler) { - const rawDllConfig = this.dllCompiler.rawDllConfig; - const dllContext = rawDllConfig.context; - const dllManifestPaths = this.dllCompiler.getManifestPaths(); - - dllManifestPaths.forEach((dllChunkManifestPath) => { - new webpack.DllReferencePlugin({ - context: dllContext, - manifest: dllChunkManifestPath, - }).apply(compiler); - }); - } - - registerInitBasicHooks(compiler) { - this.registerRunHook(compiler); - this.registerWatchRunHook(compiler); - } - - registerTasksHooks(compiler) { - this.logWithMetadata( - ['info', 'optimize:dynamic_dll_plugin'], - 'Started dynamic dll plugin tasks' - ); - this.registerBeforeCompileHook(compiler); - this.registerCompilationHook(compiler); - this.registerDoneHook(compiler); - } - - registerRunHook(compiler) { - compiler.hooks.run.tapPromise('DynamicDllPlugin', async () => { - await this.init(); - }); - } - - registerWatchRunHook(compiler) { - compiler.hooks.watchRun.tapPromise('DynamicDllPlugin', async () => { - await this.init(); - }); - } - - registerBeforeCompileHook(compiler) { - compiler.hooks.beforeCompile.tapPromise('DynamicDllPlugin', async ({ normalModuleFactory }) => { - normalModuleFactory.hooks.factory.tap('DynamicDllPlugin', (actualFactory) => (params, cb) => { - // This is used in order to avoid the cache for DLL modules - // resolved from other dependencies - normalModuleFactory.cachePredicate = (module) => - !(module.stubType === DLL_ENTRY_STUB_MODULE_TYPE); - - // Overrides the normalModuleFactory module creation behaviour - // in order to understand the modules we need to add to the DLL - actualFactory(params, (error, module) => { - if (error || !module) { - cb(error, module); - } else { - this.mapNormalModule(module).then( - (m = module) => cb(undefined, m), - (error) => cb(error) - ); - } - }); - }); - }); - } - - registerCompilationHook(compiler) { - compiler.hooks.compilation.tap('DynamicDllPlugin', (compilation) => { - compilation.hooks.needAdditionalPass.tap('DynamicDllPlugin', () => { - // Run the procedures in order to execute our dll compilation - // The process is very straightforward in it's conception: - // - // * 1 - loop through every compilation module in order to start building - // the dll entry paths arrays and assume it is the new entry paths - // * 1.1 - start from adding the modules already included into the dll, if any. - // * 1.2 - adding the new discovered stub modules - // * 1.3 - check if the module added to the entry path is from node_modules or - // webpackShims, otherwise throw an error. - // * 1.3.1 - for the entry path modules coming from webpackShims search for every - // require statements inside of them - // * 1.3.2 - discard the ones that are not js dependencies - // * 1.3.3 - add those new discovered dependencies inside the webpackShims to the - // entry paths array - // * 2 - compare the built entry paths and compares it to the old one (if any) - // * 3 - runs a new dll compilation in case there is none old entry paths or if the - // new built one differs from the old one. - // - const rawDllConfig = this.dllCompiler.rawDllConfig; - const dllContext = rawDllConfig.context; - const dllOutputPath = rawDllConfig.outputPath; - const requiresMap = {}; - - for (const module of compilation.modules) { - // re-include requires for modules already handled by the dll - if (module.delegateData) { - const absoluteResource = path.resolve(dllContext, module.userRequest); - if ( - absoluteResource.includes('node_modules') || - absoluteResource.includes('webpackShims') - ) { - // NOTE: normalizePosixPath is been used as we only want to have posix - // paths inside our final dll entry file - requiresMap[ - normalizePosixPath(path.relative(dllOutputPath, absoluteResource)) - ] = true; - } - } - - // include requires for modules that need to be added to the dll - if (module.stubType === DLL_ENTRY_STUB_MODULE_TYPE) { - requiresMap[ - normalizePosixPath(path.relative(dllOutputPath, module.stubResource)) - ] = true; - } - } - - // Sort and join all the discovered require deps - // in order to create a consistent entry file - this.afterCompilationEntryPaths = dllEntryTemplate(Object.keys(requiresMap)); - // The dll compilation will run if on of the following conditions return true: - // 1 - the new generated entry paths are different from the - // old ones - // 2 - if no dll bundle is yet created - // 3 - if this.forceDLLCreationFlag were set from the node env var FORCE_DLL_CREATION and - // we are not running over the distributable. If we are running under the watch optimizer, - // this.forceDLLCreationFlag will only be applied in the very first execution, - // then will be set to false - compilation.needsDLLCompilation = - this.afterCompilationEntryPaths !== this.entryPaths || - !this.dllCompiler.dllsExistsSync() || - (this.isToForceDLLCreation() && this.performedCompilations === 0); - this.entryPaths = this.afterCompilationEntryPaths; - - // Only run this info log in the first performed dll compilation - // per each execution run - if (this.performedCompilations === 0) { - this.logWithMetadata( - ['info', 'optimize:dynamic_dll_plugin'], - compilation.needsDLLCompilation - ? 'Need to compile the client vendors dll' - : 'No need to compile client vendors dll' - ); - } - - return compilation.needsDLLCompilation; - }); - }); - } - - registerDoneHook(compiler) { - compiler.hooks.done.tapPromise('DynamicDllPlugin', async (stats) => { - if (stats.compilation.needsDLLCompilation) { - // Run the dlls compiler and increment - // the performed compilations - // - // NOTE: check the need for this extra try/catch after upgrading - // past webpack v4.29.3. For now it is needed so we can log the error - // otherwise the error log we'll get will be something like: [fatal] [object Object] - try { - await this.runDLLCompiler(compiler); - } catch (error) { - this.logWithMetadata(['error', 'optimize:dynamic_dll_plugin'], error.message); - throw error; - } - - return; - } - - this.performedCompilations = 0; - // reset this flag var set from the node env FORCE_DLL_CREATION on init, - // has the force_dll_creation is only valid for the very first run - if (this.forceDLLCreationFlag) { - this.forceDLLCreationFlag = false; - } - this.logWithMetadata( - ['info', 'optimize:dynamic_dll_plugin'], - 'Finished all dynamic dll plugin tasks' - ); - }); - } - - isToForceDLLCreation() { - return this.forceDLLCreationFlag; - } - - mustRunDynamicDllPluginTasks() { - return !IS_KIBANA_DISTRIBUTABLE || this.isToForceDLLCreation(); - } - - async mapNormalModule(module) { - // ignore anything that doesn't have a resource (ignored) or is already delegating to the DLL - if (!module.resource || module.delegateData) { - return; - } - - // ignore anything that needs special loaders or config - if (module.request.includes('!') || module.request.includes('?')) { - return; - } - - // ignore files that are not in node_modules - if (notInNodeModulesOrWebpackShims(module.resource)) { - return; - } - - // also ignore files that are symlinked into node_modules, but only - // do the `realpath` call after checking the plain resource path - if (notInNodeModulesOrWebpackShims(await realPathAsync(module.resource))) { - return; - } - - const dirs = module.resource.split(path.sep); - const nodeModuleName = dirs[dirs.lastIndexOf('node_modules') + 1]; - - // ignore webpack loader modules - if (nodeModuleName.endsWith('-loader')) { - return; - } - - // ignore modules from plugins - if (inPluginNodeModules(module.resource)) { - return; - } - - // also ignore files that are symlinked into plugins node_modules, but only - // do the `realpath` call after checking the plain resource path - if (inPluginNodeModules(await realPathAsync(module.resource))) { - return; - } - - // This is a StubModule (as a RawModule) in order - // to mimic the missing modules from the DLL and - // also hold useful metadata - const stubModule = new RawModule( - `/* pending dll entry */`, - `dll pending:${module.resource}`, - module.resource - ); - stubModule.stubType = DLL_ENTRY_STUB_MODULE_TYPE; - stubModule.stubResource = module.resource; - stubModule.stubOriginalModule = module; - - return stubModule; - } - - async assertMaxCompilations() { - // Logic to run the max compilation requirements. - // Only enable this for CI builds in order to ensure - // we have an healthy dll ecosystem. - if (this.performedCompilations === this.maxCompilations) { - throw new Error( - 'All the allowed dll compilations were already performed and one more is needed which is not possible' - ); - } - } - - async runDLLCompiler(mainCompiler) { - const runCompilerErrors = []; - - try { - await this.dllCompiler.run(this.entryPaths); - } catch (e) { - runCompilerErrors.push(e); - } - - try { - await this.assertMaxCompilations(); - } catch (e) { - runCompilerErrors.push(e); - } - - // We need to purge the cache into the inputFileSystem - // for every single built in previous compilation - // that we rely in next ones. - this.dllCompiler - .getManifestPaths() - .forEach((chunkDllManifestPath) => mainCompiler.inputFileSystem.purge(chunkDllManifestPath)); - - this.performedCompilations++; - - if (!runCompilerErrors.length) { - return; - } - - throw new Error(runCompilerErrors.join('\n-')); - } -} diff --git a/src/optimize/dynamic_dll_plugin/index.js b/src/optimize/dynamic_dll_plugin/index.js deleted file mode 100644 index 347811b5356b7..0000000000000 --- a/src/optimize/dynamic_dll_plugin/index.js +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -export { DynamicDllPlugin } from './dynamic_dll_plugin'; -export { DllCompiler } from './dll_compiler'; diff --git a/src/optimize/optimize_mixin.ts b/src/optimize/optimize_mixin.ts index 9a3f08e2f667e..947c918a567f5 100644 --- a/src/optimize/optimize_mixin.ts +++ b/src/optimize/optimize_mixin.ts @@ -22,8 +22,6 @@ import Hapi from 'hapi'; // @ts-ignore not TS yet import FsOptimizer from './fs_optimizer'; import { createBundlesRoute } from './bundles_route'; -// @ts-ignore not TS yet -import { DllCompiler } from './dynamic_dll_plugin'; import { fromRoot } from '../core/server/utils'; import { getNpUiPluginPublicDirs } from './np_ui_plugin_public_dirs'; import KbnServer, { KibanaConfig } from '../legacy/server/kbn_server'; @@ -40,7 +38,7 @@ export const optimizeMixin = async ( // bundles in a "middleware" style. // // the server listening on 5601 may be restarted a number of times, depending - // on the watch setup managed by the cli. It proxies all bundles/* and built_assets/dlls/* + // on the watch setup managed by the cli. It proxies all bundles/* // requests to the other server. The server on 5602 is long running, in order // to prevent complete rebuilds of the optimize content. const watch = config.get('optimize.watch'); @@ -53,7 +51,6 @@ export const optimizeMixin = async ( server.route( createBundlesRoute({ regularBundlesPath: uiBundles.getWorkingDir(), - dllBundlesPath: DllCompiler.getRawDllConfig().outputPath, basePublicPath: config.get('server.basePath'), builtCssPath: fromRoot('built_assets/css'), npUiPluginPublicDirs: getNpUiPluginPublicDirs(kbnServer), diff --git a/src/optimize/watch/optmzr_role.js b/src/optimize/watch/optmzr_role.js index ba8007e1065b4..0057c04219ec6 100644 --- a/src/optimize/watch/optmzr_role.js +++ b/src/optimize/watch/optmzr_role.js @@ -17,12 +17,8 @@ * under the License. */ -import { resolve } from 'path'; - import WatchServer from './watch_server'; import WatchOptimizer, { STATUS } from './watch_optimizer'; -import { DllCompiler } from '../dynamic_dll_plugin'; -import { WatchCache } from './watch_cache'; import { getNpUiPluginPublicDirs } from '../np_ui_plugin_public_dirs'; export default async (kbnServer, kibanaHapiServer, config) => { @@ -36,12 +32,6 @@ export default async (kbnServer, kibanaHapiServer, config) => { sourceMaps: config.get('optimize.sourceMaps'), workers: config.get('optimize.workers'), prebuild: config.get('optimize.watchPrebuild'), - watchCache: new WatchCache({ - logWithMetadata, - outputPath: config.get('path.data'), - dllsPath: DllCompiler.getRawDllConfig().outputPath, - cachePath: resolve(kbnServer.uiBundles.getCacheDirectory(), '../'), - }), }); const server = new WatchServer( diff --git a/src/optimize/watch/watch.js b/src/optimize/watch/watch.js index a284da11f294f..7774577fb7677 100644 --- a/src/optimize/watch/watch.js +++ b/src/optimize/watch/watch.js @@ -32,7 +32,7 @@ export default async (kbnServer) => { * while the optimizer is running * * server: this process runs the entire kibana server and proxies - * all requests for /bundles/* or /built_assets/dlls/* to the optmzr process + * all requests for /bundles/* to the optmzr process * * @param {string} process.env.kbnWorkerType */ diff --git a/src/optimize/watch/watch_cache.ts b/src/optimize/watch/watch_cache.ts deleted file mode 100644 index 40bd1d6075f47..0000000000000 --- a/src/optimize/watch/watch_cache.ts +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { createHash } from 'crypto'; -import { readFile, writeFile, readdir, unlink, rmdir } from 'fs'; -import { resolve } from 'path'; -import { promisify } from 'util'; -import path from 'path'; -import del from 'del'; -import normalizePosixPath from 'normalize-path'; - -const readAsync = promisify(readFile); -const writeAsync = promisify(writeFile); -const readdirAsync = promisify(readdir); -const unlinkAsync = promisify(unlink); -const rmdirAsync = promisify(rmdir); - -interface Params { - logWithMetadata: (tags: string[], message: string, metadata?: { [key: string]: any }) => void; - outputPath: string; - dllsPath: string; - cachePath: string; -} - -interface WatchCacheStateContent { - optimizerConfigSha?: string; - yarnLockSha?: string; -} - -export class WatchCache { - private readonly logWithMetadata: Params['logWithMetadata']; - private readonly outputPath: Params['outputPath']; - private readonly dllsPath: Params['dllsPath']; - private readonly cachePath: Params['cachePath']; - private readonly cacheState: WatchCacheStateContent; - private statePath: string; - private diskCacheState: WatchCacheStateContent; - private isInitialized: boolean; - - constructor(params: Params) { - this.logWithMetadata = params.logWithMetadata; - this.outputPath = params.outputPath; - this.dllsPath = params.dllsPath; - this.cachePath = params.cachePath; - - this.isInitialized = false; - this.statePath = ''; - this.cacheState = {}; - this.diskCacheState = {}; - this.cacheState.yarnLockSha = ''; - this.cacheState.optimizerConfigSha = ''; - } - - public async tryInit() { - if (!this.isInitialized) { - this.statePath = resolve(this.outputPath, 'watch_optimizer_cache_state.json'); - this.diskCacheState = await this.read(); - this.cacheState.yarnLockSha = await this.buildYarnLockSha(); - this.cacheState.optimizerConfigSha = await this.buildOptimizerConfigSha(); - this.isInitialized = true; - } - } - - public async tryReset() { - await this.tryInit(); - - if (!this.isResetNeeded()) { - return; - } - - await this.reset(); - } - - public async reset() { - this.logWithMetadata(['info', 'optimize:watch_cache'], 'The optimizer watch cache will reset'); - - // start by deleting the state file to lower the - // amount of time that another process might be able to - // successfully read it once we decide to delete it - await del(this.statePath, { force: true }); - - // delete everything in optimize/.cache directory - await recursiveDelete(normalizePosixPath(this.cachePath)); - - // delete dlls - await del(this.dllsPath); - - // re-write new cache state file - await this.write(); - - this.logWithMetadata(['info', 'optimize:watch_cache'], 'The optimizer watch cache has reset'); - } - - private async buildShaWithMultipleFiles(filePaths: string[]) { - const shaHash = createHash('sha1'); - - for (const filePath of filePaths) { - try { - shaHash.update(await readAsync(filePath, 'utf8'), 'utf8'); - } catch (e) { - /* no-op */ - } - } - - return shaHash.digest('hex'); - } - - private async buildYarnLockSha() { - const kibanaYarnLock = resolve(__dirname, '../../../yarn.lock'); - - return await this.buildShaWithMultipleFiles([kibanaYarnLock]); - } - - private async buildOptimizerConfigSha() { - const baseOptimizer = resolve(__dirname, '../base_optimizer.js'); - const dynamicDllConfigModel = resolve(__dirname, '../dynamic_dll_plugin/dll_config_model.js'); - const dynamicDllPlugin = resolve(__dirname, '../dynamic_dll_plugin/dynamic_dll_plugin.js'); - - return await this.buildShaWithMultipleFiles([ - baseOptimizer, - dynamicDllConfigModel, - dynamicDllPlugin, - ]); - } - - private isResetNeeded() { - return this.hasYarnLockChanged() || this.hasOptimizerConfigChanged(); - } - - private hasYarnLockChanged() { - return this.cacheState.yarnLockSha !== this.diskCacheState.yarnLockSha; - } - - private hasOptimizerConfigChanged() { - return this.cacheState.optimizerConfigSha !== this.diskCacheState.optimizerConfigSha; - } - - private async write() { - await writeAsync(this.statePath, JSON.stringify(this.cacheState, null, 2), 'utf8'); - this.diskCacheState = this.cacheState; - } - - private async read(): Promise { - try { - return JSON.parse(await readAsync(this.statePath, 'utf8')); - } catch (error) { - return {}; - } - } -} - -/** - * Recursively deletes a folder. This is a workaround for a bug in `del` where - * very large folders (with 84K+ files) cause a stack overflow. - */ -async function recursiveDelete(directory: string) { - try { - const entries = await readdirAsync(directory, { withFileTypes: true }); - - await Promise.all( - entries.map((entry) => { - const absolutePath = path.join(directory, entry.name); - return entry.isDirectory() ? recursiveDelete(absolutePath) : unlinkAsync(absolutePath); - }) - ); - - return rmdirAsync(directory); - } catch (error) { - if (error.code !== 'ENOENT') { - throw error; - } - } -} diff --git a/src/optimize/watch/watch_optimizer.js b/src/optimize/watch/watch_optimizer.js index 816185e544ab5..000c03ffb34fe 100644 --- a/src/optimize/watch/watch_optimizer.js +++ b/src/optimize/watch/watch_optimizer.js @@ -19,7 +19,6 @@ import BaseOptimizer from '../base_optimizer'; import { createBundlesRoute } from '../bundles_route'; -import { DllCompiler } from '../dynamic_dll_plugin'; import { fromRoot } from '../../core/server/utils'; import * as Rx from 'rxjs'; import { mergeMap, take } from 'rxjs/operators'; @@ -35,7 +34,6 @@ export default class WatchOptimizer extends BaseOptimizer { constructor(opts) { super(opts); this.prebuild = opts.prebuild || false; - this.watchCache = opts.watchCache; this.status$ = new Rx.ReplaySubject(1); } @@ -43,9 +41,6 @@ export default class WatchOptimizer extends BaseOptimizer { this.initializing = true; this.initialBuildComplete = false; - // try reset the watch optimizer cache - await this.watchCache.tryReset(); - // log status changes this.status$.subscribe(this.onStatusChangeHandler); await this.uiBundles.resetBundleDir(); @@ -120,7 +115,6 @@ export default class WatchOptimizer extends BaseOptimizer { npUiPluginPublicDirs: npUiPluginPublicDirs, buildHash, regularBundlesPath: this.compiler.outputPath, - dllBundlesPath: DllCompiler.getRawDllConfig().outputPath, basePublicPath: basePath, builtCssPath: fromRoot('built_assets/css'), }) diff --git a/tasks/config/karma.js b/tasks/config/karma.js index fa4bdc8ed2266..114e09876406c 100644 --- a/tasks/config/karma.js +++ b/tasks/config/karma.js @@ -21,7 +21,6 @@ import { dirname } from 'path'; import { times } from 'lodash'; import { makeJunitReportPath } from '@kbn/test'; import * as UiSharedDeps from '@kbn/ui-shared-deps'; -import { DllCompiler } from '../../src/optimize/dynamic_dll_plugin'; const TOTAL_CI_SHARDS = 4; const ROOT = dirname(require.resolve('../../package.json')); @@ -63,12 +62,6 @@ module.exports = function (grunt) { ), `http://localhost:5610/${buildHash}/bundles/kbn-ui-shared-deps/${UiSharedDeps.jsFilename}`, - `http://localhost:5610/${buildHash}/built_assets/dlls/vendors_runtime.bundle.dll.js`, - ...DllCompiler.getRawDllConfig().chunks.map( - (chunk) => - `http://localhost:5610/${buildHash}/built_assets/dlls/vendors${chunk}.bundle.dll.js` - ), - shardNum === undefined ? `http://localhost:5610/${buildHash}/bundles/tests.bundle.js` : `http://localhost:5610/${buildHash}/bundles/tests.bundle.js?shards=${TOTAL_CI_SHARDS}&shard_num=${shardNum}`, @@ -77,10 +70,6 @@ module.exports = function (grunt) { // this causes tilemap tests to fail, probably because the eui styles haven't been // included in the karma harness a long some time, if ever // `http://localhost:5610/bundles/kbn-ui-shared-deps/${UiSharedDeps.lightCssDistFilename}`, - ...DllCompiler.getRawDllConfig().chunks.map( - (chunk) => - `http://localhost:5610/${buildHash}/built_assets/dlls/vendors${chunk}.style.dll.css` - ), `http://localhost:5610/${buildHash}/bundles/tests.style.css`, ]; } @@ -133,7 +122,6 @@ module.exports = function (grunt) { '/tests/': 'http://localhost:5610/tests/', '/test_bundle/': 'http://localhost:5610/test_bundle/', [`/${buildHash}/bundles/`]: `http://localhost:5610/${buildHash}/bundles/`, - [`/${buildHash}/built_assets/dlls/`]: `http://localhost:5610/${buildHash}/built_assets/dlls/`, }, client: { From 138c0417a7818097a4167cbb7d3057d9714a0cfe Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Fri, 17 Jul 2020 12:11:15 +0100 Subject: [PATCH 12/59] skip flaky suite (#60865) --- x-pack/test/api_integration/apis/fleet/agents/enroll.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/test/api_integration/apis/fleet/agents/enroll.ts b/x-pack/test/api_integration/apis/fleet/agents/enroll.ts index e9f7471f6437e..8a21fbcf24c7d 100644 --- a/x-pack/test/api_integration/apis/fleet/agents/enroll.ts +++ b/x-pack/test/api_integration/apis/fleet/agents/enroll.ts @@ -21,7 +21,8 @@ export default function (providerContext: FtrProviderContext) { let apiKey: { id: string; api_key: string }; let kibanaVersion: string; - describe('fleet_agents_enroll', () => { + // Flaky: https://github.com/elastic/kibana/issues/60865 + describe.skip('fleet_agents_enroll', () => { before(async () => { await esArchiver.loadIfNeeded('fleet/agents'); From 19def177f4806710897e8d148cb06ac4b103a981 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=AA=20Marcondes?= <55978943+cauemarcondes@users.noreply.github.com> Date: Fri, 17 Jul 2020 12:15:15 +0100 Subject: [PATCH 13/59] replacing hard coded links for ela.st (#72240) --- .../observability/public/components/app/header/index.tsx | 5 +---- .../public/components/app/ingest_manager_panel/index.tsx | 2 +- .../observability/public/components/app/resources/index.tsx | 6 +++--- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/x-pack/plugins/observability/public/components/app/header/index.tsx b/x-pack/plugins/observability/public/components/app/header/index.tsx index 1c6ce766d0901..531e6abf3d236 100644 --- a/x-pack/plugins/observability/public/components/app/header/index.tsx +++ b/x-pack/plugins/observability/public/components/app/header/index.tsx @@ -69,10 +69,7 @@ export const Header = ({ {showGiveFeedback && ( - + {i18n.translate('xpack.observability.home.feedback', { defaultMessage: 'Give us feedback', })} diff --git a/x-pack/plugins/observability/public/components/app/ingest_manager_panel/index.tsx b/x-pack/plugins/observability/public/components/app/ingest_manager_panel/index.tsx index f7a1deb83fbe4..41bcfa1da7fa1 100644 --- a/x-pack/plugins/observability/public/components/app/ingest_manager_panel/index.tsx +++ b/x-pack/plugins/observability/public/components/app/ingest_manager_panel/index.tsx @@ -40,7 +40,7 @@ export const IngestManagerPanel = () => { - + {i18n.translate('xpack.observability.ingestManafer.button', { defaultMessage: 'Try Ingest Manager Beta', })} diff --git a/x-pack/plugins/observability/public/components/app/resources/index.tsx b/x-pack/plugins/observability/public/components/app/resources/index.tsx index c330c358d022a..929802df3329b 100644 --- a/x-pack/plugins/observability/public/components/app/resources/index.tsx +++ b/x-pack/plugins/observability/public/components/app/resources/index.tsx @@ -13,21 +13,21 @@ const resources = [ label: i18n.translate('xpack.observability.resources.documentation', { defaultMessage: 'Documentation', }), - href: 'https://www.elastic.co/guide/en/observability/current/observability-ui.html', + href: 'https://ela.st/observability-documentation', }, { iconType: 'editorComment', label: i18n.translate('xpack.observability.resources.forum', { defaultMessage: 'Discuss forum', }), - href: 'https://discuss.elastic.co/c/observability/', + href: 'https://ela.st/observability-discuss', }, { iconType: 'training', label: i18n.translate('xpack.observability.resources.training', { defaultMessage: 'Observability fundamentals', }), - href: 'https://www.elastic.co/training/observability-fundamentals', + href: 'https://ela.st/observability-training', }, ]; From b4f07de564892c6460acd9f45d9db9e0f57d9b0d Mon Sep 17 00:00:00 2001 From: Christos Nasikas Date: Fri, 17 Jul 2020 15:00:34 +0300 Subject: [PATCH 14/59] [Security Solution][Case] Fix connector's dropdown with conflicting requests (#72037) --- .../cases/components/case_view/index.test.tsx | 28 ++++++++++ .../cases/components/case_view/index.tsx | 54 ++++++++++++++----- .../components/edit_connector/index.test.tsx | 27 +++++++++- .../cases/components/edit_connector/index.tsx | 13 +++-- .../user_action_tree/index.test.tsx | 2 +- .../components/user_action_tree/index.tsx | 5 +- .../cases/containers/use_update_case.test.tsx | 7 +++ .../cases/containers/use_update_case.tsx | 19 ++++++- .../events_viewer/events_viewer.test.tsx | 43 ++++----------- .../ml/anomaly/use_anomalies_table_data.ts | 4 +- .../public/common/containers/source/index.tsx | 4 +- .../rules/fetch_index_patterns.tsx | 4 +- .../timelines/store/timeline/helpers.ts | 4 +- 13 files changed, 154 insertions(+), 60 deletions(-) diff --git a/x-pack/plugins/security_solution/public/cases/components/case_view/index.test.tsx b/x-pack/plugins/security_solution/public/cases/components/case_view/index.test.tsx index b93df325b5a8b..4e29db4022e65 100644 --- a/x-pack/plugins/security_solution/public/cases/components/case_view/index.test.tsx +++ b/x-pack/plugins/security_solution/public/cases/components/case_view/index.test.tsx @@ -409,4 +409,32 @@ describe('CaseView ', () => { wrapper.find('button[data-test-subj="push-to-external-service"]').first().prop('disabled') ).toBeTruthy(); }); + + it('should revert to the initial connector in case of failure', async () => { + updateCaseProperty.mockImplementation(({ onError }) => { + onError(); + }); + const wrapper = mount( + + + + + + ); + await wait(); + wrapper.find('button[data-test-subj="dropdown-connectors"]').simulate('click'); + wrapper.update(); + wrapper.find('button[data-test-subj="dropdown-connector-servicenow-2"]').simulate('click'); + wrapper.update(); + wrapper.find(`[data-test-subj="edit-connectors-submit"]`).last().simulate('click'); + wrapper.update(); + await wait(); + wrapper.update(); + expect( + wrapper.find('[data-test-subj="dropdown-connectors"]').at(0).prop('valueOfSelected') + ).toBe('servicenow-1'); + }); }); diff --git a/x-pack/plugins/security_solution/public/cases/components/case_view/index.tsx b/x-pack/plugins/security_solution/public/cases/components/case_view/index.tsx index 3718249479b63..b23169af6ceb3 100644 --- a/x-pack/plugins/security_solution/public/cases/components/case_view/index.tsx +++ b/x-pack/plugins/security_solution/public/cases/components/case_view/index.tsx @@ -44,6 +44,13 @@ interface Props { userCanCrud: boolean; } +export interface OnUpdateFields { + key: keyof Case; + value: Case[keyof Case]; + onSuccess?: () => void; + onError?: () => void; +} + const MyWrapper = styled.div` padding: ${({ theme, @@ -88,12 +95,12 @@ export const CaseComponent = React.memo( // Update Fields const onUpdateField = useCallback( - (newUpdateKey: keyof Case, updateValue: Case[keyof Case]) => { + ({ key, value, onSuccess, onError }: OnUpdateFields) => { const handleUpdateNewCase = (newCase: Case) => updateCase({ ...newCase, comments: caseData.comments }); - switch (newUpdateKey) { + switch (key) { case 'title': - const titleUpdate = getTypedPayload(updateValue); + const titleUpdate = getTypedPayload(value); if (titleUpdate.length > 0) { updateCaseProperty({ fetchCaseUserActions, @@ -101,11 +108,13 @@ export const CaseComponent = React.memo( updateValue: titleUpdate, updateCase: handleUpdateNewCase, version: caseData.version, + onSuccess, + onError, }); } break; case 'connectorId': - const connectorId = getTypedPayload(updateValue); + const connectorId = getTypedPayload(value); if (connectorId.length > 0) { updateCaseProperty({ fetchCaseUserActions, @@ -113,11 +122,13 @@ export const CaseComponent = React.memo( updateValue: connectorId, updateCase: handleUpdateNewCase, version: caseData.version, + onSuccess, + onError, }); } break; case 'description': - const descriptionUpdate = getTypedPayload(updateValue); + const descriptionUpdate = getTypedPayload(value); if (descriptionUpdate.length > 0) { updateCaseProperty({ fetchCaseUserActions, @@ -125,28 +136,34 @@ export const CaseComponent = React.memo( updateValue: descriptionUpdate, updateCase: handleUpdateNewCase, version: caseData.version, + onSuccess, + onError, }); } break; case 'tags': - const tagsUpdate = getTypedPayload(updateValue); + const tagsUpdate = getTypedPayload(value); updateCaseProperty({ fetchCaseUserActions, updateKey: 'tags', updateValue: tagsUpdate, updateCase: handleUpdateNewCase, version: caseData.version, + onSuccess, + onError, }); break; case 'status': - const statusUpdate = getTypedPayload(updateValue); - if (caseData.status !== updateValue) { + const statusUpdate = getTypedPayload(value); + if (caseData.status !== value) { updateCaseProperty({ fetchCaseUserActions, updateKey: 'status', updateValue: statusUpdate, updateCase: handleUpdateNewCase, version: caseData.version, + onSuccess, + onError, }); } default: @@ -191,15 +208,28 @@ export const CaseComponent = React.memo( }); const onSubmitConnector = useCallback( - (connectorId) => onUpdateField('connectorId', connectorId), + (connectorId, onSuccess, onError) => + onUpdateField({ + key: 'connectorId', + value: connectorId, + onSuccess, + onError, + }), [onUpdateField] ); - const onSubmitTags = useCallback((newTags) => onUpdateField('tags', newTags), [onUpdateField]); - const onSubmitTitle = useCallback((newTitle) => onUpdateField('title', newTitle), [ + const onSubmitTags = useCallback((newTags) => onUpdateField({ key: 'tags', value: newTags }), [ onUpdateField, ]); + const onSubmitTitle = useCallback( + (newTitle) => onUpdateField({ key: 'title', value: newTitle }), + [onUpdateField] + ); const toggleStatusCase = useCallback( - (e) => onUpdateField('status', e.target.checked ? 'closed' : 'open'), + (e) => + onUpdateField({ + key: 'status', + value: e.target.checked ? 'closed' : 'open', + }), [onUpdateField] ); const handleRefresh = useCallback(() => { diff --git a/x-pack/plugins/security_solution/public/cases/components/edit_connector/index.test.tsx b/x-pack/plugins/security_solution/public/cases/components/edit_connector/index.test.tsx index 251d0b6e81bf8..564ce2e19df00 100644 --- a/x-pack/plugins/security_solution/public/cases/components/edit_connector/index.test.tsx +++ b/x-pack/plugins/security_solution/public/cases/components/edit_connector/index.test.tsx @@ -69,10 +69,35 @@ describe('EditConnector ', () => { await act(async () => { wrapper.find(`[data-test-subj="edit-connectors-submit"]`).last().simulate('click'); await wait(); - expect(onSubmit).toBeCalledWith(sampleConnector); + expect(onSubmit.mock.calls[0][0]).toBe(sampleConnector); }); }); + it('Revert to initial external service on error', async () => { + onSubmit.mockImplementation((connector, onSuccess, onError) => { + onError(new Error('An error has occurred')); + }); + const wrapper = mount( + + + + ); + + wrapper.find('button[data-test-subj="dropdown-connectors"]').simulate('click'); + wrapper.update(); + wrapper.find('button[data-test-subj="dropdown-connector-servicenow-2"]').simulate('click'); + wrapper.update(); + + expect(wrapper.find(`[data-test-subj="edit-connectors-submit"]`).last().exists()).toBeTruthy(); + + await act(async () => { + wrapper.find(`[data-test-subj="edit-connectors-submit"]`).last().simulate('click'); + await wait(); + wrapper.update(); + }); + expect(formHookMock.setFieldValue).toHaveBeenCalledWith('connector', 'none'); + }); + it('Resets selector on cancel', async () => { const props = { ...defaultProps, diff --git a/x-pack/plugins/security_solution/public/cases/components/edit_connector/index.tsx b/x-pack/plugins/security_solution/public/cases/components/edit_connector/index.tsx index 11938a55181d3..95ef3353a025f 100644 --- a/x-pack/plugins/security_solution/public/cases/components/edit_connector/index.tsx +++ b/x-pack/plugins/security_solution/public/cases/components/edit_connector/index.tsx @@ -15,6 +15,8 @@ import { EuiLoadingSpinner, } from '@elastic/eui'; import styled, { css } from 'styled-components'; +import { noop } from 'lodash/fp'; + import * as i18n from '../../translations'; import { Form, UseField, useForm } from '../../../shared_imports'; import { schema } from './schema'; @@ -25,7 +27,7 @@ interface EditConnectorProps { connectors: Connector[]; disabled?: boolean; isLoading: boolean; - onSubmit: (a: string[]) => void; + onSubmit: (a: string[], onSuccess: () => void, onError: () => void) => void; selectedConnector: string; } @@ -61,6 +63,11 @@ export const EditConnector = React.memo( [selectedConnector] ); + const onError = useCallback(() => { + setFieldValue('connector', selectedConnector); + setConnectorHasChanged(false); + }, [setFieldValue, selectedConnector]); + const onCancelConnector = useCallback(() => { setFieldValue('connector', selectedConnector); setConnectorHasChanged(false); @@ -69,10 +76,10 @@ export const EditConnector = React.memo( const onSubmitConnector = useCallback(async () => { const { isValid, data: newData } = await submit(); if (isValid && newData.connector) { - onSubmit(newData.connector); + onSubmit(newData.connector, noop, onError); setConnectorHasChanged(false); } - }, [submit, onSubmit]); + }, [submit, onSubmit, onError]); return ( diff --git a/x-pack/plugins/security_solution/public/cases/components/user_action_tree/index.test.tsx b/x-pack/plugins/security_solution/public/cases/components/user_action_tree/index.test.tsx index 285584cf2233c..23f1fb222a841 100644 --- a/x-pack/plugins/security_solution/public/cases/components/user_action_tree/index.test.tsx +++ b/x-pack/plugins/security_solution/public/cases/components/user_action_tree/index.test.tsx @@ -277,7 +277,7 @@ describe('UserActionTree ', () => { ) .exists() ).toEqual(false); - expect(onUpdateField).toBeCalledWith('description', sampleData.content); + expect(onUpdateField).toBeCalledWith({ key: 'description', value: sampleData.content }); }); }); diff --git a/x-pack/plugins/security_solution/public/cases/components/user_action_tree/index.tsx b/x-pack/plugins/security_solution/public/cases/components/user_action_tree/index.tsx index 52c2779a93fc0..0c1da8694bf1a 100644 --- a/x-pack/plugins/security_solution/public/cases/components/user_action_tree/index.tsx +++ b/x-pack/plugins/security_solution/public/cases/components/user_action_tree/index.tsx @@ -21,6 +21,7 @@ import { UserActionMarkdown } from './user_action_markdown'; import { Connector } from '../../../../../case/common/api/cases'; import { CaseServices } from '../../containers/use_get_case_user_actions'; import { parseString } from '../../containers/utils'; +import { OnUpdateFields } from '../case_view'; export interface UserActionTreeProps { caseServices: CaseServices; @@ -30,7 +31,7 @@ export interface UserActionTreeProps { fetchUserActions: () => void; isLoadingDescription: boolean; isLoadingUserActions: boolean; - onUpdateField: (updateKey: keyof Case, updateValue: string | string[]) => void; + onUpdateField: ({ key, value, onSuccess, onError }: OnUpdateFields) => void; updateCase: (newCase: Case) => void; userCanCrud: boolean; } @@ -138,7 +139,7 @@ export const UserActionTree = React.memo( content={caseData.description} isEditable={manageMarkdownEditIds.includes(DESCRIPTION_ID)} onSaveContent={(content: string) => { - onUpdateField(DESCRIPTION_ID, content); + onUpdateField({ key: DESCRIPTION_ID, value: content }); }} onChangeEditable={handleManageMarkdownEditId} /> diff --git a/x-pack/plugins/security_solution/public/cases/containers/use_update_case.test.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_update_case.test.tsx index 86cfc3459c595..01e64fa780d52 100644 --- a/x-pack/plugins/security_solution/public/cases/containers/use_update_case.test.tsx +++ b/x-pack/plugins/security_solution/public/cases/containers/use_update_case.test.tsx @@ -16,12 +16,17 @@ describe('useUpdateCase', () => { const fetchCaseUserActions = jest.fn(); const updateCase = jest.fn(); const updateKey: UpdateKey = 'description'; + const onSuccess = jest.fn(); + const onError = jest.fn(); + const sampleUpdate = { fetchCaseUserActions, updateKey, updateValue: 'updated description', updateCase, version: basicCase.version, + onSuccess, + onError, }; beforeEach(() => { jest.clearAllMocks(); @@ -79,6 +84,7 @@ describe('useUpdateCase', () => { }); expect(fetchCaseUserActions).toBeCalledWith(basicCase.id); expect(updateCase).toBeCalledWith(basicCase); + expect(onSuccess).toHaveBeenCalled(); }); }); @@ -114,6 +120,7 @@ describe('useUpdateCase', () => { isError: true, updateCaseProperty: result.current.updateCaseProperty, }); + expect(onError).toHaveBeenCalled(); }); }); }); diff --git a/x-pack/plugins/security_solution/public/cases/containers/use_update_case.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_update_case.tsx index 18dd9f5278503..6ede91b572dba 100644 --- a/x-pack/plugins/security_solution/public/cases/containers/use_update_case.tsx +++ b/x-pack/plugins/security_solution/public/cases/containers/use_update_case.tsx @@ -5,6 +5,7 @@ */ import { useReducer, useCallback } from 'react'; + import { displaySuccessToast, errorToToaster, @@ -33,6 +34,8 @@ export interface UpdateByKey { fetchCaseUserActions?: (caseId: string) => void; updateCase?: (newCase: Case) => void; version: string; + onSuccess?: () => void; + onError?: () => void; } type Action = @@ -81,7 +84,15 @@ export const useUpdateCase = ({ caseId }: { caseId: string }): UseUpdateCase => const [, dispatchToaster] = useStateToaster(); const dispatchUpdateCaseProperty = useCallback( - async ({ fetchCaseUserActions, updateKey, updateValue, updateCase, version }: UpdateByKey) => { + async ({ + fetchCaseUserActions, + updateKey, + updateValue, + updateCase, + version, + onSuccess, + onError, + }: UpdateByKey) => { let cancel = false; const abortCtrl = new AbortController(); @@ -102,6 +113,9 @@ export const useUpdateCase = ({ caseId }: { caseId: string }): UseUpdateCase => } dispatch({ type: 'FETCH_SUCCESS' }); displaySuccessToast(i18n.UPDATED_CASE(response[0].title), dispatchToaster); + if (onSuccess) { + onSuccess(); + } } } catch (error) { if (!cancel) { @@ -111,6 +125,9 @@ export const useUpdateCase = ({ caseId }: { caseId: string }): UseUpdateCase => dispatchToaster, }); dispatch({ type: 'FETCH_FAILURE' }); + if (onError) { + onError(); + } } } return () => { diff --git a/x-pack/plugins/security_solution/public/common/components/events_viewer/events_viewer.test.tsx b/x-pack/plugins/security_solution/public/common/components/events_viewer/events_viewer.test.tsx index 8c1f69279d31c..2a7cbff5ee149 100644 --- a/x-pack/plugins/security_solution/public/common/components/events_viewer/events_viewer.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/events_viewer/events_viewer.test.tsx @@ -32,18 +32,18 @@ mockUseResizeObserver.mockImplementation(() => ({})); const from = '2019-08-26T22:10:56.791Z'; const to = '2019-08-27T22:10:56.794Z'; +const defaultMocks = { + browserFields: mockBrowserFields, + indexPatterns: mockIndexPattern, + docValueFields: mockDocValueFields, + isLoading: false, +}; + describe('EventsViewer', () => { const mount = useMountAppended(); beforeEach(() => { - mockUseFetchIndexPatterns.mockImplementation(() => [ - { - browserFields: mockBrowserFields, - indexPatterns: mockIndexPattern, - docValueFields: mockDocValueFields, - isLoading: false, - }, - ]); + mockUseFetchIndexPatterns.mockImplementation(() => [{ ...defaultMocks }]); }); test('it renders the "Showing..." subtitle with the expected event count', async () => { @@ -69,14 +69,7 @@ describe('EventsViewer', () => { }); test('it does NOT render fetch index pattern is loading', async () => { - mockUseFetchIndexPatterns.mockImplementation(() => [ - { - browserFields: mockBrowserFields, - indexPatterns: mockIndexPattern, - docValueFields: mockDocValueFields, - isLoading: true, - }, - ]); + mockUseFetchIndexPatterns.mockImplementation(() => [{ ...defaultMocks, isLoading: true }]); const wrapper = mount( @@ -98,14 +91,7 @@ describe('EventsViewer', () => { }); test('it does NOT render when start is empty', async () => { - mockUseFetchIndexPatterns.mockImplementation(() => [ - { - browserFields: mockBrowserFields, - indexPatterns: mockIndexPattern, - docValueFields: mockDocValueFields, - isLoading: true, - }, - ]); + mockUseFetchIndexPatterns.mockImplementation(() => [{ ...defaultMocks, isLoading: true }]); const wrapper = mount( @@ -127,14 +113,7 @@ describe('EventsViewer', () => { }); test('it does NOT render when end is empty', async () => { - mockUseFetchIndexPatterns.mockImplementation(() => [ - { - browserFields: mockBrowserFields, - indexPatterns: mockIndexPattern, - docValueFields: mockDocValueFields, - isLoading: true, - }, - ]); + mockUseFetchIndexPatterns.mockImplementation(() => [{ ...defaultMocks, isLoading: true }]); const wrapper = mount( diff --git a/x-pack/plugins/security_solution/public/common/components/ml/anomaly/use_anomalies_table_data.ts b/x-pack/plugins/security_solution/public/common/components/ml/anomaly/use_anomalies_table_data.ts index a6bbdee79cf04..6fbb308672e5d 100644 --- a/x-pack/plugins/security_solution/public/common/components/ml/anomaly/use_anomalies_table_data.ts +++ b/x-pack/plugins/security_solution/public/common/components/ml/anomaly/use_anomalies_table_data.ts @@ -129,8 +129,8 @@ export const useAnomaliesTableData = ({ influencersOrCriteriaToString(influencers), // eslint-disable-next-line react-hooks/exhaustive-deps influencersOrCriteriaToString(criteriaFields), - startDate, - endDate, + startDateMs, + endDateMs, skip, userPermissions, // eslint-disable-next-line react-hooks/exhaustive-deps diff --git a/x-pack/plugins/security_solution/public/common/containers/source/index.tsx b/x-pack/plugins/security_solution/public/common/containers/source/index.tsx index 8c03ab7b9f508..cc43dd6f42772 100644 --- a/x-pack/plugins/security_solution/public/common/containers/source/index.tsx +++ b/x-pack/plugins/security_solution/public/common/containers/source/index.tsx @@ -81,7 +81,7 @@ export const getBrowserFields = memoizeOne( (newArgs, lastArgs) => newArgs[0] === lastArgs[0] ); -export const getdocValueFields = memoizeOne( +export const getDocValueFields = memoizeOne( (_title: string, fields: IndexField[]): DocValueFields[] => fields && fields.length > 0 ? fields.reduce((accumulator: DocValueFields[], field: IndexField) => { @@ -177,7 +177,7 @@ export const useWithSource = ( defaultIndex.join(), get('data.source.status.indexFields', result) ), - docValueFields: getdocValueFields( + docValueFields: getDocValueFields( defaultIndex.join(), get('data.source.status.indexFields', result) ), diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/fetch_index_patterns.tsx b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/fetch_index_patterns.tsx index ab12f045cddbc..9a2f43bb475b1 100644 --- a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/fetch_index_patterns.tsx +++ b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/fetch_index_patterns.tsx @@ -12,7 +12,7 @@ import { IIndexPattern } from '../../../../../../../../src/plugins/data/public'; import { BrowserFields, getBrowserFields, - getdocValueFields, + getDocValueFields, getIndexFields, sourceQuery, DocValueFields, @@ -89,7 +89,7 @@ export const useFetchIndexPatterns = (defaultIndices: string[] = []): Return => indices.join(), get('data.source.status.indexFields', result) ), - docValueFields: getdocValueFields( + docValueFields: getDocValueFields( indices.join(), get('data.source.status.indexFields', result) ), diff --git a/x-pack/plugins/security_solution/public/timelines/store/timeline/helpers.ts b/x-pack/plugins/security_solution/public/timelines/store/timeline/helpers.ts index 2d16892329e19..a6b78269cff2f 100644 --- a/x-pack/plugins/security_solution/public/timelines/store/timeline/helpers.ts +++ b/x-pack/plugins/security_solution/public/timelines/store/timeline/helpers.ts @@ -154,7 +154,7 @@ interface AddNewTimelineParams { export const addNewTimeline = ({ columns, dataProviders = [], - dateRange: mayDateRange, + dateRange: maybeDateRange, excludedRowRendererIds = [], filters = timelineDefaults.filters, id, @@ -167,7 +167,7 @@ export const addNewTimeline = ({ timelineType, }: AddNewTimelineParams): TimelineById => { const { from: startDateRange, to: endDateRange } = normalizeTimeRange({ from: '', to: '' }); - const dateRange = mayDateRange ?? { start: startDateRange, end: endDateRange }; + const dateRange = maybeDateRange ?? { start: startDateRange, end: endDateRange }; const templateTimelineInfo = timelineType === TimelineType.template ? { From f31d592e611d3c13f6846a904d3953693806979c Mon Sep 17 00:00:00 2001 From: MadameSheema Date: Fri, 17 Jul 2020 14:35:26 +0200 Subject: [PATCH 15/59] updates 'External alerts' tab text (#72237) --- .../public/detections/pages/detection_engine/translations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/translations.ts b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/translations.ts index bfe5dfc012530..92dc02ac8478c 100644 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/translations.ts +++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/translations.ts @@ -29,7 +29,7 @@ export const SIGNAL = i18n.translate('xpack.securitySolution.detectionEngine.sig }); export const ALERT = i18n.translate('xpack.securitySolution.detectionEngine.alertTitle', { - defaultMessage: 'External alerts', + defaultMessage: 'Detection alerts', }); export const BUTTON_MANAGE_RULES = i18n.translate( From 45a4393459e0400171564f1d096784ebc97cc8ed Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Fri, 17 Jul 2020 13:55:51 +0100 Subject: [PATCH 16/59] skip flaky suite (#72146) --- test/functional/apps/dashboard/dashboard_error_handling.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/functional/apps/dashboard/dashboard_error_handling.ts b/test/functional/apps/dashboard/dashboard_error_handling.ts index 6bd8327a110b9..38803739ff129 100644 --- a/test/functional/apps/dashboard/dashboard_error_handling.ts +++ b/test/functional/apps/dashboard/dashboard_error_handling.ts @@ -28,7 +28,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { /** * Common test suite for testing exception scenarious within dashboard */ - describe('dashboard error handling', () => { + // Flaky: https://github.com/elastic/kibana/issues/72146 + describe.skip('dashboard error handling', () => { before(async () => { await esArchiver.loadIfNeeded('dashboard/current/kibana'); await PageObjects.common.navigateToApp('dashboard'); From 93be1cff8d509658ed270bf5843df6311bb2e711 Mon Sep 17 00:00:00 2001 From: Xavier Mouligneau <189600+XavierM@users.noreply.github.com> Date: Fri, 17 Jul 2020 08:58:10 -0400 Subject: [PATCH 17/59] [SECURITY] Bug truncation on timeline (#72221) * bring back truncated ceil + only show menu context hover text * update unit test --- .../index.test.tsx | 4 +++- .../drag_and_drop/draggable_wrapper.test.tsx | 4 ++-- .../components/with_hover_actions/index.tsx | 17 ++++++++++------- .../fields_browser/field_name.test.tsx | 2 +- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/x-pack/plugins/security_solution/public/common/components/add_filter_to_global_search_bar/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/add_filter_to_global_search_bar/index.test.tsx index 9c08e05ddfa39..2af6569394e8f 100644 --- a/x-pack/plugins/security_solution/public/common/components/add_filter_to_global_search_bar/index.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/add_filter_to_global_search_bar/index.test.tsx @@ -157,8 +157,10 @@ describe('AddFilterToGlobalSearchBar Component', () => { ); + wrapper.find('[data-test-subj="withHoverActionsButton"]').simulate('mouseenter'); + wrapper.update(); + wrapper - .simulate('mouseenter') .find('[data-test-subj="hover-actions-container"] [data-euiicon-type]') .first() .simulate('click'); diff --git a/x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper.test.tsx b/x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper.test.tsx index da68280ed760c..e17fc7b9ef9bd 100644 --- a/x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper.test.tsx @@ -65,7 +65,7 @@ describe('DraggableWrapper', () => { expect(wrapper.find('[data-test-subj="copy-to-clipboard"]').exists()).toBe(false); }); - test('it renders hover actions when the mouse is over the draggable wrapper', () => { + test('it renders hover actions when the mouse is over the text of draggable wrapper', () => { const wrapper = mount( @@ -76,7 +76,7 @@ describe('DraggableWrapper', () => { ); - wrapper.simulate('mouseenter'); + wrapper.find('[data-test-subj="withHoverActionsButton"]').simulate('mouseenter'); wrapper.update(); expect(wrapper.find('[data-test-subj="copy-to-clipboard"]').exists()).toBe(true); }); diff --git a/x-pack/plugins/security_solution/public/common/components/with_hover_actions/index.tsx b/x-pack/plugins/security_solution/public/common/components/with_hover_actions/index.tsx index 97705533689e9..e6577bd040e25 100644 --- a/x-pack/plugins/security_solution/public/common/components/with_hover_actions/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/with_hover_actions/index.tsx @@ -17,10 +17,6 @@ const WithHoverActionsPopover = (styled(EuiPopover as any)` } ` as unknown) as typeof EuiPopover; -const Container = styled.div` - width: fit-content; -`; - interface Props { /** * Always show the hover menu contents (default: false) @@ -68,7 +64,14 @@ export const WithHoverActions = React.memo( setShowHoverContent(false); }, []); - const content = useMemo(() => <>{render(showHoverContent)}, [render, showHoverContent]); + const content = useMemo( + () => ( +
+ {render(showHoverContent)} +
+ ), + [onMouseEnter, render, showHoverContent] + ); useEffect(() => { setIsOpen(hoverContent != null && (showHoverContent || alwaysShow)); @@ -79,7 +82,7 @@ export const WithHoverActions = React.memo( }, [closePopOverTrigger]); return ( - +
( > {isOpen ? <>{hoverContent} : null} - +
); } ); diff --git a/x-pack/plugins/security_solution/public/timelines/components/fields_browser/field_name.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/fields_browser/field_name.test.tsx index 44e4818830acd..ddd5c6f07e8b5 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/fields_browser/field_name.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/fields_browser/field_name.test.tsx @@ -46,7 +46,7 @@ describe('FieldName', () => {
); - wrapper.find('div').at(1).simulate('mouseenter'); + wrapper.find('[data-test-subj="withHoverActionsButton"]').at(0).simulate('mouseenter'); wrapper.update(); expect(wrapper.find('[data-test-subj="copy-to-clipboard"]').exists()).toBe(true); }); From 44888d3536ae365c7395f07e2757004e8f9cba7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Fri, 17 Jul 2020 15:08:38 +0200 Subject: [PATCH 18/59] [Logs UI] Fix display of dataset values in anomaly and category example rows (#71693) This removes an unnecessary JSON encoding step of values before they are passed to the field column component used in the log entry example rows in both the Anomalies and Categories tabs. --- .../top_categories/category_example_message.tsx | 12 ++++-------- .../sections/anomalies/log_entry_example.tsx | 10 +++------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/x-pack/plugins/infra/public/pages/logs/log_entry_categories/sections/top_categories/category_example_message.tsx b/x-pack/plugins/infra/public/pages/logs/log_entry_categories/sections/top_categories/category_example_message.tsx index 21c7f48eb80f8..908e52f01cbcc 100644 --- a/x-pack/plugins/infra/public/pages/logs/log_entry_categories/sections/top_categories/category_example_message.tsx +++ b/x-pack/plugins/infra/public/pages/logs/log_entry_categories/sections/top_categories/category_example_message.tsx @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { useMemo, useState, useCallback, useContext } from 'react'; +import React, { useState, useCallback, useContext } from 'react'; import { i18n } from '@kbn/i18n'; import { encode } from 'rison-node'; import moment from 'moment'; @@ -40,12 +40,8 @@ export const CategoryExampleMessage: React.FunctionComponent<{ context: LogEntryContext; }> = ({ id, dataset, message, timestamp, timeRange, tiebreaker, context }) => { const [, { setContextEntry }] = useContext(ViewLogInContext.Context); - // the dataset must be encoded for the field column and the empty value must - // be turned into a user-friendly value - const encodedDatasetFieldValue = useMemo( - () => JSON.stringify(getFriendlyNameForPartitionId(dataset)), - [dataset] - ); + // handle special cases for the dataset value + const humanFriendlyDataset = getFriendlyNameForPartitionId(dataset); const [isHovered, setIsHovered] = useState(false); const setHovered = useCallback(() => setIsHovered(true), []); @@ -100,7 +96,7 @@ export const CategoryExampleMessage: React.FunctionComponent<{ columnValue={{ columnId: datasetColumnId, field: 'event.dataset', - value: encodedDatasetFieldValue, + value: humanFriendlyDataset, highlights: [], }} highlights={noHighlights} diff --git a/x-pack/plugins/infra/public/pages/logs/log_entry_rate/sections/anomalies/log_entry_example.tsx b/x-pack/plugins/infra/public/pages/logs/log_entry_rate/sections/anomalies/log_entry_example.tsx index 2965e1fede822..fece2522de574 100644 --- a/x-pack/plugins/infra/public/pages/logs/log_entry_rate/sections/anomalies/log_entry_example.tsx +++ b/x-pack/plugins/infra/public/pages/logs/log_entry_rate/sections/anomalies/log_entry_example.tsx @@ -80,12 +80,8 @@ export const LogEntryExampleMessage: React.FunctionComponent = ({ const setItemIsHovered = useCallback(() => setIsHovered(true), []); const setItemIsNotHovered = useCallback(() => setIsHovered(false), []); - // the dataset must be encoded for the field column and the empty value must - // be turned into a user-friendly value - const encodedDatasetFieldValue = useMemo( - () => JSON.stringify(getFriendlyNameForPartitionId(dataset)), - [dataset] - ); + // handle special cases for the dataset value + const humanFriendlyDataset = getFriendlyNameForPartitionId(dataset); const viewInStreamLinkProps = useLinkProps({ app: 'logs', @@ -158,7 +154,7 @@ export const LogEntryExampleMessage: React.FunctionComponent = ({ columnValue={{ columnId: datasetColumnId, field: 'event.dataset', - value: encodedDatasetFieldValue, + value: humanFriendlyDataset, highlights: [], }} highlights={noHighlights} From 86629d76b05eb87ded25de66019f0f2d4fe253cb Mon Sep 17 00:00:00 2001 From: Sandra Gonzales Date: Fri, 17 Jul 2020 09:24:32 -0400 Subject: [PATCH 19/59] [Ingest Manager] Fix failing test conflict error (#72149) * save kibana installation references after other updates have completed to avoid conflict error * unskip tests * uncomment out line * add back await to not change things * unskip fleet_unenroll_agent Co-authored-by: Elastic Machine --- .../services/epm/kibana/assets/install.ts | 22 ++++++++++--------- .../server/services/epm/packages/install.ts | 9 +++++--- .../test/api_integration/apis/fleet/setup.ts | 3 +-- .../apis/fleet/unenroll_agent.ts | 3 +-- .../apis/epm/install.ts | 3 +-- .../apps/endpoint/policy_details.ts | 3 +-- .../apps/endpoint/policy_list.ts | 3 +-- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/x-pack/plugins/ingest_manager/server/services/epm/kibana/assets/install.ts b/x-pack/plugins/ingest_manager/server/services/epm/kibana/assets/install.ts index 2a743f244e64d..a3fe444b19b1a 100644 --- a/x-pack/plugins/ingest_manager/server/services/epm/kibana/assets/install.ts +++ b/x-pack/plugins/ingest_manager/server/services/epm/kibana/assets/install.ts @@ -11,10 +11,14 @@ import { } from 'src/core/server'; import { PACKAGES_SAVED_OBJECT_TYPE } from '../../../../../common'; import * as Registry from '../../registry'; -import { AssetType, KibanaAssetType, AssetReference } from '../../../../types'; +import { + AssetType, + KibanaAssetType, + AssetReference, + KibanaAssetReference, +} from '../../../../types'; import { deleteKibanaSavedObjectsAssets } from '../../packages/remove'; import { getInstallationObject, savedObjectTypes } from '../../packages'; -import { saveInstalledKibanaRefs } from '../../packages/install'; type SavedObjectToBe = Required & { type: AssetType }; export type ArchiveAsset = Pick< @@ -49,7 +53,7 @@ export async function installKibanaAssets(options: { pkgName: string; paths: string[]; isUpdate: boolean; -}): Promise { +}): Promise { const { savedObjectsClient, paths, pkgName, isUpdate } = options; if (isUpdate) { @@ -65,16 +69,14 @@ export async function installKibanaAssets(options: { // install the new assets and save installation references const kibanaAssetTypes = Object.values(KibanaAssetType); - const installationPromises = kibanaAssetTypes.map((assetType) => - installKibanaSavedObjects({ savedObjectsClient, assetType, paths }) + const installedAssets = await Promise.all( + kibanaAssetTypes.map((assetType) => + installKibanaSavedObjects({ savedObjectsClient, assetType, paths }) + ) ); // installKibanaSavedObjects returns AssetReference[], so .map creates AssetReference[][] // call .flat to flatten into one dimensional array - const newInstalledKibanaAssets = await Promise.all(installationPromises).then((results) => - results.flat() - ); - await saveInstalledKibanaRefs(savedObjectsClient, pkgName, newInstalledKibanaAssets); - return newInstalledKibanaAssets; + return installedAssets.flat(); } export const deleteKibanaInstalledRefs = async ( savedObjectsClient: SavedObjectsClientContract, diff --git a/x-pack/plugins/ingest_manager/server/services/epm/packages/install.ts b/x-pack/plugins/ingest_manager/server/services/epm/packages/install.ts index cd4259a0c30d7..a69daae6e0410 100644 --- a/x-pack/plugins/ingest_manager/server/services/epm/packages/install.ts +++ b/x-pack/plugins/ingest_manager/server/services/epm/packages/install.ts @@ -169,17 +169,20 @@ export async function installPackage(options: { ); } - // update to newly installed version when all assets are successfully installed - if (isUpdate) await updateVersion(savedObjectsClient, pkgName, pkgVersion); // get template refs to save const installedTemplateRefs = installedTemplates.map((template) => ({ id: template.templateName, type: ElasticsearchAssetType.indexTemplate, })); + const [installedKibanaAssets] = await Promise.all([ installKibanaAssetsPromise, installIndexPatternPromise, ]); + + await saveInstalledKibanaRefs(savedObjectsClient, pkgName, installedKibanaAssets); + // update to newly installed version when all assets are successfully installed + if (isUpdate) await updateVersion(savedObjectsClient, pkgName, pkgVersion); return [...installedKibanaAssets, ...installedPipelines, ...installedTemplateRefs]; } const updateVersion = async ( @@ -230,7 +233,7 @@ export async function createInstallation(options: { export const saveInstalledKibanaRefs = async ( savedObjectsClient: SavedObjectsClientContract, pkgName: string, - installedAssets: AssetReference[] + installedAssets: KibanaAssetReference[] ) => { await savedObjectsClient.update(PACKAGES_SAVED_OBJECT_TYPE, pkgName, { installed_kibana: installedAssets, diff --git a/x-pack/test/api_integration/apis/fleet/setup.ts b/x-pack/test/api_integration/apis/fleet/setup.ts index 82e494b0ab28c..4fcf39886e202 100644 --- a/x-pack/test/api_integration/apis/fleet/setup.ts +++ b/x-pack/test/api_integration/apis/fleet/setup.ts @@ -11,8 +11,7 @@ export default function ({ getService }: FtrProviderContext) { const supertest = getService('supertest'); const es = getService('es'); - // FLAKY: https://github.com/elastic/kibana/issues/72053 - describe.skip('fleet_setup', () => { + describe('fleet_setup', () => { beforeEach(async () => { try { await es.security.deleteUser({ diff --git a/x-pack/test/api_integration/apis/fleet/unenroll_agent.ts b/x-pack/test/api_integration/apis/fleet/unenroll_agent.ts index 4e1443ad1fc68..bc6c44e590cc4 100644 --- a/x-pack/test/api_integration/apis/fleet/unenroll_agent.ts +++ b/x-pack/test/api_integration/apis/fleet/unenroll_agent.ts @@ -16,8 +16,7 @@ export default function (providerContext: FtrProviderContext) { const supertest = getService('supertest'); const esClient = getService('es'); - // FLAKY: https://github.com/elastic/kibana/issues/64696 - describe.skip('fleet_unenroll_agent', () => { + describe('fleet_unenroll_agent', () => { let accessAPIKeyId: string; let outputAPIKeyId: string; before(async () => { diff --git a/x-pack/test/ingest_manager_api_integration/apis/epm/install.ts b/x-pack/test/ingest_manager_api_integration/apis/epm/install.ts index b6807b2fd3414..f73ba56c172c4 100644 --- a/x-pack/test/ingest_manager_api_integration/apis/epm/install.ts +++ b/x-pack/test/ingest_manager_api_integration/apis/epm/install.ts @@ -21,8 +21,7 @@ export default function ({ getService }: FtrProviderContext) { const mappingsPackage = 'overrides-0.1.0'; const server = dockerServers.get('registry'); - // FLAKY: https://github.com/elastic/kibana/issues/71939 - describe.skip('installs packages that include settings and mappings overrides', async () => { + describe('installs packages that include settings and mappings overrides', async () => { after(async () => { if (server.enabled) { // remove the package just in case it being installed will affect other tests diff --git a/x-pack/test/security_solution_endpoint/apps/endpoint/policy_details.ts b/x-pack/test/security_solution_endpoint/apps/endpoint/policy_details.ts index d57bd32441454..cf76f297d83be 100644 --- a/x-pack/test/security_solution_endpoint/apps/endpoint/policy_details.ts +++ b/x-pack/test/security_solution_endpoint/apps/endpoint/policy_details.ts @@ -19,8 +19,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const testSubjects = getService('testSubjects'); const policyTestResources = getService('policyTestResources'); - // FLAKY: https://github.com/elastic/kibana/issues/72102 - describe.skip('When on the Endpoint Policy Details Page', function () { + describe('When on the Endpoint Policy Details Page', function () { this.tags(['ciGroup7']); describe('with an invalid policy id', () => { diff --git a/x-pack/test/security_solution_endpoint/apps/endpoint/policy_list.ts b/x-pack/test/security_solution_endpoint/apps/endpoint/policy_list.ts index b91f0647487ff..57321ab4cd911 100644 --- a/x-pack/test/security_solution_endpoint/apps/endpoint/policy_list.ts +++ b/x-pack/test/security_solution_endpoint/apps/endpoint/policy_list.ts @@ -19,8 +19,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const policyTestResources = getService('policyTestResources'); const RELATIVE_DATE_FORMAT = /\d (?:seconds|minutes) ago/i; - // FLAKY: https://github.com/elastic/kibana/issues/71951 - describe.skip('When on the Endpoint Policy List', function () { + describe('When on the Endpoint Policy List', function () { this.tags(['ciGroup7']); before(async () => { await pageObjects.policy.navigateToPolicyList(); From 5160c7ee459b564b6b116790f3728778d53dfab7 Mon Sep 17 00:00:00 2001 From: Tre Date: Fri, 17 Jul 2020 07:56:59 -0600 Subject: [PATCH 20/59] [QA][Code Coverage] Drop flaky integration tests (#72089) --- .../integration_tests/ingest_coverage.test.js | 92 ------------------- 1 file changed, 92 deletions(-) diff --git a/src/dev/code_coverage/ingest_coverage/integration_tests/ingest_coverage.test.js b/src/dev/code_coverage/ingest_coverage/integration_tests/ingest_coverage.test.js index 95056d9f0d8d7..ba73922ec508a 100644 --- a/src/dev/code_coverage/ingest_coverage/integration_tests/ingest_coverage.test.js +++ b/src/dev/code_coverage/ingest_coverage/integration_tests/ingest_coverage.test.js @@ -69,96 +69,4 @@ describe('Ingesting coverage', () => { expect(folderStructure.test(actualUrl)).ok(); }); }); - describe(`vcsInfo`, () => { - let stdOutWithVcsInfo = ''; - describe(`without a commit msg in the vcs info file`, () => { - beforeAll(async () => { - const args = [ - 'scripts/ingest_coverage.js', - '--verbose', - '--vcsInfoPath', - 'src/dev/code_coverage/ingest_coverage/integration_tests/mocks/VCS_INFO_missing_commit_msg.txt', - '--path', - ]; - const opts = [...args, resolved]; - const { stdout } = await execa(process.execPath, opts, { cwd: ROOT_DIR, env }); - stdOutWithVcsInfo = stdout; - }); - - it(`should be an obj w/o a commit msg`, () => { - const commitMsgRE = /"commitMsg"/; - expect(commitMsgRE.test(stdOutWithVcsInfo)).to.not.be.ok(); - }); - }); - describe(`including previous sha`, () => { - let stdOutWithPrevious = ''; - beforeAll(async () => { - const opts = [...verboseArgs, resolved]; - const { stdout } = await execa(process.execPath, opts, { cwd: ROOT_DIR, env }); - stdOutWithPrevious = stdout; - }); - - it(`should have a vcsCompareUrl`, () => { - const previousCompareUrlRe = /vcsCompareUrl.+\s*.*https.+compare\/FAKE_PREVIOUS_SHA\.\.\.f07b34f6206/; - expect(previousCompareUrlRe.test(stdOutWithPrevious)).to.be.ok(); - }); - }); - describe(`with a commit msg in the vcs info file`, () => { - beforeAll(async () => { - const args = [ - 'scripts/ingest_coverage.js', - '--verbose', - '--vcsInfoPath', - 'src/dev/code_coverage/ingest_coverage/integration_tests/mocks/VCS_INFO.txt', - '--path', - ]; - const opts = [...args, resolved]; - const { stdout } = await execa(process.execPath, opts, { cwd: ROOT_DIR, env }); - stdOutWithVcsInfo = stdout; - }); - - it(`should be an obj w/ a commit msg`, () => { - const commitMsgRE = /commitMsg/; - expect(commitMsgRE.test(stdOutWithVcsInfo)).to.be.ok(); - }); - }); - }); - describe(`team assignment`, () => { - let shouldNotHavePipelineOut = ''; - let shouldIndeedHavePipelineOut = ''; - - const args = [ - 'scripts/ingest_coverage.js', - '--verbose', - '--vcsInfoPath', - 'src/dev/code_coverage/ingest_coverage/integration_tests/mocks/VCS_INFO.txt', - '--path', - ]; - - const teamAssignRE = /pipeline:/; - - beforeAll(async () => { - const summaryPath = 'jest-combined/coverage-summary-just-total.json'; - const resolved = resolve(MOCKS_DIR, summaryPath); - const opts = [...args, resolved]; - const { stdout } = await execa(process.execPath, opts, { cwd: ROOT_DIR, env }); - shouldNotHavePipelineOut = stdout; - }); - beforeAll(async () => { - const summaryPath = 'jest-combined/coverage-summary-manual-mix.json'; - const resolved = resolve(MOCKS_DIR, summaryPath); - const opts = [...args, resolved]; - const { stdout } = await execa(process.execPath, opts, { cwd: ROOT_DIR, env }); - shouldIndeedHavePipelineOut = stdout; - }); - - it(`should not occur when going to the totals index`, () => { - const actual = teamAssignRE.test(shouldNotHavePipelineOut); - expect(actual).to.not.be.ok(); - }); - it(`should indeed occur when going to the coverage index`, () => { - const actual = /ingest-pipe=>team_assignment/.test(shouldIndeedHavePipelineOut); - expect(actual).to.be.ok(); - }); - }); }); From f9baaa267d75558decd7ada45258d4ecced182e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=AA=20Marcondes?= <55978943+cauemarcondes@users.noreply.github.com> Date: Fri, 17 Jul 2020 15:11:41 +0100 Subject: [PATCH 21/59] Observability landing page title (#72088) * updating window title based on breadcrumbs * updating window title based on breadcrumbs * updating window title based on breadcrumbs --- .../public/application/index.tsx | 35 ++++++++++++------- .../observability/public/routes/index.tsx | 2 ++ 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/x-pack/plugins/observability/public/application/index.tsx b/x-pack/plugins/observability/public/application/index.tsx index 8cfbca37e8d05..d76c033a41756 100644 --- a/x-pack/plugins/observability/public/application/index.tsx +++ b/x-pack/plugins/observability/public/application/index.tsx @@ -3,18 +3,31 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ +import { i18n } from '@kbn/i18n'; import { createHashHistory } from 'history'; import React, { useEffect } from 'react'; import ReactDOM from 'react-dom'; import { Route, Router, Switch } from 'react-router-dom'; -import { i18n } from '@kbn/i18n'; -import { RedirectAppLinks } from '../../../../../src/plugins/kibana_react/public'; import { AppMountParameters, CoreStart } from '../../../../../src/core/public'; +import { RedirectAppLinks } from '../../../../../src/plugins/kibana_react/public'; import { EuiThemeProvider } from '../../../../legacy/common/eui_styled_components'; import { PluginContext } from '../context/plugin_context'; -import { useRouteParams } from '../hooks/use_route_params'; -import { routes } from '../routes'; import { usePluginContext } from '../hooks/use_plugin_context'; +import { useRouteParams } from '../hooks/use_route_params'; +import { Breadcrumbs, routes } from '../routes'; + +const observabilityLabelBreadcrumb = { + text: i18n.translate('xpack.observability.observability.breadcrumb.', { + defaultMessage: 'Observability', + }), +}; + +function getTitleFromBreadCrumbs(breadcrumbs: Breadcrumbs) { + return breadcrumbs + .map(({ text }) => text) + .reverse() + .join(' | '); +} const App = () => { return ( @@ -25,16 +38,12 @@ const App = () => { const route = routes[path]; const Wrapper = () => { const { core } = usePluginContext(); + + const breadcrumb = [observabilityLabelBreadcrumb, ...route.breadcrumb]; useEffect(() => { - core.chrome.setBreadcrumbs([ - { - text: i18n.translate('xpack.observability.observability.breadcrumb.', { - defaultMessage: 'Observability', - }), - }, - ...route.breadcrumb, - ]); - }, [core]); + core.chrome.setBreadcrumbs(breadcrumb); + document.title = getTitleFromBreadCrumbs(breadcrumb); + }, [core, breadcrumb]); const { query, path: pathParams } = useRouteParams(route.params); return route.handler({ query, path: pathParams }); diff --git a/x-pack/plugins/observability/public/routes/index.tsx b/x-pack/plugins/observability/public/routes/index.tsx index 10f9b4dc42723..bee6a4dd7133a 100644 --- a/x-pack/plugins/observability/public/routes/index.tsx +++ b/x-pack/plugins/observability/public/routes/index.tsx @@ -17,6 +17,8 @@ type DecodeParams = { [key in keyof TParams]: TParams[key] extends t.Any ? t.TypeOf : never; }; +export type Breadcrumbs = Array<{ text: string }>; + export interface Params { query?: t.HasProps; path?: t.HasProps; From 937314ad1111d904e9538015d2676368acb0ac54 Mon Sep 17 00:00:00 2001 From: Mikhail Shustov Date: Fri, 17 Jul 2020 17:14:55 +0300 Subject: [PATCH 22/59] Bump @elastic/elasticsearch to v7.9.0-rc1 (#72231) * bump @elastic/elasticsearch to 7.9.0-rc1 * bump other packages using @elastic/elasticsearch --- package.json | 2 +- packages/kbn-es/package.json | 2 +- x-pack/plugins/apm/scripts/package.json | 2 +- yarn.lock | 35 ++++--------------------- 4 files changed, 8 insertions(+), 33 deletions(-) diff --git a/package.json b/package.json index 593e8f82f0541..a22871e314bae 100644 --- a/package.json +++ b/package.json @@ -125,7 +125,7 @@ "@elastic/apm-rum": "^5.2.0", "@elastic/charts": "19.8.1", "@elastic/datemath": "5.0.3", - "@elastic/elasticsearch": "7.8.0", + "@elastic/elasticsearch": "7.9.0-rc.1", "@elastic/ems-client": "7.9.3", "@elastic/eui": "26.3.1", "@elastic/filesaver": "1.1.2", diff --git a/packages/kbn-es/package.json b/packages/kbn-es/package.json index 271b4a3dc661b..f53eb694ec712 100644 --- a/packages/kbn-es/package.json +++ b/packages/kbn-es/package.json @@ -5,7 +5,7 @@ "license": "Apache-2.0", "private": true, "dependencies": { - "@elastic/elasticsearch": "^7.4.0", + "@elastic/elasticsearch": "7.9.0-rc.1", "@kbn/dev-utils": "1.0.0", "abort-controller": "^2.0.3", "chalk": "^2.4.2", diff --git a/x-pack/plugins/apm/scripts/package.json b/x-pack/plugins/apm/scripts/package.json index c5a9df792f856..4d0906514b5e1 100644 --- a/x-pack/plugins/apm/scripts/package.json +++ b/x-pack/plugins/apm/scripts/package.json @@ -4,7 +4,7 @@ "main": "index.js", "license": "MIT", "dependencies": { - "@elastic/elasticsearch": "^7.6.1", + "@elastic/elasticsearch": "7.9.0-rc.1", "@octokit/rest": "^16.35.0", "@types/console-stamp": "^0.2.32", "console-stamp": "^0.2.9", diff --git a/yarn.lock b/yarn.lock index a5066b51f3198..580e436a60282 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2172,10 +2172,10 @@ redux-immutable-state-invariant "^2.1.0" redux-logger "^3.0.6" -"@elastic/elasticsearch@7.8.0": - version "7.8.0" - resolved "https://registry.yarnpkg.com/@elastic/elasticsearch/-/elasticsearch-7.8.0.tgz#3f9ee54fe8ef79874ebd231db03825fa500a7111" - integrity sha512-rUOTNN1At0KoN0Fcjd6+J7efghuURnoMTB/od9EMK6Mcdebi6N3z5ulShTsKRn6OanS9Eq3l/OmheQY1Y+WLcg== +"@elastic/elasticsearch@7.9.0-rc.1": + version "7.9.0-rc.1" + resolved "https://registry.yarnpkg.com/@elastic/elasticsearch/-/elasticsearch-7.9.0-rc.1.tgz#50205507ec84ccb95cb7a6d36e5570808749fee9" + integrity sha512-rVjiVj7VPLCusJPfywpb3gvcaA99uylYSum1Frcq4vi2Iqg118KXgYW6GOis2Y70oDZ6w6XRlT0ze5NA6SBa+g== dependencies: debug "^4.1.1" decompress-response "^4.2.0" @@ -2183,18 +2183,6 @@ pump "^3.0.0" secure-json-parse "^2.1.0" -"@elastic/elasticsearch@^7.4.0": - version "7.4.0" - resolved "https://registry.yarnpkg.com/@elastic/elasticsearch/-/elasticsearch-7.4.0.tgz#57f4066acf25e9d4e9b4f6376088433aae6f25d4" - integrity sha512-HpEKHH6mHQRvea3lw4NNJw9ZUS1KmkpwWKHucaHi1svDn+/fEAwY0wD8egL1vZJo4ZmWfCQMjVqGL+Hoy1HYRw== - dependencies: - debug "^4.1.1" - decompress-response "^4.2.0" - into-stream "^5.1.0" - ms "^2.1.1" - once "^1.4.0" - pump "^3.0.0" - "@elastic/ems-client@7.9.3": version "7.9.3" resolved "https://registry.yarnpkg.com/@elastic/ems-client/-/ems-client-7.9.3.tgz#71b79914f76e347f050ead8474ad65d761e94a8a" @@ -15294,7 +15282,7 @@ fresh@0.5.2: resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= -from2@^2.1.0, from2@^2.1.1, from2@^2.3.0: +from2@^2.1.0, from2@^2.1.1: version "2.3.0" resolved "https://registry.yarnpkg.com/from2/-/from2-2.3.0.tgz#8bfb5502bde4a4d36cfdeea007fcca21d7e382af" integrity sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8= @@ -18081,14 +18069,6 @@ into-stream@^3.1.0: from2 "^2.1.1" p-is-promise "^1.1.0" -into-stream@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/into-stream/-/into-stream-5.1.0.tgz#b05f37d8fed05c06a0b43b556d74e53e5af23878" - integrity sha512-cbDhb8qlxKMxPBk/QxTtYg1DQ4CwXmadu7quG3B7nrJsgSncEreF2kwWKZFdnjc/lSNNIkFPsjI7SM0Cx/QXPw== - dependencies: - from2 "^2.3.0" - p-is-promise "^2.0.0" - invariant@2.2.4, invariant@^2.1.0, invariant@^2.1.1, invariant@^2.2.3, invariant@^2.2.4: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" @@ -23776,11 +23756,6 @@ p-is-promise@^1.1.0: resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-1.1.0.tgz#9c9456989e9f6588017b0434d56097675c3da05e" integrity sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4= -p-is-promise@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-2.1.0.tgz#918cebaea248a62cf7ffab8e3bca8c5f882fc42e" - integrity sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg== - p-limit@^1.1.0: version "1.3.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" From 8f442f8318dfe0613fd51660cc7b4370b3ca2a29 Mon Sep 17 00:00:00 2001 From: Dima Arnautov Date: Fri, 17 Jul 2020 16:37:10 +0200 Subject: [PATCH 23/59] [ML] Fix HTML named characters encoding (#72060) * [ML] improve special characters encoding * [ML] update renovate.json5 --- renovate.json5 | 8 +++++++ x-pack/package.json | 2 ++ .../application/util/string_utils.test.ts | 7 +++++-- .../public/application/util/string_utils.ts | 21 +++++++++++-------- yarn.lock | 7 ++++++- 5 files changed, 33 insertions(+), 12 deletions(-) diff --git a/renovate.json5 b/renovate.json5 index 6424894622c9f..ae32043daaf5f 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -418,6 +418,14 @@ '@types/has-ansi', ], }, + { + groupSlug: 'he', + groupName: 'he related packages', + packageNames: [ + 'he', + '@types/he', + ], + }, { groupSlug: 'history', groupName: 'history related packages', diff --git a/x-pack/package.json b/x-pack/package.json index 6715fa132c1b5..1de009ae1232f 100644 --- a/x-pack/package.json +++ b/x-pack/package.json @@ -72,6 +72,7 @@ "@types/graphql": "^0.13.2", "@types/gulp": "^4.0.6", "@types/hapi__wreck": "^15.0.1", + "@types/he": "^1.1.1", "@types/hoist-non-react-statics": "^3.3.1", "@types/history": "^4.7.3", "@types/jest": "^25.2.3", @@ -265,6 +266,7 @@ "graphql-tools": "^3.0.2", "h2o2": "^8.1.2", "handlebars": "4.7.6", + "he": "^1.2.0", "history": "4.9.0", "history-extra": "^5.0.1", "i18n-iso-countries": "^4.3.1", diff --git a/x-pack/plugins/ml/public/application/util/string_utils.test.ts b/x-pack/plugins/ml/public/application/util/string_utils.test.ts index d7ed30065219a..80e318629d352 100644 --- a/x-pack/plugins/ml/public/application/util/string_utils.test.ts +++ b/x-pack/plugins/ml/public/application/util/string_utils.test.ts @@ -126,8 +126,11 @@ describe('ML - string utils', () => { expect(mlEscape('foobar')).toBe('foo>bar'); expect(mlEscape('foo"bar')).toBe('foo"bar'); - expect(mlEscape("foo'bar")).toBe('foo'bar'); - expect(mlEscape('foo/bar')).toBe('foo/bar'); + expect(mlEscape("foo'bar")).toBe('foo'bar'); + expect(mlEscape('foo/bar')).toBe('foo/bar'); + expect(mlEscape('escape © everything ≠ / 𝌆 \\')).toBe( + 'escape © everything ≠ / �� \' + ); }); }); diff --git a/x-pack/plugins/ml/public/application/util/string_utils.ts b/x-pack/plugins/ml/public/application/util/string_utils.ts index f659f8fdc1be1..55dd16082a07c 100644 --- a/x-pack/plugins/ml/public/application/util/string_utils.ts +++ b/x-pack/plugins/ml/public/application/util/string_utils.ts @@ -9,6 +9,7 @@ */ import _ from 'lodash'; import d3 from 'd3'; +import he from 'he'; import { CustomUrlAnomalyRecordDoc } from '../../../common/types/custom_urls'; import { Detector } from '../../../common/types/anomaly_detection_jobs'; @@ -105,15 +106,17 @@ export function toLocaleString(x: number | undefined | null): string { // escape html characters export function mlEscape(str: string): string { - const entityMap: { [escapeChar: string]: string } = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '/': '/', - }; - return String(str).replace(/[&<>"'\/]/g, (s) => entityMap[s]); + // It's not possible to use "he" encoding directly + // because \ and / characters are not going to be replaced without + // encodeEverything option. But with this option enabled + // each word character is encoded as well. + return String(str).replace(/\W/g, (s) => + he.encode(s, { + useNamedReferences: true, + encodeEverything: true, + allowUnsafeSymbols: false, + }) + ); } // Escapes reserved characters for use in Elasticsearch query terms. diff --git a/yarn.lock b/yarn.lock index 580e436a60282..e5975efe0b7d5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5141,6 +5141,11 @@ resolved "https://registry.yarnpkg.com/@types/has-ansi/-/has-ansi-3.0.0.tgz#636403dc4e0b2649421c4158e5c404416f3f0330" integrity sha512-H3vFOwfLlFEC0MOOrcSkus8PCnMCzz4N0EqUbdJZCdDhBTfkAu86aRYA+MTxjKW6jCpUvxcn4715US8g+28BMA== +"@types/he@^1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@types/he/-/he-1.1.1.tgz#19e14033c4ee8f1a702c74dcc6182664839ac2b7" + integrity sha512-jpzrsR1ns0n3kyWt92QfOUQhIuJGQ9+QGa7M62rO6toe98woQjnsnzjdMtsQXCdvjjmqjS2ZBCC7xKw0cdzU+Q== + "@types/history@*": version "4.7.2" resolved "https://registry.yarnpkg.com/@types/history/-/history-4.7.2.tgz#0e670ea254d559241b6eeb3894f8754991e73220" @@ -17063,7 +17068,7 @@ hawk@~6.0.2: hoek "4.x.x" sntp "2.x.x" -he@1.2.0, he@1.2.x, he@^1.1.1: +he@1.2.0, he@1.2.x, he@^1.1.1, he@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== From ac9178ab9a2537ce2468593d86d4c21b622db9cf Mon Sep 17 00:00:00 2001 From: MadameSheema Date: Fri, 17 Jul 2020 16:41:44 +0200 Subject: [PATCH 24/59] updates advanced settings text (#72249) --- .../detections/components/rules/step_about_rule/schema.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/step_about_rule/schema.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/step_about_rule/schema.tsx index f178923df5915..fbd03850eee75 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/step_about_rule/schema.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/step_about_rule/schema.tsx @@ -34,7 +34,7 @@ export const schema: FormSchema = { 'xpack.securitySolution.detectionEngine.createRule.stepAboutRule.fieldAuthorHelpText', { defaultMessage: - 'Type one or more author for this rule. Press enter after each author to add a new one.', + 'Type one or more authors for this rule. Press enter after each author to add a new one.', } ), labelAppend: OptionalFieldLabel, @@ -280,7 +280,7 @@ export const schema: FormSchema = { 'xpack.securitySolution.detectionEngine.createRule.stepAboutRule.guideHelpText', { defaultMessage: - 'Provide helpful information for analysts that are performing a signal investigation. This guide will appear on both the rule details page and in timelines created from alerts generated by this rule.', + 'Provide helpful information for analysts that are investigating detection alerts. This guide will appear on the rule details page and in timelines (as notes) created from detection alerts generated by this rule.', } ), labelAppend: OptionalFieldLabel, From 260eb139f86f2621edc7fd85417ca0aa71c82955 Mon Sep 17 00:00:00 2001 From: Melissa Alvarez Date: Fri, 17 Jul 2020 10:56:02 -0400 Subject: [PATCH 25/59] re-enable tests. retry on fail (#72061) --- .../components/configuration_step/analysis_fields_table.tsx | 1 + .../test/functional/apps/ml/data_frame_analytics/index.ts | 3 +-- .../functional/services/ml/data_frame_analytics_creation.ts | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/analysis_fields_table.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/analysis_fields_table.tsx index ff8797bc523c1..a229a79d316d7 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/analysis_fields_table.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/analysis_fields_table.tsx @@ -172,6 +172,7 @@ export const AnalysisFieldsTable: FC<{ return ( { + await testSubjects.existOrFail('mlAnalyticsCreateJobWizardIncludesSelect'); + }); }, // async assertIncludedFieldsSelection(expectedSelection: string[]) { From 6a03e8b5b8b54c2f96e1fefb41cd29d81ecf22df Mon Sep 17 00:00:00 2001 From: Stacey Gammon Date: Fri, 17 Jul 2020 11:08:57 -0400 Subject: [PATCH 26/59] Add a few asciidoc readmes (#72082) * Add a few asciidoc readmes * add updated code-exploration. Need to fix the script in another go to add asciidoc support. The snippet didn't show up anyway. --- docs/developer/architecture/code-exploration.asciidoc | 5 ++++- examples/{README.md => README.asciidoc} | 8 +++++--- src/dev/precommit_hook/casing_check_config.js | 1 + src/plugins/dashboard/README.asciidoc | 5 +++++ x-pack/plugins/embeddable_enhanced/README.asciidoc | 6 ++++++ x-pack/plugins/embeddable_enhanced/README.md | 1 - 6 files changed, 21 insertions(+), 5 deletions(-) rename examples/{README.md => README.asciidoc} (68%) create mode 100644 src/plugins/dashboard/README.asciidoc create mode 100644 x-pack/plugins/embeddable_enhanced/README.asciidoc delete mode 100644 x-pack/plugins/embeddable_enhanced/README.md diff --git a/docs/developer/architecture/code-exploration.asciidoc b/docs/developer/architecture/code-exploration.asciidoc index 23ba1c54d27d3..bed54277c82b4 100644 --- a/docs/developer/architecture/code-exploration.asciidoc +++ b/docs/developer/architecture/code-exploration.asciidoc @@ -365,7 +365,10 @@ WARNING: Missing README. WARNING: Missing README. -- {kib-repo}blob/{branch}/x-pack/plugins/embeddable_enhanced/README.md[embeddableEnhanced] +- {kib-repo}blob/{branch}/x-pack/plugins/embeddable_enhanced[embeddableEnhanced] + +WARNING: Missing README. + - {kib-repo}blob/{branch}/x-pack/plugins/encrypted_saved_objects/README.md[encryptedSavedObjects] diff --git a/examples/README.md b/examples/README.asciidoc similarity index 68% rename from examples/README.md rename to examples/README.asciidoc index 2b214a8d1eb52..d33c5e825ce12 100644 --- a/examples/README.md +++ b/examples/README.asciidoc @@ -1,7 +1,9 @@ -## Example plugins +[[example-plugins]] +== Example plugins This folder contains example plugins. To run the plugins in this folder, use the `--run-examples` flag, via -``` +[source,bash] +---- yarn start --run-examples -``` +---- diff --git a/src/dev/precommit_hook/casing_check_config.js b/src/dev/precommit_hook/casing_check_config.js index 6b1f1dfaeabb4..929de8c6701d4 100644 --- a/src/dev/precommit_hook/casing_check_config.js +++ b/src/dev/precommit_hook/casing_check_config.js @@ -30,6 +30,7 @@ export const IGNORE_FILE_GLOBS = [ 'docs/**/*', '**/bin/**/*', '**/+([A-Z_]).md', + '**/+([A-Z_]).asciidoc', '**/LICENSE', '**/*.txt', '**/Gruntfile.js', diff --git a/src/plugins/dashboard/README.asciidoc b/src/plugins/dashboard/README.asciidoc new file mode 100644 index 0000000000000..78163b14c14d6 --- /dev/null +++ b/src/plugins/dashboard/README.asciidoc @@ -0,0 +1,5 @@ +[[kibana-dashboard-plugin]] +== Dashboard plugin + +- Registers the dashboard application. +- Adds a dashboard embeddable that can be used in other applications. \ No newline at end of file diff --git a/x-pack/plugins/embeddable_enhanced/README.asciidoc b/x-pack/plugins/embeddable_enhanced/README.asciidoc new file mode 100644 index 0000000000000..9a7fe9c2669d9 --- /dev/null +++ b/x-pack/plugins/embeddable_enhanced/README.asciidoc @@ -0,0 +1,6 @@ +[[enhanced-embeddables-plugin]] +== Enhanced embeddables plugin + +Enhances Embeddables by registering a custom factory provider. The enhanced factory provider +adds dynamic actions to every embeddables state, in order to support drilldowns. + diff --git a/x-pack/plugins/embeddable_enhanced/README.md b/x-pack/plugins/embeddable_enhanced/README.md deleted file mode 100644 index a0be90731fdb0..0000000000000 --- a/x-pack/plugins/embeddable_enhanced/README.md +++ /dev/null @@ -1 +0,0 @@ -# X-Pack part of `embeddable` plugin From 2ad4328fda8a5eb35a3a82bfb010a27202f196a2 Mon Sep 17 00:00:00 2001 From: Dima Arnautov Date: Fri, 17 Jul 2020 17:09:18 +0200 Subject: [PATCH 27/59] [ML] Remove DragSelect event handlers and selectors on the swim lane unmount (#72250) * [ML] remove selector element on unmount * [ML] stop handler on mount * [ML] remove throttling --- .../application/explorer/explorer_swimlane.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/x-pack/plugins/ml/public/application/explorer/explorer_swimlane.tsx b/x-pack/plugins/ml/public/application/explorer/explorer_swimlane.tsx index 926f38ac8b552..2590ab2f1cb23 100644 --- a/x-pack/plugins/ml/public/application/explorer/explorer_swimlane.tsx +++ b/x-pack/plugins/ml/public/application/explorer/explorer_swimlane.tsx @@ -204,6 +204,8 @@ export class ExplorerSwimlane extends React.Component { }); this.renderSwimlane(); + + this.dragSelect.stop(); } componentDidUpdate() { @@ -211,11 +213,11 @@ export class ExplorerSwimlane extends React.Component { } componentWillUnmount() { - if (this.dragSelectSubscriber !== null) { - this.dragSelectSubscriber.unsubscribe(); - } - const element = d3.select(this.rootNode.current!); - element.html(''); + this.dragSelectSubscriber!.unsubscribe(); + // Remove selector element from DOM + this.dragSelect.selector.remove(); + // removes all mousedown event handlers + this.dragSelect.stop(true); } selectCell(cellsToSelect: any[], { laneLabels, bucketScore, times }: SelectedData) { From 39381ca3c849a9c9b3d486d9552f51e52cb942d9 Mon Sep 17 00:00:00 2001 From: igoristic Date: Fri, 17 Jul 2020 11:13:40 -0400 Subject: [PATCH 28/59] [Monitoring] Added a case for Alerting if security/ssl is disabled (#71846) * Added a case for Alerting if security/ssl is disabled * Code feedback * Fixed types --- x-pack/plugins/monitoring/kibana.json | 3 +- .../public/alerts/lib/security_toasts.tsx | 137 ++++++++++++++++++ .../monitoring/public/services/clusters.js | 4 +- .../elasticsearch/verify_alerting_security.ts | 49 +++++++ x-pack/plugins/monitoring/server/plugin.ts | 1 + .../server/routes/api/v1/alerts/enable.ts | 25 +++- x-pack/plugins/monitoring/server/types.ts | 3 + 7 files changed, 216 insertions(+), 6 deletions(-) create mode 100644 x-pack/plugins/monitoring/public/alerts/lib/security_toasts.tsx create mode 100644 x-pack/plugins/monitoring/server/lib/elasticsearch/verify_alerting_security.ts diff --git a/x-pack/plugins/monitoring/kibana.json b/x-pack/plugins/monitoring/kibana.json index 3b9e60124b034..2b8756ea0cb46 100644 --- a/x-pack/plugins/monitoring/kibana.json +++ b/x-pack/plugins/monitoring/kibana.json @@ -11,7 +11,8 @@ "kibanaLegacy", "triggers_actions_ui", "alerts", - "actions" + "actions", + "encryptedSavedObjects" ], "optionalPlugins": ["infra", "telemetryCollectionManager", "usageCollection", "home", "cloud"], "server": true, diff --git a/x-pack/plugins/monitoring/public/alerts/lib/security_toasts.tsx b/x-pack/plugins/monitoring/public/alerts/lib/security_toasts.tsx new file mode 100644 index 0000000000000..918c0b5c9b609 --- /dev/null +++ b/x-pack/plugins/monitoring/public/alerts/lib/security_toasts.tsx @@ -0,0 +1,137 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import React from 'react'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n/react'; +import { EuiSpacer, EuiLink, EuiCode, EuiText } from '@elastic/eui'; +import { Legacy } from '../../legacy_shims'; +import { toMountPoint } from '../../../../../../src/plugins/kibana_react/public'; + +export interface AlertingFrameworkHealth { + isSufficientlySecure: boolean; + hasPermanentEncryptionKey: boolean; +} + +const showTlsAndEncryptionError = () => { + const { ELASTIC_WEBSITE_URL, DOC_LINK_VERSION } = Legacy.shims.docLinks; + + Legacy.shims.toastNotifications.addWarning({ + title: toMountPoint( + + ), + text: toMountPoint( +
+

+ {i18n.translate('xpack.monitoring.healthCheck.tlsAndEncryptionError', { + defaultMessage: `You must enable Transport Layer Security between Kibana and Elasticsearch + and configure an encryption key in your kibana.yml file to use the Alerting feature.`, + })} +

+ + + {i18n.translate('xpack.monitoring.healthCheck.encryptionErrorAction', { + defaultMessage: 'Learn how.', + })} + +
+ ), + }); +}; + +const showEncryptionError = () => { + const { ELASTIC_WEBSITE_URL, DOC_LINK_VERSION } = Legacy.shims.docLinks; + + Legacy.shims.toastNotifications.addWarning( + { + title: toMountPoint( + + ), + text: toMountPoint( +
+ {i18n.translate('xpack.monitoring.healthCheck.encryptionErrorBeforeKey', { + defaultMessage: 'To create an alert, set a value for ', + })} + + {'xpack.encryptedSavedObjects.encryptionKey'} + + {i18n.translate('xpack.monitoring.healthCheck.encryptionErrorAfterKey', { + defaultMessage: ' in your kibana.yml file. ', + })} + + {i18n.translate('xpack.monitoring.healthCheck.encryptionErrorAction', { + defaultMessage: 'Learn how.', + })} + +
+ ), + }, + {} + ); +}; + +const showTlsError = () => { + const { ELASTIC_WEBSITE_URL, DOC_LINK_VERSION } = Legacy.shims.docLinks; + + Legacy.shims.toastNotifications.addWarning({ + title: toMountPoint( + + ), + text: toMountPoint( +
+ {i18n.translate('xpack.monitoring.healthCheck.tlsError', { + defaultMessage: + 'Alerting relies on API keys, which require TLS between Elasticsearch and Kibana. ', + })} + + {i18n.translate('xpack.monitoring.healthCheck.tlsErrorAction', { + defaultMessage: 'Learn how to enable TLS.', + })} + +
+ ), + }); +}; + +export const showSecurityToast = (alertingHealth: AlertingFrameworkHealth) => { + const { isSufficientlySecure, hasPermanentEncryptionKey } = alertingHealth; + if ( + Array.isArray(alertingHealth) || + (!alertingHealth.hasOwnProperty('isSufficientlySecure') && + !alertingHealth.hasOwnProperty('hasPermanentEncryptionKey')) + ) { + return; + } + + if (!isSufficientlySecure && !hasPermanentEncryptionKey) { + showTlsAndEncryptionError(); + } else if (!isSufficientlySecure) { + showTlsError(); + } else if (!hasPermanentEncryptionKey) { + showEncryptionError(); + } +}; diff --git a/x-pack/plugins/monitoring/public/services/clusters.js b/x-pack/plugins/monitoring/public/services/clusters.js index f3eadcaf9831b..5173984dbe868 100644 --- a/x-pack/plugins/monitoring/public/services/clusters.js +++ b/x-pack/plugins/monitoring/public/services/clusters.js @@ -7,6 +7,7 @@ import { ajaxErrorHandlersProvider } from '../lib/ajax_error_handler'; import { Legacy } from '../legacy_shims'; import { STANDALONE_CLUSTER_CLUSTER_UUID } from '../../common/constants'; +import { showSecurityToast } from '../alerts/lib/security_toasts'; function formatClusters(clusters) { return clusters.map(formatCluster); @@ -66,7 +67,8 @@ export function monitoringClustersProvider($injector) { return getClusters().then((clusters) => { if (clusters.length) { return ensureAlertsEnabled() - .then(() => { + .then(({ data }) => { + showSecurityToast(data); once = true; return clusters; }) diff --git a/x-pack/plugins/monitoring/server/lib/elasticsearch/verify_alerting_security.ts b/x-pack/plugins/monitoring/server/lib/elasticsearch/verify_alerting_security.ts new file mode 100644 index 0000000000000..047b14bd37fbc --- /dev/null +++ b/x-pack/plugins/monitoring/server/lib/elasticsearch/verify_alerting_security.ts @@ -0,0 +1,49 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { RequestHandlerContext } from 'kibana/server'; +import { EncryptedSavedObjectsPluginSetup } from '../../../../encrypted_saved_objects/server'; + +export interface AlertingFrameworkHealth { + isSufficientlySecure: boolean; + hasPermanentEncryptionKey: boolean; +} + +export interface XPackUsageSecurity { + security?: { + enabled?: boolean; + ssl?: { + http?: { + enabled?: boolean; + }; + }; + }; +} + +export class AlertingSecurity { + public static readonly getSecurityHealth = async ( + context: RequestHandlerContext, + encryptedSavedObjects: EncryptedSavedObjectsPluginSetup + ): Promise => { + const { + security: { + enabled: isSecurityEnabled = false, + ssl: { http: { enabled: isTLSEnabled = false } = {} } = {}, + } = {}, + }: XPackUsageSecurity = await context.core.elasticsearch.legacy.client.callAsInternalUser( + 'transport.request', + { + method: 'GET', + path: '/_xpack/usage', + } + ); + + return { + isSufficientlySecure: !isSecurityEnabled || (isSecurityEnabled && isTLSEnabled), + hasPermanentEncryptionKey: !encryptedSavedObjects.usingEphemeralEncryptionKey, + }; + }; +} diff --git a/x-pack/plugins/monitoring/server/plugin.ts b/x-pack/plugins/monitoring/server/plugin.ts index 5f358badde401..39ec5fe1ffaa7 100644 --- a/x-pack/plugins/monitoring/server/plugin.ts +++ b/x-pack/plugins/monitoring/server/plugin.ts @@ -203,6 +203,7 @@ export class Plugin { requireUIRoutes(this.monitoringCore, { router, licenseService: this.licenseService, + encryptedSavedObjects: plugins.encryptedSavedObjects, }); initInfraSource(config, plugins.infra); } diff --git a/x-pack/plugins/monitoring/server/routes/api/v1/alerts/enable.ts b/x-pack/plugins/monitoring/server/routes/api/v1/alerts/enable.ts index b7cc088d2716c..64beb5c58dc07 100644 --- a/x-pack/plugins/monitoring/server/routes/api/v1/alerts/enable.ts +++ b/x-pack/plugins/monitoring/server/routes/api/v1/alerts/enable.ts @@ -10,18 +10,36 @@ import { AlertsFactory } from '../../../../alerts'; import { RouteDependencies } from '../../../../types'; import { ALERT_ACTION_TYPE_LOG } from '../../../../../common/constants'; import { ActionResult } from '../../../../../../actions/common'; -// import { fetchDefaultEmailAddress } from '../../../../lib/alerts/fetch_default_email_address'; +import { AlertingSecurity } from '../../../../lib/elasticsearch/verify_alerting_security'; const DEFAULT_SERVER_LOG_NAME = 'Monitoring: Write to Kibana log'; -export function enableAlertsRoute(server: any, npRoute: RouteDependencies) { +export function enableAlertsRoute(_server: unknown, npRoute: RouteDependencies) { npRoute.router.post( { path: '/api/monitoring/v1/alerts/enable', validate: false, }, - async (context, request, response) => { + async (context, _request, response) => { try { + const alerts = AlertsFactory.getAll().filter((a) => a.isEnabled(npRoute.licenseService)); + + if (alerts.length) { + const { + isSufficientlySecure, + hasPermanentEncryptionKey, + } = await AlertingSecurity.getSecurityHealth(context, npRoute.encryptedSavedObjects); + + if (!isSufficientlySecure || !hasPermanentEncryptionKey) { + return response.ok({ + body: { + isSufficientlySecure, + hasPermanentEncryptionKey, + }, + }); + } + } + const alertsClient = context.alerting?.getAlertsClient(); const actionsClient = context.actions?.getActionsClient(); const types = context.actions?.listTypes(); @@ -57,7 +75,6 @@ export function enableAlertsRoute(server: any, npRoute: RouteDependencies) { }, ]; - const alerts = AlertsFactory.getAll().filter((a) => a.isEnabled(npRoute.licenseService)); const createdAlerts = await Promise.all( alerts.map( async (alert) => await alert.createIfDoesNotExist(alertsClient, actionsClient, actions) diff --git a/x-pack/plugins/monitoring/server/types.ts b/x-pack/plugins/monitoring/server/types.ts index 0c346c8082475..1e7a5acb33644 100644 --- a/x-pack/plugins/monitoring/server/types.ts +++ b/x-pack/plugins/monitoring/server/types.ts @@ -16,6 +16,7 @@ import { import { InfraPluginSetup } from '../../infra/server'; import { LicensingPluginSetup } from '../../licensing/server'; import { PluginSetupContract as FeaturesPluginSetupContract } from '../../features/server'; +import { EncryptedSavedObjectsPluginSetup } from '../../encrypted_saved_objects/server'; export interface MonitoringLicenseService { refresh: () => Promise; @@ -36,6 +37,7 @@ export interface LegacyAPI { } export interface PluginsSetup { + encryptedSavedObjects: EncryptedSavedObjectsPluginSetup; telemetryCollectionManager?: TelemetryCollectionManagerPluginSetup; usageCollection?: UsageCollectionSetup; licensing: LicensingPluginSetup; @@ -56,6 +58,7 @@ export interface MonitoringCoreConfig { export interface RouteDependencies { router: IRouter; licenseService: MonitoringLicenseService; + encryptedSavedObjects: EncryptedSavedObjectsPluginSetup; } export interface MonitoringCore { From 825c16875ea9dab3168c8177abde685d808250d1 Mon Sep 17 00:00:00 2001 From: Joe Reuter Date: Fri, 17 Jul 2020 17:16:28 +0200 Subject: [PATCH 29/59] register graph usage (#72041) --- x-pack/plugins/graph/server/lib/license_state.ts | 13 +++++++++++++ x-pack/plugins/graph/server/plugin.ts | 10 +++++++--- x-pack/plugins/graph/server/routes/explore.ts | 1 + x-pack/plugins/graph/server/routes/search.ts | 1 + 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/graph/server/lib/license_state.ts b/x-pack/plugins/graph/server/lib/license_state.ts index d86cb5380a2e1..8d64c826d8fa1 100644 --- a/x-pack/plugins/graph/server/lib/license_state.ts +++ b/x-pack/plugins/graph/server/lib/license_state.ts @@ -7,6 +7,7 @@ import Boom from 'boom'; import { map } from 'rxjs/operators'; import { Observable, Subscription } from 'rxjs'; +import { LicensingPluginStart } from '../../../licensing/server'; import { ILicense } from '../../../licensing/common/types'; import { checkLicense, GraphLicenseInformation } from '../../common/check_license'; @@ -14,6 +15,7 @@ export class LicenseState { private licenseInformation: GraphLicenseInformation = checkLicense(undefined); private subscription: Subscription | null = null; private observable: Observable | null = null; + private _notifyUsage: LicensingPluginStart['featureUsage']['notifyUsage'] | null = null; private updateInformation(licenseInformation: GraphLicenseInformation) { this.licenseInformation = licenseInformation; @@ -24,6 +26,17 @@ export class LicenseState { this.subscription = this.observable.subscribe(this.updateInformation.bind(this)); } + public setNotifyUsage(notifyUsage: LicensingPluginStart['featureUsage']['notifyUsage']) { + this._notifyUsage = notifyUsage; + } + + // 'Graph' is the only allowed feature here at the moment, if this gets extended in the future, add to the union type + public notifyUsage(featureName: 'Graph') { + if (this._notifyUsage) { + this._notifyUsage(featureName); + } + } + public stop() { if (this.subscription) { this.subscription.unsubscribe(); diff --git a/x-pack/plugins/graph/server/plugin.ts b/x-pack/plugins/graph/server/plugin.ts index 141d5d0ea8db4..b2b825fa4683b 100644 --- a/x-pack/plugins/graph/server/plugin.ts +++ b/x-pack/plugins/graph/server/plugin.ts @@ -5,8 +5,8 @@ */ import { i18n } from '@kbn/i18n'; -import { Plugin, CoreSetup } from 'src/core/server'; -import { LicensingPluginSetup } from '../../licensing/server'; +import { Plugin, CoreSetup, CoreStart } from 'src/core/server'; +import { LicensingPluginSetup, LicensingPluginStart } from '../../licensing/server'; import { LicenseState } from './lib/license_state'; import { registerSearchRoute } from './routes/search'; import { registerExploreRoute } from './routes/explore'; @@ -34,6 +34,7 @@ export class GraphPlugin implements Plugin { licenseState.start(licensing.license$); this.licenseState = licenseState; core.savedObjects.registerType(graphWorkspace); + licensing.featureUsage.register('Graph', 'platinum'); if (home) { registerSampleData(home.sampleData, licenseState); @@ -79,7 +80,10 @@ export class GraphPlugin implements Plugin { registerExploreRoute({ licenseState, router }); } - public start() {} + public start(core: CoreStart, { licensing }: { licensing: LicensingPluginStart }) { + this.licenseState!.setNotifyUsage(licensing.featureUsage.notifyUsage); + } + public stop() { if (this.licenseState) { this.licenseState.stop(); diff --git a/x-pack/plugins/graph/server/routes/explore.ts b/x-pack/plugins/graph/server/routes/explore.ts index b0b8cf14ff699..c436fbd1c79af 100644 --- a/x-pack/plugins/graph/server/routes/explore.ts +++ b/x-pack/plugins/graph/server/routes/explore.ts @@ -42,6 +42,7 @@ export function registerExploreRoute({ response ) => { verifyApiAccess(licenseState); + licenseState.notifyUsage('Graph'); try { return response.ok({ body: { diff --git a/x-pack/plugins/graph/server/routes/search.ts b/x-pack/plugins/graph/server/routes/search.ts index 645e6b520013f..e1d430eeb311a 100644 --- a/x-pack/plugins/graph/server/routes/search.ts +++ b/x-pack/plugins/graph/server/routes/search.ts @@ -42,6 +42,7 @@ export function registerSearchRoute({ response ) => { verifyApiAccess(licenseState); + licenseState.notifyUsage('Graph'); const includeFrozen = await uiSettings.get(UI_SETTINGS.SEARCH_INCLUDE_FROZEN); try { return response.ok({ From 44fc2a828c755f77e14713c0484e541cfcecaf1b Mon Sep 17 00:00:00 2001 From: Stacey Gammon Date: Fri, 17 Jul 2020 12:04:18 -0400 Subject: [PATCH 30/59] Fix indentation level in code exploration doc (#72274) * fix indentation level in code exploration doc * run the script to update the file --- docs/developer/architecture/code-exploration.asciidoc | 8 ++++---- .../kbn-dev-utils/src/plugin_list/generate_plugin_list.ts | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/developer/architecture/code-exploration.asciidoc b/docs/developer/architecture/code-exploration.asciidoc index bed54277c82b4..2f67ae002c916 100644 --- a/docs/developer/architecture/code-exploration.asciidoc +++ b/docs/developer/architecture/code-exploration.asciidoc @@ -11,7 +11,7 @@ NOTE: //// [[code-exploration]] -=== Exploring Kibana code +== Exploring Kibana code The goals of our folder heirarchy are: @@ -28,10 +28,10 @@ To that aim, we strive to: [discrete] [[kibana-services-applications]] -==== Services and Applications +=== Services and Applications [discrete] -===== src/plugins +==== src/plugins - {kib-repo}blob/{branch}/src/plugins/advanced_settings[advancedSettings] @@ -283,7 +283,7 @@ WARNING: Missing README. [discrete] -===== x-pack/plugins +==== x-pack/plugins - {kib-repo}blob/{branch}/x-pack/plugins/actions/README.md[actions] diff --git a/packages/kbn-dev-utils/src/plugin_list/generate_plugin_list.ts b/packages/kbn-dev-utils/src/plugin_list/generate_plugin_list.ts index f3f8817299bb1..f0f799862e24e 100644 --- a/packages/kbn-dev-utils/src/plugin_list/generate_plugin_list.ts +++ b/packages/kbn-dev-utils/src/plugin_list/generate_plugin_list.ts @@ -54,7 +54,7 @@ NOTE: //// [[code-exploration]] -=== Exploring Kibana code +== Exploring Kibana code The goals of our folder heirarchy are: @@ -71,14 +71,14 @@ To that aim, we strive to: [discrete] [[kibana-services-applications]] -==== Services and Applications +=== Services and Applications [discrete] -===== src/plugins +==== src/plugins ${Array.from(printPlugins(ossPlugins)).join('\n')} [discrete] -===== x-pack/plugins +==== x-pack/plugins ${Array.from(printPlugins(xpackPlugins)).join('\n')} `; } From 1adaa3b76c16e4f02bd9ee98ff181eaea9c24566 Mon Sep 17 00:00:00 2001 From: Yara Tercero Date: Fri, 17 Jul 2020 12:39:51 -0400 Subject: [PATCH 31/59] [Security Solution][Exceptions] - Remove initial add exception item button in builder (#72215) ## Summary This PR addresses two issues in the builder: - **Existing behavior:** if you add a bunch of entries then delete all but one, the indent that shows for when multiple entries exists does not go away - **Updated behavior:** if you add a bunch of entries and delete all but one, the indent that shows for when multiple entries exist goes away - **Existing behavior:** on render of add exception modal, if no exception items exist (or no exception items with entries exist) an `Add Exception` button appears - **Updated behavior:** if only one entry exists, the delete button is disabled for that entry; on initial render of the add exception modal, if no entries exist, an empty entry is shown --- .../builder_button_options.stories.tsx | 17 -- .../builder/builder_button_options.test.tsx | 44 --- .../builder/builder_button_options.tsx | 76 ++--- .../builder/builder_exception_item.test.tsx | 282 ++++++++++++++++++ .../builder/builder_exception_item.tsx | 161 ++++++++++ .../exceptions/builder/exception_item.tsx | 140 --------- .../components/exceptions/builder/index.tsx | 48 ++- .../components/exceptions/translations.ts | 7 - 8 files changed, 493 insertions(+), 282 deletions(-) create mode 100644 x-pack/plugins/security_solution/public/common/components/exceptions/builder/builder_exception_item.test.tsx create mode 100644 x-pack/plugins/security_solution/public/common/components/exceptions/builder/builder_exception_item.tsx delete mode 100644 x-pack/plugins/security_solution/public/common/components/exceptions/builder/exception_item.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/builder/builder_button_options.stories.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/builder/builder_button_options.stories.tsx index 7e4cbe34f9a64..9486008e708ea 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/builder/builder_button_options.stories.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/builder/builder_button_options.stories.tsx @@ -16,26 +16,12 @@ addDecorator((storyFn) => ( )); storiesOf('Components|Exceptions|BuilderButtonOptions', module) - .add('init button', () => { - return ( - - ); - }) .add('and/or buttons', () => { return ( { isAndDisabled={false} isOrDisabled={false} showNestedButton={false} - displayInitButton={false} onOrClicked={jest.fn()} onAndClicked={jest.fn()} onNestedClicked={jest.fn()} @@ -31,44 +30,6 @@ describe('BuilderButtonOptions', () => { expect(wrapper.find('[data-test-subj="exceptionsNestedButton"] button')).toHaveLength(0); }); - test('it renders "add exception" button if "displayInitButton" is true', () => { - const wrapper = mount( - - ); - - expect(wrapper.find('[data-test-subj="exceptionsAddNewExceptionButton"] button')).toHaveLength( - 1 - ); - }); - - test('it invokes "onAddExceptionClicked" when "add exception" button is clicked', () => { - const onOrClicked = jest.fn(); - - const wrapper = mount( - - ); - - wrapper.find('[data-test-subj="exceptionsAddNewExceptionButton"] button').simulate('click'); - - expect(onOrClicked).toHaveBeenCalledTimes(1); - }); - test('it invokes "onOrClicked" when "or" button is clicked', () => { const onOrClicked = jest.fn(); @@ -77,7 +38,6 @@ describe('BuilderButtonOptions', () => { isAndDisabled={false} isOrDisabled={false} showNestedButton={false} - displayInitButton={false} onOrClicked={onOrClicked} onAndClicked={jest.fn()} onNestedClicked={jest.fn()} @@ -97,7 +57,6 @@ describe('BuilderButtonOptions', () => { isAndDisabled={false} isOrDisabled={false} showNestedButton={false} - displayInitButton={false} onOrClicked={jest.fn()} onAndClicked={onAndClicked} onNestedClicked={jest.fn()} @@ -113,7 +72,6 @@ describe('BuilderButtonOptions', () => { const wrapper = mount( { const wrapper = mount( { isAndDisabled={false} isOrDisabled={false} showNestedButton - displayInitButton={false} onOrClicked={jest.fn()} onAndClicked={jest.fn()} onNestedClicked={onNestedClicked} diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/builder/builder_button_options.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/builder/builder_button_options.tsx index ff1556bcc4d25..eb224b82d756f 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/builder/builder_button_options.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/builder/builder_button_options.tsx @@ -16,7 +16,6 @@ const MyEuiButton = styled(EuiButton)` interface BuilderButtonOptionsProps { isOrDisabled: boolean; isAndDisabled: boolean; - displayInitButton: boolean; showNestedButton: boolean; onAndClicked: () => void; onOrClicked: () => void; @@ -26,64 +25,47 @@ interface BuilderButtonOptionsProps { export const BuilderButtonOptions: React.FC = ({ isOrDisabled = false, isAndDisabled = false, - displayInitButton, showNestedButton = false, onAndClicked, onOrClicked, onNestedClicked, }) => ( - {displayInitButton ? ( + + + {i18n.AND} + + + + + {i18n.OR} + + + {showNestedButton && ( - {i18n.ADD_EXCEPTION_TITLE} + {i18n.ADD_NESTED_DESCRIPTION} - ) : ( - <> - - - {i18n.AND} - - - - - {i18n.OR} - - - {showNestedButton && ( - - - {i18n.ADD_NESTED_DESCRIPTION} - - - )} - )} ); diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/builder/builder_exception_item.test.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/builder/builder_exception_item.test.tsx new file mode 100644 index 0000000000000..9ca7a371ce81b --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/builder/builder_exception_item.test.tsx @@ -0,0 +1,282 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import React from 'react'; +import { ThemeProvider } from 'styled-components'; +import { mount } from 'enzyme'; +import euiLightVars from '@elastic/eui/dist/eui_theme_light.json'; + +import { ExceptionListItemComponent } from './builder_exception_item'; +import { fields } from '../../../../../../../../src/plugins/data/common/index_patterns/fields/fields.mocks.ts'; +import { getExceptionListItemSchemaMock } from '../../../../../../lists/common/schemas/response/exception_list_item_schema.mock'; +import { + getEntryMatchMock, + getEntryMatchAnyMock, +} from '../../../../../../lists/common/schemas/types/entries.mock'; + +describe('ExceptionListItemComponent', () => { + describe('and badge logic', () => { + test('it renders "and" badge with extra top padding for the first exception item when "andLogicIncluded" is "true"', () => { + const exceptionItem = getExceptionListItemSchemaMock(); + exceptionItem.entries = [getEntryMatchMock(), getEntryMatchMock()]; + const wrapper = mount( + ({ eui: euiLightVars, darkMode: false })}> + + + ); + + expect( + wrapper.find('[data-test-subj="exceptionItemEntryFirstRowAndBadge"]').exists() + ).toBeTruthy(); + }); + + test('it renders "and" badge when more than one exception item entry exists and it is not the first exception item', () => { + const exceptionItem = getExceptionListItemSchemaMock(); + exceptionItem.entries = [getEntryMatchMock(), getEntryMatchMock()]; + const wrapper = mount( + ({ eui: euiLightVars, darkMode: false })}> + + + ); + + expect(wrapper.find('[data-test-subj="exceptionItemEntryAndBadge"]').exists()).toBeTruthy(); + }); + + test('it renders indented "and" badge when "andLogicIncluded" is "true" and only one entry exists', () => { + const exceptionItem = getExceptionListItemSchemaMock(); + exceptionItem.entries = [getEntryMatchMock()]; + const wrapper = mount( + ({ eui: euiLightVars, darkMode: false })}> + + + ); + + expect( + wrapper.find('[data-test-subj="exceptionItemEntryInvisibleAndBadge"]').exists() + ).toBeTruthy(); + }); + + test('it renders no "and" badge when "andLogicIncluded" is "false"', () => { + const exceptionItem = getExceptionListItemSchemaMock(); + exceptionItem.entries = [getEntryMatchMock()]; + const wrapper = mount( + ({ eui: euiLightVars, darkMode: false })}> + + + ); + + expect( + wrapper.find('[data-test-subj="exceptionItemEntryInvisibleAndBadge"]').exists() + ).toBeFalsy(); + expect(wrapper.find('[data-test-subj="exceptionItemEntryAndBadge"]').exists()).toBeFalsy(); + expect( + wrapper.find('[data-test-subj="exceptionItemEntryFirstRowAndBadge"]').exists() + ).toBeFalsy(); + }); + }); + + describe('delete button logic', () => { + test('it renders delete button disabled when it is only entry left in builder', () => { + const exceptionItem = getExceptionListItemSchemaMock(); + exceptionItem.entries = [getEntryMatchMock()]; + const wrapper = mount( + + ); + + expect( + wrapper.find('[data-test-subj="exceptionItemEntryDeleteButton"] button').props().disabled + ).toBeTruthy(); + }); + + test('it does not render delete button disabled when it is not the only entry left in builder', () => { + const exceptionItem = getExceptionListItemSchemaMock(); + exceptionItem.entries = [getEntryMatchMock()]; + + const wrapper = mount( + + ); + + expect( + wrapper.find('[data-test-subj="exceptionItemEntryDeleteButton"] button').props().disabled + ).toBeFalsy(); + }); + + test('it does not render delete button disabled when "exceptionItemIndex" is not "0"', () => { + const exceptionItem = getExceptionListItemSchemaMock(); + exceptionItem.entries = [getEntryMatchMock()]; + const wrapper = mount( + + ); + + expect( + wrapper.find('[data-test-subj="exceptionItemEntryDeleteButton"] button').props().disabled + ).toBeFalsy(); + }); + + test('it does not render delete button disabled when more than one entry exists', () => { + const exceptionItem = getExceptionListItemSchemaMock(); + exceptionItem.entries = [getEntryMatchMock(), getEntryMatchMock()]; + const wrapper = mount( + + ); + + expect( + wrapper.find('[data-test-subj="exceptionItemEntryDeleteButton"] button').at(0).props() + .disabled + ).toBeFalsy(); + }); + + test('it invokes "onChangeExceptionItem" when delete button clicked', () => { + const mockOnDeleteExceptionItem = jest.fn(); + const exceptionItem = getExceptionListItemSchemaMock(); + exceptionItem.entries = [getEntryMatchMock(), getEntryMatchAnyMock()]; + const wrapper = mount( + + ); + + wrapper + .find('[data-test-subj="exceptionItemEntryDeleteButton"] button') + .at(0) + .simulate('click'); + + expect(mockOnDeleteExceptionItem).toHaveBeenCalledWith( + { + ...exceptionItem, + entries: [getEntryMatchAnyMock()], + }, + 0 + ); + }); + }); +}); diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/builder/builder_exception_item.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/builder/builder_exception_item.tsx new file mode 100644 index 0000000000000..8e57e83d0e7e4 --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/builder/builder_exception_item.tsx @@ -0,0 +1,161 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import React, { useMemo, useCallback } from 'react'; +import { EuiButtonIcon, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import styled from 'styled-components'; + +import { IIndexPattern } from '../../../../../../../../src/plugins/data/common'; +import { AndOrBadge } from '../../and_or_badge'; +import { EntryItemComponent } from './entry_item'; +import { getFormattedBuilderEntries } from '../helpers'; +import { FormattedBuilderEntry, ExceptionsBuilderExceptionItem, BuilderEntry } from '../types'; + +const MyInvisibleAndBadge = styled(EuiFlexItem)` + visibility: hidden; +`; + +const MyFirstRowContainer = styled(EuiFlexItem)` + padding-top: 20px; +`; + +interface ExceptionListItemProps { + exceptionItem: ExceptionsBuilderExceptionItem; + exceptionId: string; + exceptionItemIndex: number; + isLoading: boolean; + indexPattern: IIndexPattern; + andLogicIncluded: boolean; + isOnlyItem: boolean; + onDeleteExceptionItem: (item: ExceptionsBuilderExceptionItem, index: number) => void; + onChangeExceptionItem: (item: ExceptionsBuilderExceptionItem, index: number) => void; +} + +export const ExceptionListItemComponent = React.memo( + ({ + exceptionItem, + exceptionId, + exceptionItemIndex, + indexPattern, + isLoading, + isOnlyItem, + andLogicIncluded, + onDeleteExceptionItem, + onChangeExceptionItem, + }) => { + const handleEntryChange = useCallback( + (entry: BuilderEntry, entryIndex: number): void => { + const updatedEntries: BuilderEntry[] = [ + ...exceptionItem.entries.slice(0, entryIndex), + { ...entry }, + ...exceptionItem.entries.slice(entryIndex + 1), + ]; + const updatedExceptionItem: ExceptionsBuilderExceptionItem = { + ...exceptionItem, + entries: updatedEntries, + }; + onChangeExceptionItem(updatedExceptionItem, exceptionItemIndex); + }, + [onChangeExceptionItem, exceptionItem, exceptionItemIndex] + ); + + const handleDeleteEntry = useCallback( + (entryIndex: number): void => { + const updatedEntries: BuilderEntry[] = [ + ...exceptionItem.entries.slice(0, entryIndex), + ...exceptionItem.entries.slice(entryIndex + 1), + ]; + const updatedExceptionItem: ExceptionsBuilderExceptionItem = { + ...exceptionItem, + entries: updatedEntries, + }; + + onDeleteExceptionItem(updatedExceptionItem, exceptionItemIndex); + }, + [exceptionItem, onDeleteExceptionItem, exceptionItemIndex] + ); + + const entries = useMemo( + (): FormattedBuilderEntry[] => + indexPattern != null ? getFormattedBuilderEntries(indexPattern, exceptionItem.entries) : [], + [indexPattern, exceptionItem] + ); + + const andBadge = useMemo((): JSX.Element => { + const badge = ; + if (entries.length > 1 && exceptionItemIndex === 0) { + return ( + + {badge} + + ); + } else if (entries.length > 1) { + return ( + + {badge} + + ); + } else { + return ( + + {badge} + + ); + } + }, [entries.length, exceptionItemIndex]); + + const getDeleteButton = useCallback( + (index: number): JSX.Element => { + const button = ( + handleDeleteEntry(index)} + isDisabled={isOnlyItem && entries.length === 1 && exceptionItemIndex === 0} + aria-label="entryDeleteButton" + className="exceptionItemEntryDeleteButton" + data-test-subj="exceptionItemEntryDeleteButton" + /> + ); + if (index === 0 && exceptionItemIndex === 0) { + return {button}; + } else { + return {button}; + } + }, + [entries.length, exceptionItemIndex, handleDeleteEntry, isOnlyItem] + ); + + return ( + + {andLogicIncluded && andBadge} + + + {entries.map((item, index) => ( + + + + + + {getDeleteButton(index)} + + + ))} + + + + ); + } +); + +ExceptionListItemComponent.displayName = 'ExceptionListItem'; diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/builder/exception_item.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/builder/exception_item.tsx deleted file mode 100644 index 5e53ce3ba6578..0000000000000 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/builder/exception_item.tsx +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import React, { useMemo } from 'react'; -import { EuiButtonIcon, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import styled from 'styled-components'; - -import { IIndexPattern } from '../../../../../../../../src/plugins/data/common'; -import { AndOrBadge } from '../../and_or_badge'; -import { EntryItemComponent } from './entry_item'; -import { getFormattedBuilderEntries } from '../helpers'; -import { FormattedBuilderEntry, ExceptionsBuilderExceptionItem, BuilderEntry } from '../types'; - -const MyInvisibleAndBadge = styled(EuiFlexItem)` - visibility: hidden; -`; - -const MyFirstRowContainer = styled(EuiFlexItem)` - padding-top: 20px; -`; - -interface ExceptionListItemProps { - exceptionItem: ExceptionsBuilderExceptionItem; - exceptionId: string; - exceptionItemIndex: number; - isLoading: boolean; - indexPattern: IIndexPattern; - andLogicIncluded: boolean; - onCheckAndLogic: (item: ExceptionsBuilderExceptionItem[]) => void; - onDeleteExceptionItem: (item: ExceptionsBuilderExceptionItem, index: number) => void; - onExceptionItemChange: (item: ExceptionsBuilderExceptionItem, index: number) => void; -} - -export const ExceptionListItemComponent = React.memo( - ({ - exceptionItem, - exceptionId, - exceptionItemIndex, - indexPattern, - isLoading, - andLogicIncluded, - onCheckAndLogic, - onDeleteExceptionItem, - onExceptionItemChange, - }) => { - const handleEntryChange = (entry: BuilderEntry, entryIndex: number): void => { - const updatedEntries: BuilderEntry[] = [ - ...exceptionItem.entries.slice(0, entryIndex), - { ...entry }, - ...exceptionItem.entries.slice(entryIndex + 1), - ]; - const updatedExceptionItem: ExceptionsBuilderExceptionItem = { - ...exceptionItem, - entries: updatedEntries, - }; - onExceptionItemChange(updatedExceptionItem, exceptionItemIndex); - }; - - const handleDeleteEntry = (entryIndex: number): void => { - const updatedEntries: BuilderEntry[] = [ - ...exceptionItem.entries.slice(0, entryIndex), - ...exceptionItem.entries.slice(entryIndex + 1), - ]; - const updatedExceptionItem: ExceptionsBuilderExceptionItem = { - ...exceptionItem, - entries: updatedEntries, - }; - - onDeleteExceptionItem(updatedExceptionItem, exceptionItemIndex); - }; - - const entries = useMemo((): FormattedBuilderEntry[] => { - onCheckAndLogic([exceptionItem]); - return indexPattern != null - ? getFormattedBuilderEntries(indexPattern, exceptionItem.entries) - : []; - }, [indexPattern, exceptionItem, onCheckAndLogic]); - - const andBadge = useMemo((): JSX.Element => { - const badge = ; - if (entries.length > 1 && exceptionItemIndex === 0) { - return {badge}; - } else if (entries.length > 1) { - return {badge}; - } else { - return {badge}; - } - }, [entries.length, exceptionItemIndex]); - - const getDeleteButton = (index: number): JSX.Element => { - const button = ( - handleDeleteEntry(index)} - aria-label="entryDeleteButton" - className="exceptionItemEntryDeleteButton" - data-test-subj="exceptionItemEntryDeleteButton" - /> - ); - if (index === 0 && exceptionItemIndex === 0) { - return {button}; - } else { - return {button}; - } - }; - - return ( - - {andLogicIncluded && andBadge} - - - {entries.map((item, index) => ( - - - - - - {getDeleteButton(index)} - - - ))} - - - - ); - } -); - -ExceptionListItemComponent.displayName = 'ExceptionListItem'; diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/builder/index.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/builder/index.tsx index 6bff33afaf70c..08e5b49073ecf 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/builder/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/builder/index.tsx @@ -3,11 +3,11 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import React, { useMemo, useCallback, useEffect, useState } from 'react'; +import React, { useCallback, useEffect, useState } from 'react'; import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import styled from 'styled-components'; -import { ExceptionListItemComponent } from './exception_item'; +import { ExceptionListItemComponent } from './builder_exception_item'; import { useFetchIndexPatterns } from '../../../../detections/containers/detection_engine/rules/fetch_index_patterns'; import { ExceptionListItemSchema, @@ -80,20 +80,9 @@ export const ExceptionBuilder = ({ ); const handleCheckAndLogic = (items: ExceptionsBuilderExceptionItem[]): void => { - setAndLogicIncluded((includesAnd: boolean): boolean => { - if (includesAnd) { - return true; - } else { - return items.filter(({ entries }) => entries.length > 1).length > 0; - } - }); + setAndLogicIncluded(items.filter(({ entries }) => entries.length > 1).length > 0); }; - // Bubble up changes to parent - useEffect(() => { - onChange({ exceptionItems: filterExceptionItems(exceptions), exceptionsToDelete }); - }, [onChange, exceptionsToDelete, exceptions]); - const handleDeleteExceptionItem = ( item: ExceptionsBuilderExceptionItem, itemIndex: number @@ -164,16 +153,6 @@ export const ExceptionBuilder = ({ setExceptions((existingExceptions) => [...existingExceptions, { ...newException }]); }, [setExceptions, listType, listId, listNamespaceType, ruleName]); - // An exception item can have an empty array for `entries` - const displayInitialAddExceptionButton = useMemo((): boolean => { - return ( - exceptions.length === 0 || - (exceptions.length === 1 && - exceptions[0].entries != null && - exceptions[0].entries.length === 0) - ); - }, [exceptions]); - // Filters index pattern fields by exceptionable fields if list type is endpoint const filterIndexPatterns = useCallback(() => { if (listType === 'endpoint') { @@ -199,6 +178,22 @@ export const ExceptionBuilder = ({ } }; + // Bubble up changes to parent + useEffect(() => { + onChange({ exceptionItems: filterExceptionItems(exceptions), exceptionsToDelete }); + }, [onChange, exceptionsToDelete, exceptions]); + + useEffect(() => { + if ( + exceptions.length === 0 || + (exceptions.length === 1 && + exceptions[0].entries != null && + exceptions[0].entries.length === 0) + ) { + handleAddNewExceptionItem(); + } + }, [exceptions, handleAddNewExceptionItem]); + return ( {(isLoading || indexPatternLoading) && ( @@ -233,9 +228,9 @@ export const ExceptionBuilder = ({ isLoading={indexPatternLoading} exceptionItemIndex={index} andLogicIncluded={andLogicIncluded} - onCheckAndLogic={handleCheckAndLogic} + isOnlyItem={exceptions.length === 1} onDeleteExceptionItem={handleDeleteExceptionItem} - onExceptionItemChange={handleExceptionItemChange} + onChangeExceptionItem={handleExceptionItemChange} />
@@ -253,7 +248,6 @@ export const ExceptionBuilder = ({ Date: Fri, 17 Jul 2020 10:06:54 -0700 Subject: [PATCH 32/59] =?UTF-8?q?docs:=20=E2=9C=8F=EF=B8=8F=20add=20"Explo?= =?UTF-8?q?re=20underlying=20data"=20user=20docs=20(#70807)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: ✏️ add "Explore underlying data" user docs * docs: ✏️ improve docs * docs: ✏️ change the way Discover is referred * docs: ✏️ improve texts in line with review comments * Update docs/drilldowns/explore-underlying-data.asciidoc Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com> * Update docs/drilldowns/explore-underlying-data.asciidoc Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com> Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com> --- .../explore-underlying-data.asciidoc | 41 ++++++++++++++++++ .../images/explore_data_context_menu.png | Bin 0 -> 103214 bytes .../images/explore_data_in_chart.png | Bin 0 -> 99870 bytes docs/user/dashboard.asciidoc | 1 + 4 files changed, 42 insertions(+) create mode 100644 docs/drilldowns/explore-underlying-data.asciidoc create mode 100644 docs/drilldowns/images/explore_data_context_menu.png create mode 100644 docs/drilldowns/images/explore_data_in_chart.png diff --git a/docs/drilldowns/explore-underlying-data.asciidoc b/docs/drilldowns/explore-underlying-data.asciidoc new file mode 100644 index 0000000000000..e0f940f73e96e --- /dev/null +++ b/docs/drilldowns/explore-underlying-data.asciidoc @@ -0,0 +1,41 @@ +[[explore-underlying-data]] +== Explore the underlying data for a visualization + +++++ +Explore the underlying data +++++ + +Dashboard panels have an *Explore underlying data* action that navigates you to *Discover*, +where you can narrow your documents to the ones you'll most likely use in a visualization. +This action is available for visualizations backed by a single index pattern. + +You can access *Explore underlying data* in two ways: from the panel context +menu or from the menu that appears when you interact with the chart. + +[float] +[[explore-data-from-panel-context-menu]] +=== Explore data from panel context menu + +The *Explore underlying data* action in the panel menu navigates you to Discover, +carrying over the index pattern, filters, query, and time range for the visualization. + +[role="screenshot"] +image::images/explore_data_context_menu.png[Explore underlying data from panel context menu] + +[float] +[[explore-data-from-chart]] +=== Explore data from chart action + +Initiating *Explore underlying data* from the chart also navigates to Discover, +carrying over the current context for the visualization. In addition, this action +applies the filters and time range created by the events that triggered the action. + +[role="screenshot"] +image::images/explore_data_in_chart.png[Explore underlying data from chart] + +You can disable this action by adding the following line to your `kibana.yml` config. + +["source","yml"] +----------- +xpack.discoverEnhanced.actions.exploreDataInChart.enabled: false +----------- diff --git a/docs/drilldowns/images/explore_data_context_menu.png b/docs/drilldowns/images/explore_data_context_menu.png new file mode 100644 index 0000000000000000000000000000000000000000..5742991030c892151dad9d156b7fb3b0ad3f5cdc GIT binary patch literal 103214 zcmZr&1z3}97Y3veMGz1W2?eD_cPc1d(l9`}*=UfKQV;|leKE$Z$Xmz6Qs!tBbOpE=C6Cpg z5X;=*WW*%pFaPvnnm&}IF!Yf&4y_BVaq?3KJ!yxu=eaG+AoY3zyrBumdHu>s&B^7C zQ}0D;R86fL+N$%uS&5fAxgUnrM-eglz?g*C9(qx1DGp)|KNi|uEPRTGAP}Vl#rhQp zVvi;@Z0MruaN%^`5L&O2NrdKSDv`vXj*CxgkB-KEt8Fm|jY#t2%*&S_6@prbsM?JD zhK!WI*}& zk((TJt|a@C8MJ&s0^kH1lEQuqGx=r@qA$a*dLnP{6Z1Nehut>9qwERa&)xehDWKQ0 zWVt-Dw-n%`actL7``}&hRjl?`s(D|1RwV`hIDE8cZ0{emN)!-&_NQm3ld}uZAq}hI zl;m?Xt7Z0~dOc2WCG|Rirn4vQdZxQ?`rO61*rt73Y4t%w3RBEPIx5ciwF6x(@M|*B`&i7z^~@;%~a< z;44BY7GUJmI*!;;Df1mCNg)!#y@@x9mmD~$_JCo($e7}$5S=fAaiM^n``Z?64*9)T zI1;XHZ@C>vkgq(Sh~E{#eR=#!7tUy}v0dOBy#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f-2K+odEwxV31-a z@BlRazQh~z`4YewSuant%IvKJzDPO~>$?wJ?D0?MhBchZ$O=wZ2_Xf=Au}%cm|WOM zdCd9ye!LSuz0K7zI)?jm!=2kot-*W2UMIeuM|i0Bw-}4Wm5hjW#GlDX!FPsvFukjp k+9JqE??H*O4CrsJKzn|w`$ErE4*@@#FkN+ws$InY0G%JLy#N3J literal 0 HcmV?d00001 diff --git a/docs/drilldowns/images/explore_data_in_chart.png b/docs/drilldowns/images/explore_data_in_chart.png new file mode 100644 index 0000000000000000000000000000000000000000..05d4f5fac9b2fafe808e72ff0ab2c5e0028f33fc GIT binary patch literal 99870 zcmeEucQ~Bg_O?V25iME}42d4SMJI?J(W6K2L}x}9B|-GwJJEY5h~Dck7!kdUZbtV_ z&UtgrFL}?O-=FVX*UVG*v-e(mt+nrU@Ab^bH?O6!ACNsjK|#Tmm623ILAjTWf^zrE zeRSj*%nkS=3d%!cO9_cLvJw)2H;(pZmNup+C^8@8G%<8zq{-XeOrk69;z#1cA4!^_ zkW!c2zgs1)_VSU;V-C7|M0~Y{?-pr35tM#nc#8pW0T`u8Ip|0`WU3T(GqI|*VPQ@| z?62B35Y332eW%gujHu=oH3eX z%u)#K#v|`D^u-(1SboBzpVg^l)nYtG$B~ZZK!9RGmccf9N30opTT9CSNng(OV7L@FV4jvZJ|4M1OFV>3wULo}ZO~boWMP>g3WIt{ zn1afDPX1jqk{MifYFC0Ii5viL;0xVkDuU8+b5r?F54^5v|B*<-qenbWB%y?cm}Dd2 zM@5H~5-)T{)-2X%4%Y&_)#0`SEzdp&-NwKDM*hP`@A+#5zr+V9uUMj=^@^2XSNhSg zQOnr|Xc2`ra!Bwxnzk@`lZVXFSW1Q@Qw{dT2lra;$GbvI-6(M=VgY`HIq%6cE|dFBTeECsYiu?gtp zEb7wK(`8@WRRBhaZ|Ey7?x&{jB_Cv9WgKGxqE(~$NxfJV3&ndD2S|Iv<2&3$$3Rl&rQ*am}1SVoF_j_w;pOe>I%vF zCS&ws9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=Jxle?rUEO&@-#n0?mBew-7`+x9otVXAY6L zLckUovzy3O^}EF2j=*R+%)fDR!VikRS#zRA)rQ0=VGgC=%PAlsIWr&Gqu&k%wjb!&Ht2EY`%pO^MW!(d=n^gyWM5PwYk$wilXh#cM}L9{Epn` zzgFB`&&%y+81^70W039|A3V3Snz56srZI|#b+mW?>Pyn!E_)w`XF2%b*KnfnxuK7m z0d3ow3^Q%2!3EJvDw5}(#W~{CCrBDOJeJjqeqociBedVe;IFeDkpndN;Z4I`-_qMd zd$0a&OkRQ{Mru!Vr^VMMbO&?APL(!3BuK$tnb*579iX_C8)!F)JBPxGtS2Mb!qhWT|Cd VWGX&|iQ!=%RYeVWsl0j6{{Z*TLa+b; literal 0 HcmV?d00001 diff --git a/docs/user/dashboard.asciidoc b/docs/user/dashboard.asciidoc index a812d4e3bdd2d..b812af7e981bf 100644 --- a/docs/user/dashboard.asciidoc +++ b/docs/user/dashboard.asciidoc @@ -160,6 +160,7 @@ When you're finished adding and arranging the panels, save the dashboard. . Enter the dashboard *Title* and optional *Description*, then *Save* the dashboard. include::{kib-repo-dir}/drilldowns/drilldowns.asciidoc[] +include::{kib-repo-dir}/drilldowns/explore-underlying-data.asciidoc[] [[sharing-dashboards]] == Share the dashboard From 679209b308d70bcdecdad2eadf3dc21e81eae8a3 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Fri, 17 Jul 2020 11:38:45 -0600 Subject: [PATCH 33/59] [Maps] 7.9 documenation updates (#71893) * [Maps] 7.9 documenation updates * more cleanup * add vector tiles card to tile layers page --- docs/maps/heatmap-layer.asciidoc | 4 +-- docs/maps/maps-aggregations.asciidoc | 4 +-- docs/maps/maps-getting-started.asciidoc | 35 +++++-------------------- docs/maps/tile-layer.asciidoc | 4 ++- docs/maps/vector-layer.asciidoc | 11 ++++---- 5 files changed, 18 insertions(+), 40 deletions(-) diff --git a/docs/maps/heatmap-layer.asciidoc b/docs/maps/heatmap-layer.asciidoc index 7149bc5623169..9dc2781db44a3 100644 --- a/docs/maps/heatmap-layer.asciidoc +++ b/docs/maps/heatmap-layer.asciidoc @@ -7,8 +7,8 @@ Heat map layers cluster point data to show locations with higher densities. [role="screenshot"] image::maps/images/heatmap_layer.png[] -To add a heat map layer to your map, click *Add layer*, then select the *Heat map* layer. -The index must contain at least one field mapped as {ref}/geo-point.html[geo_point]. +To add a heat map layer to your map, click *Add layer*, then select *Heat map*. +The index must contain at least one field mapped as {ref}/geo-point.html[geo_point] or {ref}/geo-shape.html[geo_shape]. NOTE: Only count, sum, unique count metric aggregations are available with the grid aggregation source and heat map layers. Average, min, and max are turned off because the heat map will blend nearby values. diff --git a/docs/maps/maps-aggregations.asciidoc b/docs/maps/maps-aggregations.asciidoc index 872ed1cdedb7e..6b2dc8077bc30 100644 --- a/docs/maps/maps-aggregations.asciidoc +++ b/docs/maps/maps-aggregations.asciidoc @@ -47,7 +47,7 @@ Grid aggregation layers use {ref}/search-aggregations-bucket-geotilegrid-aggrega Symbolize grid aggregation metrics as: *Clusters*:: Creates a <> with a cluster symbol for each gridded cell. -The cluster location is the weighted centroid for all geo-points in the gridded cell. +The cluster location is the weighted centroid for all documents in the gridded cell. *Grid rectangles*:: Creates a <> with a bounding box polygon for each gridded cell. @@ -60,7 +60,7 @@ To enable a grid aggregation layer: To enable a blended layer that dynamically shows clusters or documents: . Click *Add layer*, then select the *Documents* layer. -. Configure *Index pattern* and the *Geospatial field*. To enable clustering, the *Geospatial field* must be set to a field mapped as {ref}/geo-point.html[geo_point]. +. Configure *Index pattern* and the *Geospatial field*. . In *Scaling*, select *Show clusters when results exceed 10000*. diff --git a/docs/maps/maps-getting-started.asciidoc b/docs/maps/maps-getting-started.asciidoc index 09a4dc61cae28..e0d43a571a331 100644 --- a/docs/maps/maps-getting-started.asciidoc +++ b/docs/maps/maps-getting-started.asciidoc @@ -68,40 +68,17 @@ The first layer you'll add is a choropleth layer to shade world countries by web log traffic. Darker shades symbolize countries with more web log traffic, and lighter shades symbolize countries with less traffic. -==== Add a vector layer to display world country boundaries - . Click *Add layer*. -. Select the *EMS Boundaries* layer. +. Select *Choropleth*. . From the *Layer* dropdown menu, select *World Countries*. +. Under *Statistics source*, set *Index pattern* to *kibana_sample_data_logs*. +. Set *Join field* to *geo.src*. . Click the *Add layer* button. . Set *Name* to `Total Requests by Country`. . Set *Opacity* to 50%. . Click *Add* under *Tooltip fields*. . In the popover, select *ISO 3166-1 alpha-2 code* and *name* and click *Add*. - -===== Join the vector layer with the sample web log index - -You now have a vector layer containing the world countries. -To symbolize countries by web traffic, you'll need to augment the world country features with the count of Elasticsearch weblog documents originating from each country. -To do this, you'll create a <> to link the vector source *World Countries* to -the {es} index `kibana_sample_data_logs` on the shared key iso2 = geo.src. - -. Click plus image:maps/images/gs_plus_icon.png[] next to the *Term Joins* label. -. Click *Join --select--* -. Set *Left field* to *ISO 3166-1 alpha-2 code*. -. Set *Right source* to *kibana_sample_data_logs*. -. Set *Right field* to *geo.src*. -. Click *and use metric count*. -. Set *Custom label* to *web logs count*. - -===== Set the layer style - -All of the world countries are still a single color because the layer is using <>. -To shade the world countries based on which country is sending the most requests, you'll need to use <>. - -. Under *Fill color*, change the selected value from *Solid* to *By value*. -. In the field select input, select *web logs count*. -. Select the grey color ramp. +. Under *Fill color*, select the grey color ramp. . Under *Border color*, change the selected color to *white*. . Click *Save & close*. + @@ -127,7 +104,7 @@ This layer displays web log documents as points. The layer is only visible when users zoom in the map past zoom level 9. . Click *Add layer*. -. Click the *Documents* layer. +. Select *Documents*. . Set *Index pattern* to *kibana_sample_data_logs*. . Click the *Add layer* button. . Set *Name* to `Actual Requests`. @@ -161,7 +138,7 @@ image::maps/images/grid_metrics_both.png[] ===== Add the layer . Click *Add layer*. -. Click the *Clusters and grids* layer. +. Select *Clusters and grids*. . Set *Index pattern* to *kibana_sample_data_logs*. . Click the *Add layer* button. . Set *Name* to `Total Requests and Bytes`. diff --git a/docs/maps/tile-layer.asciidoc b/docs/maps/tile-layer.asciidoc index 6da8dbad0a66d..2a60504c3c790 100644 --- a/docs/maps/tile-layer.asciidoc +++ b/docs/maps/tile-layer.asciidoc @@ -7,7 +7,7 @@ Tile layers display image tiles served from a tile server. [role="screenshot"] image::maps/images/tile_layer.png[] -To add a tile layer to your map, click *Add layer*, then select one of the following layers: +To add a tile layer to your map, click *Add layer*, then select one of the following: *Configured Tile Map Service*:: Tile map service configured in kibana.yml. See map.tilemap.url in <> for details. @@ -16,4 +16,6 @@ See map.tilemap.url in <> for details. *Tile Map Service*:: Tile map service configured in interface. +*Vector tiles*:: Data service implementing the Mapbox vector tile specification. + *Web Map Service*:: Maps from OGC Standard WMS. diff --git a/docs/maps/vector-layer.asciidoc b/docs/maps/vector-layer.asciidoc index d6a5931659a40..494bd915b7f56 100644 --- a/docs/maps/vector-layer.asciidoc +++ b/docs/maps/vector-layer.asciidoc @@ -7,15 +7,14 @@ Vector layers display points, lines, and polygons. [role="screenshot"] image::maps/images/vector_layer.png[] -To add a vector layer to your map, click *Add layer*, then select one of the following layers: +To add a vector layer to your map, click *Add layer*, then select one of the following: -*Clusters and grids*:: Geospatial data grouped in grids with metrics for each gridded cell. -The index must contain at least one field mapped as {ref}/geo-point.html[geo_point]. +*Choropleth*:: Shaded areas to compare statistics across boundaries. -*Configured GeoJSON*:: Vector data from hosted GeoJSON configured in kibana.yml. -See map.regionmap.* in <> for details. +*Clusters and grids*:: Geospatial data grouped in grids with metrics for each gridded cell. +The index must contain at least one field mapped as {ref}/geo-point.html[geo_point] or {ref}/geo-shape.html[geo_shape]. -*Documents*:: Vector data from a Kibana index pattern. +*Documents*:: Points, lines, and polyons from Elasticsearch. The index must contain at least one field mapped as {ref}/geo-point.html[geo_point] or {ref}/geo-shape.html[geo_shape]. NOTE: Document results are limited to the `index.max_result_window` index setting, which defaults to 10000. From 35ff37a434e61d2475428ff474fce50ee9bb68b1 Mon Sep 17 00:00:00 2001 From: Wylie Conlon Date: Fri, 17 Jul 2020 14:02:52 -0400 Subject: [PATCH 34/59] [Lens] Fix switching with layers (#71982) * [Lens] Fix chart switching with multiple layers * Unskip Lens smokescreen test * Fix types * Revert

change --- .../config_panel/config_panel.tsx | 2 +- .../config_panel/layer_panel.test.tsx | 6 +- .../editor_frame/config_panel/layer_panel.tsx | 2 +- .../workspace_panel/chart_switch.test.tsx | 53 +++++++++++ .../workspace_panel/chart_switch.tsx | 7 +- .../xy_visualization/xy_suggestions.test.ts | 92 +++++++++++++++++-- .../public/xy_visualization/xy_suggestions.ts | 16 +++- .../test/functional/apps/lens/smokescreen.ts | 26 ++++++ .../test/functional/page_objects/lens_page.ts | 28 ++++++ 9 files changed, 214 insertions(+), 18 deletions(-) diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/config_panel.tsx b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/config_panel.tsx index 7f4a48fa2fda2..73126b814f256 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/config_panel.tsx +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/config_panel.tsx @@ -129,7 +129,7 @@ function LayerPanels( className="lnsConfigPanel__addLayerBtn" fullWidth size="s" - data-test-subj="lnsXY_layer_add" + data-test-subj="lnsLayerAddButton" aria-label={i18n.translate('xpack.lens.xyChart.addLayerButton', { defaultMessage: 'Add layer', })} diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.test.tsx b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.test.tsx index 1f987f86d3950..9545bd3c840da 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.test.tsx +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.test.tsx @@ -93,14 +93,14 @@ describe('LayerPanel', () => { describe('layer reset and remove', () => { it('should show the reset button when single layer', () => { const component = mountWithIntl(); - expect(component.find('[data-test-subj="lns_layer_remove"]').first().text()).toContain( + expect(component.find('[data-test-subj="lnsLayerRemove"]').first().text()).toContain( 'Reset layer' ); }); it('should show the delete button when multiple layers', () => { const component = mountWithIntl(); - expect(component.find('[data-test-subj="lns_layer_remove"]').first().text()).toContain( + expect(component.find('[data-test-subj="lnsLayerRemove"]').first().text()).toContain( 'Delete layer' ); }); @@ -109,7 +109,7 @@ describe('LayerPanel', () => { const cb = jest.fn(); const component = mountWithIntl(); act(() => { - component.find('[data-test-subj="lns_layer_remove"]').first().simulate('click'); + component.find('[data-test-subj="lnsLayerRemove"]').first().simulate('click'); }); expect(cb).toHaveBeenCalled(); }); diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.tsx b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.tsx index e51a155a19935..f72b1429967d2 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.tsx +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.tsx @@ -429,7 +429,7 @@ export function LayerPanel( size="xs" iconType="trash" color="danger" - data-test-subj="lns_layer_remove" + data-test-subj="lnsLayerRemove" onClick={() => { // If we don't blur the remove / clear button, it remains focused // which is a strange UX in this case. e.target.blur doesn't work diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/chart_switch.test.tsx b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/chart_switch.test.tsx index 648bb5c03cb39..ceced2a7a353c 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/chart_switch.test.tsx +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/chart_switch.test.tsx @@ -46,6 +46,16 @@ describe('chart_switch', () => { }; } + /** + * There are three visualizations. Each one has the same suggestion behavior: + * + * visA: suggests an empty state + * visB: suggests an empty state + * visC: + * - Never switches to subvisC2 + * - Allows a switch to subvisC3 + * - Allows a switch to subvisC1 + */ function mockVisualizations() { return { visA: generateVisualization('visA'), @@ -292,6 +302,49 @@ describe('chart_switch', () => { expect(getMenuItem('visB', component).prop('betaBadgeIconType')).toEqual('alert'); }); + it('should support multi-layer suggestions without data loss', () => { + const dispatch = jest.fn(); + const visualizations = mockVisualizations(); + const frame = mockFrame(['a', 'b']); + + const datasourceMap = mockDatasourceMap(); + datasourceMap.testDatasource.getDatasourceSuggestionsFromCurrentState.mockReturnValue([ + { + state: {}, + table: { + columns: [ + { + columnId: 'a', + operation: { + label: '', + dataType: 'string', + isBucketed: true, + }, + }, + ], + isMultiRow: true, + layerId: 'a', + changeType: 'unchanged', + }, + keptLayerIds: ['a', 'b'], + }, + ]); + + const component = mount( + + ); + + expect(getMenuItem('visB', component).prop('betaBadgeIconType')).toBeUndefined(); + }); + it('should indicate data loss if no data will be used', () => { const dispatch = jest.fn(); const visualizations = mockVisualizations(); diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/chart_switch.tsx b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/chart_switch.tsx index fa87d80e5cf40..51b4a347af6f1 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/chart_switch.tsx +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/chart_switch.tsx @@ -139,7 +139,7 @@ export function ChartSwitch(props: Props) { dataLoss = 'nothing'; } else if (!topSuggestion) { dataLoss = 'everything'; - } else if (layers.length > 1) { + } else if (layers.length > 1 && layers.length !== topSuggestion.keptLayerIds.length) { dataLoss = 'layers'; } else if (topSuggestion.columns !== layers[0][1].getTableSpec().length) { dataLoss = 'columns'; @@ -258,14 +258,15 @@ function getTopSuggestion( newVisualization: Visualization, subVisualizationId?: string ): Suggestion | undefined { - const suggestions = getSuggestions({ + const unfilteredSuggestions = getSuggestions({ datasourceMap: props.datasourceMap, datasourceStates: props.datasourceStates, visualizationMap: { [visualizationId]: newVisualization }, activeVisualizationId: props.visualizationId, visualizationState: props.visualizationState, subVisualizationId, - }).filter((suggestion) => { + }); + const suggestions = unfilteredSuggestions.filter((suggestion) => { // don't use extended versions of current data table on switching between visualizations // to avoid confusing the user. return ( diff --git a/x-pack/plugins/lens/public/xy_visualization/xy_suggestions.test.ts b/x-pack/plugins/lens/public/xy_visualization/xy_suggestions.test.ts index f301206355060..f5828dbaeccc3 100644 --- a/x-pack/plugins/lens/public/xy_visualization/xy_suggestions.test.ts +++ b/x-pack/plugins/lens/public/xy_visualization/xy_suggestions.test.ts @@ -13,6 +13,7 @@ import { } from '../types'; import { State, XYState, visualizationTypes } from './types'; import { generateId } from '../id_generator'; +import { xyVisualization } from './xy_visualization'; jest.mock('../id_generator'); @@ -119,7 +120,33 @@ describe('xy_suggestions', () => { }); expect(suggestions).toHaveLength(visualizationTypes.length); - expect(suggestions.map(({ state }) => state.preferredSeriesType)).toEqual([ + expect(suggestions.map(({ state }) => xyVisualization.getVisualizationTypeId(state))).toEqual([ + 'bar_stacked', + 'area_stacked', + 'area', + 'line', + 'bar_horizontal_stacked', + 'bar_horizontal', + 'bar', + ]); + }); + + // This limitation is acceptable for now, but is now tested + test('is unable to generate layers when switching from a non-XY chart with multiple layers', () => { + (generateId as jest.Mock).mockReturnValueOnce('aaa'); + const suggestions = getSuggestions({ + table: { + isMultiRow: true, + columns: [numCol('bytes'), dateCol('date')], + layerId: 'first', + changeType: 'unchanged', + }, + keptLayerIds: ['first', 'second'], + }); + + expect(suggestions).toHaveLength(visualizationTypes.length); + expect(suggestions.map(({ state }) => state.layers.length)).toEqual([1, 1, 1, 1, 1, 1, 1]); + expect(suggestions.map(({ state }) => xyVisualization.getVisualizationTypeId(state))).toEqual([ 'bar_stacked', 'area_stacked', 'area', @@ -156,7 +183,51 @@ describe('xy_suggestions', () => { }); expect(suggestions).toHaveLength(visualizationTypes.length); - expect(suggestions.map(({ state }) => state.preferredSeriesType)).toEqual([ + expect(suggestions.map(({ state }) => xyVisualization.getVisualizationTypeId(state))).toEqual([ + 'line', + 'bar', + 'bar_horizontal', + 'bar_stacked', + 'bar_horizontal_stacked', + 'area', + 'area_stacked', + ]); + }); + + test('suggests all basic x y charts when switching from another x y chart with multiple layers', () => { + (generateId as jest.Mock).mockReturnValueOnce('aaa'); + const suggestions = getSuggestions({ + table: { + isMultiRow: true, + columns: [numCol('bytes'), dateCol('date')], + layerId: 'first', + changeType: 'unchanged', + }, + keptLayerIds: ['first', 'second'], + state: { + legend: { isVisible: true, position: 'bottom' }, + preferredSeriesType: 'bar', + layers: [ + { + layerId: 'first', + seriesType: 'bar', + xAccessor: 'date', + accessors: ['bytes'], + splitAccessor: undefined, + }, + { + layerId: 'second', + seriesType: 'bar', + xAccessor: undefined, + accessors: [], + splitAccessor: undefined, + }, + ], + }, + }); + + expect(suggestions).toHaveLength(visualizationTypes.length); + expect(suggestions.map(({ state }) => xyVisualization.getVisualizationTypeId(state))).toEqual([ 'line', 'bar', 'bar_horizontal', @@ -165,6 +236,15 @@ describe('xy_suggestions', () => { 'area', 'area_stacked', ]); + expect(suggestions.map(({ state }) => state.layers.map((l) => l.layerId))).toEqual([ + ['first', 'second'], + ['first', 'second'], + ['first', 'second'], + ['first', 'second'], + ['first', 'second'], + ['first', 'second'], + ['first', 'second'], + ]); }); test('suggests all basic x y chart with date on x', () => { @@ -388,7 +468,7 @@ describe('xy_suggestions', () => { changeType: 'unchanged', }, state: currentState, - keptLayerIds: [], + keptLayerIds: ['first'], }); expect(rest).toHaveLength(visualizationTypes.length - 2); @@ -497,7 +577,7 @@ describe('xy_suggestions', () => { changeType: 'extended', }, state: currentState, - keptLayerIds: [], + keptLayerIds: ['first'], }); expect(rest).toHaveLength(0); @@ -536,7 +616,7 @@ describe('xy_suggestions', () => { changeType: 'reorder', }, state: currentState, - keptLayerIds: [], + keptLayerIds: ['first'], }); expect(rest).toHaveLength(0); @@ -576,7 +656,7 @@ describe('xy_suggestions', () => { changeType: 'extended', }, state: currentState, - keptLayerIds: [], + keptLayerIds: ['first'], }); expect(rest).toHaveLength(0); diff --git a/x-pack/plugins/lens/public/xy_visualization/xy_suggestions.ts b/x-pack/plugins/lens/public/xy_visualization/xy_suggestions.ts index e0bfbd266f8f1..d7348f00bf8b8 100644 --- a/x-pack/plugins/lens/public/xy_visualization/xy_suggestions.ts +++ b/x-pack/plugins/lens/public/xy_visualization/xy_suggestions.ts @@ -394,17 +394,25 @@ function buildSuggestion({ : undefined, }; + // Maintain consistent order for any layers that were saved const keptLayers = currentState - ? currentState.layers.filter( - (layer) => layer.layerId !== layerId && keptLayerIds.includes(layer.layerId) - ) + ? currentState.layers + // Remove layers that aren't being suggested + .filter((layer) => keptLayerIds.includes(layer.layerId)) + // Update in place + .map((layer) => (layer.layerId === layerId ? newLayer : layer)) + // Replace the seriesType on all previous layers + .map((layer) => ({ + ...layer, + seriesType, + })) : []; const state: State = { legend: currentState ? currentState.legend : { isVisible: true, position: Position.Right }, fittingFunction: currentState?.fittingFunction || 'None', preferredSeriesType: seriesType, - layers: [...keptLayers, newLayer], + layers: Object.keys(existingLayer).length ? keptLayers : [...keptLayers, newLayer], }; return { diff --git a/x-pack/test/functional/apps/lens/smokescreen.ts b/x-pack/test/functional/apps/lens/smokescreen.ts index 8bb5faf2469d7..23d4cc972675b 100644 --- a/x-pack/test/functional/apps/lens/smokescreen.ts +++ b/x-pack/test/functional/apps/lens/smokescreen.ts @@ -165,5 +165,31 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // legend item(s), so we're using a class selector here. expect(await find.allByCssSelector('.echLegendItem')).to.have.length(3); }); + + it('should switch from a multi-layer stacked bar to a multi-layer line chart', async () => { + await PageObjects.visualize.navigateToNewVisualization(); + await PageObjects.visualize.clickVisType('lens'); + await PageObjects.lens.goToTimeRange(); + + await PageObjects.lens.configureDimension({ + dimension: 'lnsXY_xDimensionPanel > lns-empty-dimension', + operation: 'date_histogram', + field: '@timestamp', + }); + + await PageObjects.lens.configureDimension({ + dimension: 'lnsXY_yDimensionPanel > lns-empty-dimension', + operation: 'avg', + field: 'bytes', + }); + + await PageObjects.lens.createLayer(); + + expect(await PageObjects.lens.hasChartSwitchWarning('line')).to.eql(false); + + await PageObjects.lens.switchToVisualization('line'); + + expect(await PageObjects.lens.getLayerCount()).to.eql(2); + }); }); } diff --git a/x-pack/test/functional/page_objects/lens_page.ts b/x-pack/test/functional/page_objects/lens_page.ts index 4252c400ff1cd..d101c9754d562 100644 --- a/x-pack/test/functional/page_objects/lens_page.ts +++ b/x-pack/test/functional/page_objects/lens_page.ts @@ -167,5 +167,33 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont await testSubjects.existOrFail('visTypeTitle'); }); }, + + /** + * Checks a specific subvisualization in the chart switcher for a "data loss" indicator + * + * @param subVisualizationId - the ID of the sub-visualization to switch to, such as + * lnsDatatable or bar_stacked + */ + async hasChartSwitchWarning(subVisualizationId: string) { + await this.openChartSwitchPopover(); + + const element = await testSubjects.find(`lnsChartSwitchPopover_${subVisualizationId}`); + return await testSubjects.descendantExists('euiKeyPadMenuItem__betaBadgeWrapper', element); + }, + + /** + * Returns the number of layers visible in the chart configuration + */ + async getLayerCount() { + const elements = await testSubjects.findAll('lnsLayerRemove'); + return elements.length; + }, + + /** + * Adds a new layer to the chart, fails if the chart does not support new layers + */ + async createLayer() { + await testSubjects.click('lnsLayerAddButton'); + }, }); } From 3cef292bbd52edb94d87ec73401553e8450a8736 Mon Sep 17 00:00:00 2001 From: Quynh Nguyen <43350163+qn895@users.noreply.github.com> Date: Fri, 17 Jul 2020 13:35:25 -0500 Subject: [PATCH 35/59] [ML] Fix annotations pagination & change labels from letters to numbers (#72204) --- .../__snapshots__/annotations_table.test.js.snap | 1 + .../annotations_table/annotations_table.js | 13 ++++++++----- .../public/application/explorer/explorer_utils.js | 2 +- .../timeseriesexplorer_utils/get_focus_data.ts | 4 ++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/x-pack/plugins/ml/public/application/components/annotations/annotations_table/__snapshots__/annotations_table.test.js.snap b/x-pack/plugins/ml/public/application/components/annotations/annotations_table/__snapshots__/annotations_table.test.js.snap index 63ec1744b62d0..9eb44c71aa799 100644 --- a/x-pack/plugins/ml/public/application/components/annotations/annotations_table/__snapshots__/annotations_table.test.js.snap +++ b/x-pack/plugins/ml/public/application/components/annotations/annotations_table/__snapshots__/annotations_table.test.js.snap @@ -77,6 +77,7 @@ exports[`AnnotationsTable Initialization with annotations prop. 1`] = ` "dataType": "boolean", "field": "current_series", "name": "current_series", + "render": [Function], "width": "0px", }, ] diff --git a/x-pack/plugins/ml/public/application/components/annotations/annotations_table/annotations_table.js b/x-pack/plugins/ml/public/application/components/annotations/annotations_table/annotations_table.js index cf4d25f159a1a..86398a57c3a45 100644 --- a/x-pack/plugins/ml/public/application/components/annotations/annotations_table/annotations_table.js +++ b/x-pack/plugins/ml/public/application/components/annotations/annotations_table/annotations_table.js @@ -13,7 +13,7 @@ import _ from 'lodash'; import PropTypes from 'prop-types'; import rison from 'rison-node'; import React, { Component, Fragment } from 'react'; - +import memoizeOne from 'memoize-one'; import { EuiBadge, EuiButtonIcon, @@ -130,7 +130,7 @@ export class AnnotationsTable extends Component { } } - getAnnotationsWithExtraInfo(annotations) { + getAnnotationsWithExtraInfo = memoizeOne((annotations) => { // if there is a specific view/chart entities that the annotations can be scoped to // add a new column called 'current_series' if (Array.isArray(this.props.chartDetails?.entityData?.entities)) { @@ -147,7 +147,7 @@ export class AnnotationsTable extends Component { // if not make it return the original annotations return annotations; } - } + }); getJob(jobId) { // check if the job was supplied via props and matches the supplied jobId @@ -438,7 +438,7 @@ export class AnnotationsTable extends Component { name: i18n.translate('xpack.ml.annotationsTable.labelColumnName', { defaultMessage: 'Label', }), - sortable: true, + sortable: (key) => +key, width: '60px', render: (key) => { return {key}; @@ -644,15 +644,18 @@ export class AnnotationsTable extends Component { name: CURRENT_SERIES, dataType: 'boolean', width: '0px', + render: () => '', } ); + + const items = this.getAnnotationsWithExtraInfo(annotations); return ( { - d.key = String.fromCharCode(65 + i); + d.key = (i + 1).toString(); return d; }), aggregations: resp.aggregations, diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer_utils/get_focus_data.ts b/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer_utils/get_focus_data.ts index 8bac9a51af174..d213d371f1d90 100644 --- a/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer_utils/get_focus_data.ts +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer_utils/get_focus_data.ts @@ -156,8 +156,8 @@ export function getFocusData( .sort((a, b) => { return a.timestamp - b.timestamp; }) - .map((d, i) => { - d.key = String.fromCharCode(65 + i); + .map((d, i: number) => { + d.key = (i + 1).toString(); return d; }); From 4c58018d337330348b858d32cc01834e3e722c43 Mon Sep 17 00:00:00 2001 From: Brian Seeders Date: Fri, 17 Jul 2020 16:27:25 -0400 Subject: [PATCH 36/59] skip flaky suite (#72339) --- .../cypress/integration/timeline_local_storage.spec.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/security_solution/cypress/integration/timeline_local_storage.spec.ts b/x-pack/plugins/security_solution/cypress/integration/timeline_local_storage.spec.ts index 383ebe2220585..7c047459c56cc 100644 --- a/x-pack/plugins/security_solution/cypress/integration/timeline_local_storage.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/timeline_local_storage.spec.ts @@ -13,7 +13,8 @@ import { TABLE_COLUMN_EVENTS_MESSAGE } from '../screens/hosts/external_events'; import { waitsForEventsToBeLoaded, openEventsViewerFieldsBrowser } from '../tasks/hosts/events'; import { removeColumn, resetFields } from '../tasks/timeline'; -describe('persistent timeline', () => { +// Failing: See https://github.com/elastic/kibana/issues/72339 +describe.skip('persistent timeline', () => { before(() => { loginAndWaitForPage(HOSTS_URL); openEvents(); From 5356941f22ccfb358f4cffab6a20bfb5a1bc9cff Mon Sep 17 00:00:00 2001 From: Madison Caldwell Date: Fri, 17 Jul 2020 16:51:28 -0400 Subject: [PATCH 37/59] [Security Solution][Endpoint][Exceptions] Only write manifest to policy when there are changes (#72000) * Refactor security_solution policy creation callback - part 1 * Fix manifest dispatch * Change how dispatches are performed * simplify manifest types * Remove unused mock * Fix tests * one place to construct artifact ids * fixing linter exceptions * Add tests for stable hashes * Additional testing and type cleanup * Remove unnecessary log * Minor fixup * jsdoc * type fixup * Additional type adjustments --- x-pack/plugins/ingest_manager/common/mocks.ts | 87 ++++++ .../common/endpoint/schema/common.ts | 5 + .../common/endpoint/schema/manifest.ts | 46 ++- .../endpoint/ingest_integration.test.ts | 105 ++++--- .../server/endpoint/ingest_integration.ts | 156 +++++----- .../server/endpoint/lib/artifacts/common.ts | 16 +- .../endpoint/lib/artifacts/lists.test.ts | 94 +++++- .../server/endpoint/lib/artifacts/lists.ts | 33 +- .../endpoint/lib/artifacts/manifest.test.ts | 158 +++++----- .../server/endpoint/lib/artifacts/manifest.ts | 97 +++++- .../lib/artifacts/manifest_entry.test.ts | 28 +- .../endpoint/lib/artifacts/manifest_entry.ts | 3 +- .../server/endpoint/lib/artifacts/mocks.ts | 68 +++++ .../server/endpoint/lib/artifacts/task.ts | 84 +++-- .../server/endpoint/mocks.ts | 25 +- .../artifacts/download_exception_list.ts | 6 +- .../endpoint/schemas/artifacts/lists.mock.ts | 4 +- .../schemas/artifacts/saved_objects.mock.ts | 54 ++-- .../schemas/artifacts/saved_objects.ts | 41 ++- .../artifacts/artifact_client.test.ts | 9 +- .../services/artifacts/artifact_client.ts | 28 +- .../artifacts/manifest_client.test.ts | 5 +- .../services/artifacts/manifest_client.ts | 9 +- .../manifest_manager/manifest_manager.mock.ts | 81 ++--- .../manifest_manager/manifest_manager.test.ts | 209 +++++++++---- .../manifest_manager/manifest_manager.ts | 286 ++++++++---------- 26 files changed, 1154 insertions(+), 583 deletions(-) create mode 100644 x-pack/plugins/security_solution/server/endpoint/lib/artifacts/mocks.ts diff --git a/x-pack/plugins/ingest_manager/common/mocks.ts b/x-pack/plugins/ingest_manager/common/mocks.ts index e85364f2bb672..236324b11c580 100644 --- a/x-pack/plugins/ingest_manager/common/mocks.ts +++ b/x-pack/plugins/ingest_manager/common/mocks.ts @@ -44,3 +44,90 @@ export const createPackageConfigMock = (): PackageConfig => { ], }; }; + +export const createPackageConfigWithInitialManifestMock = (): PackageConfig => { + const packageConfig = createPackageConfigMock(); + packageConfig.inputs[0].config!.artifact_manifest = { + value: { + artifacts: { + 'endpoint-exceptionlist-linux-v1': { + compression_algorithm: 'zlib', + encryption_algorithm: 'none', + decoded_sha256: 'd801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', + encoded_sha256: 'f8e6afa1d5662f5b37f83337af774b5785b5b7f1daee08b7b00c2d6813874cda', + decoded_size: 14, + encoded_size: 22, + relative_url: + '/api/endpoint/artifacts/download/endpoint-exceptionlist-linux-v1/d801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', + }, + 'endpoint-exceptionlist-macos-v1': { + compression_algorithm: 'zlib', + encryption_algorithm: 'none', + decoded_sha256: 'd801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', + encoded_sha256: 'f8e6afa1d5662f5b37f83337af774b5785b5b7f1daee08b7b00c2d6813874cda', + decoded_size: 14, + encoded_size: 22, + relative_url: + '/api/endpoint/artifacts/download/endpoint-exceptionlist-macos-v1/d801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', + }, + 'endpoint-exceptionlist-windows-v1': { + compression_algorithm: 'zlib', + encryption_algorithm: 'none', + decoded_sha256: 'd801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', + encoded_sha256: 'f8e6afa1d5662f5b37f83337af774b5785b5b7f1daee08b7b00c2d6813874cda', + decoded_size: 14, + encoded_size: 22, + relative_url: + '/api/endpoint/artifacts/download/endpoint-exceptionlist-windows-v1/d801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', + }, + }, + manifest_version: 'a9b7ef358a363f327f479e31efc4f228b2277a7fb4d1914ca9b4e7ca9ffcf537', + schema_version: 'v1', + }, + }; + return packageConfig; +}; + +export const createPackageConfigWithManifestMock = (): PackageConfig => { + const packageConfig = createPackageConfigMock(); + packageConfig.inputs[0].config!.artifact_manifest = { + value: { + artifacts: { + 'endpoint-exceptionlist-linux-v1': { + compression_algorithm: 'zlib', + encryption_algorithm: 'none', + decoded_sha256: '0a5a2013a79f9e60682472284a1be45ab1ff68b9b43426d00d665016612c15c8', + encoded_sha256: '57941169bb2c5416f9bd7224776c8462cb9a2be0fe8b87e6213e77a1d29be824', + decoded_size: 292, + encoded_size: 131, + relative_url: + '/api/endpoint/artifacts/download/endpoint-exceptionlist-linux-v1/0a5a2013a79f9e60682472284a1be45ab1ff68b9b43426d00d665016612c15c8', + }, + 'endpoint-exceptionlist-macos-v1': { + compression_algorithm: 'zlib', + encryption_algorithm: 'none', + decoded_sha256: '96b76a1a911662053a1562ac14c4ff1e87c2ff550d6fe52e1e0b3790526597d3', + encoded_sha256: '975382ab55d019cbab0bbac207a54e2a7d489fad6e8f6de34fc6402e5ef37b1e', + decoded_size: 432, + encoded_size: 147, + relative_url: + '/api/endpoint/artifacts/download/endpoint-exceptionlist-macos-v1/96b76a1a911662053a1562ac14c4ff1e87c2ff550d6fe52e1e0b3790526597d3', + }, + 'endpoint-exceptionlist-windows-v1': { + compression_algorithm: 'zlib', + encryption_algorithm: 'none', + decoded_sha256: '96b76a1a911662053a1562ac14c4ff1e87c2ff550d6fe52e1e0b3790526597d3', + encoded_sha256: '975382ab55d019cbab0bbac207a54e2a7d489fad6e8f6de34fc6402e5ef37b1e', + decoded_size: 432, + encoded_size: 147, + relative_url: + '/api/endpoint/artifacts/download/endpoint-exceptionlist-windows-v1/96b76a1a911662053a1562ac14c4ff1e87c2ff550d6fe52e1e0b3790526597d3', + }, + }, + manifest_version: '520f6cf88b3f36a065c6ca81058d5f8690aadadf6fe857f8dec4cc37589e7283', + schema_version: 'v1', + }, + }; + + return packageConfig; +}; diff --git a/x-pack/plugins/security_solution/common/endpoint/schema/common.ts b/x-pack/plugins/security_solution/common/endpoint/schema/common.ts index 014673ebe6398..8f2ea1f8a6452 100644 --- a/x-pack/plugins/security_solution/common/endpoint/schema/common.ts +++ b/x-pack/plugins/security_solution/common/endpoint/schema/common.ts @@ -12,6 +12,11 @@ export const compressionAlgorithm = t.keyof({ }); export type CompressionAlgorithm = t.TypeOf; +export const compressionAlgorithmDispatch = t.keyof({ + zlib: null, +}); +export type CompressionAlgorithmDispatch = t.TypeOf; + export const encryptionAlgorithm = t.keyof({ none: null, }); diff --git a/x-pack/plugins/security_solution/common/endpoint/schema/manifest.ts b/x-pack/plugins/security_solution/common/endpoint/schema/manifest.ts index 1c8916dfdd5bb..f8bb8b70f2d5b 100644 --- a/x-pack/plugins/security_solution/common/endpoint/schema/manifest.ts +++ b/x-pack/plugins/security_solution/common/endpoint/schema/manifest.ts @@ -7,6 +7,7 @@ import * as t from 'io-ts'; import { compressionAlgorithm, + compressionAlgorithmDispatch, encryptionAlgorithm, identifier, manifestSchemaVersion, @@ -16,25 +17,60 @@ import { size, } from './common'; -export const manifestEntrySchema = t.exact( +export const manifestEntryBaseSchema = t.exact( t.type({ relative_url: relativeUrl, decoded_sha256: sha256, decoded_size: size, encoded_sha256: sha256, encoded_size: size, - compression_algorithm: compressionAlgorithm, encryption_algorithm: encryptionAlgorithm, }) ); -export const manifestSchema = t.exact( +export const manifestEntrySchema = t.intersection([ + manifestEntryBaseSchema, + t.exact( + t.type({ + compression_algorithm: compressionAlgorithm, + }) + ), +]); +export type ManifestEntrySchema = t.TypeOf; + +export const manifestEntryDispatchSchema = t.intersection([ + manifestEntryBaseSchema, + t.exact( + t.type({ + compression_algorithm: compressionAlgorithmDispatch, + }) + ), +]); +export type ManifestEntryDispatchSchema = t.TypeOf; + +export const manifestBaseSchema = t.exact( t.type({ manifest_version: manifestVersion, schema_version: manifestSchemaVersion, - artifacts: t.record(identifier, manifestEntrySchema), }) ); -export type ManifestEntrySchema = t.TypeOf; +export const manifestSchema = t.intersection([ + manifestBaseSchema, + t.exact( + t.type({ + artifacts: t.record(identifier, manifestEntrySchema), + }) + ), +]); export type ManifestSchema = t.TypeOf; + +export const manifestDispatchSchema = t.intersection([ + manifestBaseSchema, + t.exact( + t.type({ + artifacts: t.record(identifier, manifestEntryDispatchSchema), + }) + ), +]); +export type ManifestDispatchSchema = t.TypeOf; diff --git a/x-pack/plugins/security_solution/server/endpoint/ingest_integration.test.ts b/x-pack/plugins/security_solution/server/endpoint/ingest_integration.test.ts index bb035a19f33d6..be749b2ebd25a 100644 --- a/x-pack/plugins/security_solution/server/endpoint/ingest_integration.test.ts +++ b/x-pack/plugins/security_solution/server/endpoint/ingest_integration.test.ts @@ -4,87 +4,122 @@ * you may not use this file except in compliance with the Elastic License. */ -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { loggerMock } from 'src/core/server/logging/logger.mock'; +import { loggingSystemMock } from 'src/core/server/mocks'; import { createNewPackageConfigMock } from '../../../ingest_manager/common/mocks'; import { factory as policyConfigFactory } from '../../common/endpoint/models/policy_config'; -import { getManifestManagerMock } from './services/artifacts/manifest_manager/manifest_manager.mock'; +import { + getManifestManagerMock, + ManifestManagerMockType, +} from './services/artifacts/manifest_manager/manifest_manager.mock'; import { getPackageConfigCreateCallback } from './ingest_integration'; +import { ManifestConstants } from './lib/artifacts'; describe('ingest_integration tests ', () => { describe('ingest_integration sanity checks', () => { - test('policy is updated with manifest', async () => { - const logger = loggerMock.create(); - const manifestManager = getManifestManagerMock(); + test('policy is updated with initial manifest', async () => { + const logger = loggingSystemMock.create().get('ingest_integration.test'); + const manifestManager = getManifestManagerMock({ + mockType: ManifestManagerMockType.InitialSystemState, + }); + const callback = getPackageConfigCreateCallback(logger, manifestManager); - const policyConfig = createNewPackageConfigMock(); - const newPolicyConfig = await callback(policyConfig); + const policyConfig = createNewPackageConfigMock(); // policy config without manifest + const newPolicyConfig = await callback(policyConfig); // policy config WITH manifest + expect(newPolicyConfig.inputs[0]!.type).toEqual('endpoint'); expect(newPolicyConfig.inputs[0]!.config!.policy.value).toEqual(policyConfigFactory()); expect(newPolicyConfig.inputs[0]!.config!.artifact_manifest.value).toEqual({ artifacts: { 'endpoint-exceptionlist-linux-v1': { compression_algorithm: 'zlib', - decoded_sha256: '1a8295e6ccb93022c6f5ceb8997b29f2912389b3b38f52a8f5a2ff7b0154b1bc', - decoded_size: 287, - encoded_sha256: 'c3dec543df1177561ab2aa74a37997ea3c1d748d532a597884f5a5c16670d56c', - encoded_size: 133, + decoded_sha256: 'd801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', + decoded_size: 14, + encoded_sha256: 'f8e6afa1d5662f5b37f83337af774b5785b5b7f1daee08b7b00c2d6813874cda', + encoded_size: 22, + encryption_algorithm: 'none', + relative_url: + '/api/endpoint/artifacts/download/endpoint-exceptionlist-linux-v1/d801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', + }, + 'endpoint-exceptionlist-macos-v1': { + compression_algorithm: 'zlib', + decoded_sha256: 'd801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', + decoded_size: 14, + encoded_sha256: 'f8e6afa1d5662f5b37f83337af774b5785b5b7f1daee08b7b00c2d6813874cda', + encoded_size: 22, + encryption_algorithm: 'none', + relative_url: + '/api/endpoint/artifacts/download/endpoint-exceptionlist-macos-v1/d801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', + }, + 'endpoint-exceptionlist-windows-v1': { + compression_algorithm: 'zlib', + decoded_sha256: 'd801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', + decoded_size: 14, + encoded_sha256: 'f8e6afa1d5662f5b37f83337af774b5785b5b7f1daee08b7b00c2d6813874cda', + encoded_size: 22, encryption_algorithm: 'none', relative_url: - '/api/endpoint/artifacts/download/endpoint-exceptionlist-linux-v1/1a8295e6ccb93022c6f5ceb8997b29f2912389b3b38f52a8f5a2ff7b0154b1bc', + '/api/endpoint/artifacts/download/endpoint-exceptionlist-windows-v1/d801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', }, }, - manifest_version: 'WzAsMF0=', + manifest_version: 'a9b7ef358a363f327f479e31efc4f228b2277a7fb4d1914ca9b4e7ca9ffcf537', schema_version: 'v1', }); }); - test('policy is returned even if error is encountered during artifact sync', async () => { - const logger = loggerMock.create(); + test('policy is returned even if error is encountered during artifact creation', async () => { + const logger = loggingSystemMock.create().get('ingest_integration.test'); const manifestManager = getManifestManagerMock(); - manifestManager.syncArtifacts = jest.fn().mockRejectedValue([new Error('error updating')]); - const lastDispatched = await manifestManager.getLastDispatchedManifest(); + manifestManager.pushArtifacts = jest.fn().mockResolvedValue([new Error('error updating')]); + const lastComputed = await manifestManager.getLastComputedManifest( + ManifestConstants.SCHEMA_VERSION + ); + const callback = getPackageConfigCreateCallback(logger, manifestManager); const policyConfig = createNewPackageConfigMock(); const newPolicyConfig = await callback(policyConfig); + expect(newPolicyConfig.inputs[0]!.type).toEqual('endpoint'); expect(newPolicyConfig.inputs[0]!.config!.policy.value).toEqual(policyConfigFactory()); expect(newPolicyConfig.inputs[0]!.config!.artifact_manifest.value).toEqual( - lastDispatched.toEndpointFormat() + lastComputed!.toEndpointFormat() ); }); - test('initial policy creation succeeds if snapshot retrieval fails', async () => { - const logger = loggerMock.create(); - const manifestManager = getManifestManagerMock(); - const lastDispatched = await manifestManager.getLastDispatchedManifest(); - manifestManager.getSnapshot = jest.fn().mockResolvedValue(null); + test('initial policy creation succeeds if manifest retrieval fails', async () => { + const logger = loggingSystemMock.create().get('ingest_integration.test'); + const manifestManager = getManifestManagerMock({ + mockType: ManifestManagerMockType.InitialSystemState, + }); + const lastComputed = await manifestManager.getLastComputedManifest( + ManifestConstants.SCHEMA_VERSION + ); + expect(lastComputed).toEqual(null); + + manifestManager.buildNewManifest = jest.fn().mockRejectedValue(new Error('abcd')); const callback = getPackageConfigCreateCallback(logger, manifestManager); const policyConfig = createNewPackageConfigMock(); const newPolicyConfig = await callback(policyConfig); + expect(newPolicyConfig.inputs[0]!.type).toEqual('endpoint'); expect(newPolicyConfig.inputs[0]!.config!.policy.value).toEqual(policyConfigFactory()); - expect(newPolicyConfig.inputs[0]!.config!.artifact_manifest.value).toEqual( - lastDispatched.toEndpointFormat() - ); }); test('subsequent policy creations succeed', async () => { - const logger = loggerMock.create(); + const logger = loggingSystemMock.create().get('ingest_integration.test'); const manifestManager = getManifestManagerMock(); - const snapshot = await manifestManager.getSnapshot(); - manifestManager.getLastDispatchedManifest = jest.fn().mockResolvedValue(snapshot!.manifest); - manifestManager.getSnapshot = jest.fn().mockResolvedValue({ - manifest: snapshot!.manifest, - diffs: [], - }); + const lastComputed = await manifestManager.getLastComputedManifest( + ManifestConstants.SCHEMA_VERSION + ); + + manifestManager.buildNewManifest = jest.fn().mockResolvedValue(lastComputed); // no diffs const callback = getPackageConfigCreateCallback(logger, manifestManager); const policyConfig = createNewPackageConfigMock(); const newPolicyConfig = await callback(policyConfig); + expect(newPolicyConfig.inputs[0]!.type).toEqual('endpoint'); expect(newPolicyConfig.inputs[0]!.config!.policy.value).toEqual(policyConfigFactory()); expect(newPolicyConfig.inputs[0]!.config!.artifact_manifest.value).toEqual( - snapshot!.manifest.toEndpointFormat() + lastComputed!.toEndpointFormat() ); }); }); diff --git a/x-pack/plugins/security_solution/server/endpoint/ingest_integration.ts b/x-pack/plugins/security_solution/server/endpoint/ingest_integration.ts index e2522ac4af778..11d4b12d0b76a 100644 --- a/x-pack/plugins/security_solution/server/endpoint/ingest_integration.ts +++ b/x-pack/plugins/security_solution/server/endpoint/ingest_integration.ts @@ -8,9 +8,63 @@ import { Logger } from '../../../../../src/core/server'; import { NewPackageConfig } from '../../../ingest_manager/common/types/models'; import { factory as policyConfigFactory } from '../../common/endpoint/models/policy_config'; import { NewPolicyData } from '../../common/endpoint/types'; -import { ManifestManager, ManifestSnapshot } from './services/artifacts'; +import { ManifestManager } from './services/artifacts'; +import { Manifest } from './lib/artifacts'; import { reportErrors, ManifestConstants } from './lib/artifacts/common'; -import { ManifestSchemaVersion } from '../../common/endpoint/schema/common'; +import { InternalArtifactCompleteSchema } from './schemas/artifacts'; +import { manifestDispatchSchema } from '../../common/endpoint/schema/manifest'; + +const getManifest = async (logger: Logger, manifestManager: ManifestManager): Promise => { + let manifest: Manifest | null = null; + + try { + manifest = await manifestManager.getLastComputedManifest(ManifestConstants.SCHEMA_VERSION); + + // If we have not yet computed a manifest, then we have to do so now. This should only happen + // once. + if (manifest == null) { + // New computed manifest based on current state of exception list + const newManifest = await manifestManager.buildNewManifest(ManifestConstants.SCHEMA_VERSION); + const diffs = newManifest.diff(Manifest.getDefault(ManifestConstants.SCHEMA_VERSION)); + + // Compress new artifacts + const adds = diffs.filter((diff) => diff.type === 'add').map((diff) => diff.id); + for (const artifactId of adds) { + const compressError = await newManifest.compressArtifact(artifactId); + if (compressError) { + throw compressError; + } + } + + // Persist new artifacts + const artifacts = adds + .map((artifactId) => newManifest.getArtifact(artifactId)) + .filter((artifact): artifact is InternalArtifactCompleteSchema => artifact !== undefined); + if (artifacts.length !== adds.length) { + throw new Error('Invalid artifact encountered.'); + } + const persistErrors = await manifestManager.pushArtifacts(artifacts); + if (persistErrors.length) { + reportErrors(logger, persistErrors); + throw new Error('Unable to persist new artifacts.'); + } + + // Commit the manifest state + if (diffs.length) { + const error = await manifestManager.commit(newManifest); + if (error) { + throw error; + } + } + + manifest = newManifest; + } + } catch (err) { + logger.error(err); + } + + return manifest ?? Manifest.getDefault(ManifestConstants.SCHEMA_VERSION); +}; /** * Callback to handle creation of PackageConfigs in Ingest Manager @@ -31,85 +85,37 @@ export const getPackageConfigCreateCallback = ( // follow the types/schema expected let updatedPackageConfig = newPackageConfig as NewPolicyData; - // get current manifest from SO (last dispatched) - const manifest = ( - await manifestManager.getLastDispatchedManifest(ManifestConstants.SCHEMA_VERSION) - )?.toEndpointFormat() ?? { - manifest_version: 'default', - schema_version: ManifestConstants.SCHEMA_VERSION as ManifestSchemaVersion, - artifacts: {}, - }; + // Get most recent manifest + const manifest = await getManifest(logger, manifestManager); + const serializedManifest = manifest.toEndpointFormat(); + if (!manifestDispatchSchema.is(serializedManifest)) { + // This should not happen. + // But if it does, we log it and return it anyway. + logger.error('Invalid manifest'); + } // Until we get the Default Policy Configuration in the Endpoint package, // we will add it here manually at creation time. - if (newPackageConfig.inputs.length === 0) { - updatedPackageConfig = { - ...newPackageConfig, - inputs: [ - { - type: 'endpoint', - enabled: true, - streams: [], - config: { - artifact_manifest: { - value: manifest, - }, - policy: { - value: policyConfigFactory(), - }, + updatedPackageConfig = { + ...newPackageConfig, + inputs: [ + { + type: 'endpoint', + enabled: true, + streams: [], + config: { + artifact_manifest: { + value: serializedManifest, + }, + policy: { + value: policyConfigFactory(), }, }, - ], - }; - } - - let snapshot: ManifestSnapshot | null = null; - let success = true; - try { - // Try to get most up-to-date manifest data. - - // get snapshot based on exception-list-agnostic SOs - // with diffs from last dispatched manifest, if it exists - snapshot = await manifestManager.getSnapshot({ initialize: true }); - - if (snapshot && snapshot.diffs.length) { - // create new artifacts - const errors = await manifestManager.syncArtifacts(snapshot, 'add'); - if (errors.length) { - reportErrors(logger, errors); - throw new Error('Error writing new artifacts.'); - } - } - - if (snapshot) { - updatedPackageConfig.inputs[0].config.artifact_manifest = { - value: snapshot.manifest.toEndpointFormat(), - }; - } - - return updatedPackageConfig; - } catch (err) { - success = false; - logger.error(err); - return updatedPackageConfig; - } finally { - if (success && snapshot !== null) { - try { - if (snapshot.diffs.length > 0) { - // TODO: let's revisit the way this callback happens... use promises? - // only commit when we know the package config was created - await manifestManager.commit(snapshot.manifest); + }, + ], + }; - // clean up old artifacts - await manifestManager.syncArtifacts(snapshot, 'delete'); - } - } catch (err) { - logger.error(err); - } - } else if (snapshot === null) { - logger.error('No manifest snapshot available.'); - } - } + return updatedPackageConfig; }; return handlePackageConfigCreate; diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/common.ts b/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/common.ts index 77a5e85b14199..7298a9bfa72a6 100644 --- a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/common.ts +++ b/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/common.ts @@ -4,6 +4,11 @@ * you may not use this file except in compliance with the Elastic License. */ import { Logger } from 'src/core/server'; +import { + InternalArtifactSchema, + InternalArtifactCompleteSchema, + internalArtifactCompleteSchema, +} from '../../schemas/artifacts'; export const ArtifactConstants = { GLOBAL_ALLOWLIST_NAME: 'endpoint-exceptionlist', @@ -15,7 +20,16 @@ export const ArtifactConstants = { export const ManifestConstants = { SAVED_OBJECT_TYPE: 'endpoint:user-artifact-manifest', SCHEMA_VERSION: 'v1', - INITIAL_VERSION: 'WzAsMF0=', +}; + +export const getArtifactId = (artifact: InternalArtifactSchema) => { + return `${artifact.identifier}-${artifact.decodedSha256}`; +}; + +export const isCompleteArtifact = ( + artifact: InternalArtifactSchema +): artifact is InternalArtifactCompleteSchema => { + return internalArtifactCompleteSchema.is(artifact); }; export const reportErrors = (logger: Logger, errors: Error[]) => { diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts b/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts index 1a19306b2fd60..d3d073efa73c1 100644 --- a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts +++ b/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts @@ -9,7 +9,8 @@ import { listMock } from '../../../../../lists/server/mocks'; import { getFoundExceptionListItemSchemaMock } from '../../../../../lists/common/schemas/response/found_exception_list_item_schema.mock'; import { getExceptionListItemSchemaMock } from '../../../../../lists/common/schemas/response/exception_list_item_schema.mock'; import { EntriesArray, EntryList } from '../../../../../lists/common/schemas/types/entries'; -import { getFullEndpointExceptionList } from './lists'; +import { buildArtifact, getFullEndpointExceptionList } from './lists'; +import { TranslatedEntry, TranslatedExceptionListItem } from '../../schemas/artifacts'; describe('buildEventTypeSignal', () => { let mockExceptionClient: ExceptionListClient; @@ -340,4 +341,95 @@ describe('buildEventTypeSignal', () => { const resp = await getFullEndpointExceptionList(mockExceptionClient, 'linux', 'v1'); expect(resp.entries.length).toEqual(0); }); + + test('it should return a stable hash regardless of order of entries', async () => { + const translatedEntries: TranslatedEntry[] = [ + { + entries: [ + { + field: 'some.nested.field', + operator: 'included', + type: 'exact_cased', + value: 'some value', + }, + ], + field: 'some.parentField', + type: 'nested', + }, + { + field: 'nested.field', + operator: 'included', + type: 'exact_cased', + value: 'some value', + }, + ]; + const translatedEntriesReversed = translatedEntries.reverse(); + + const translatedExceptionList = { + entries: [ + { + type: 'simple', + entries: translatedEntries, + }, + ], + }; + + const translatedExceptionListReversed = { + entries: [ + { + type: 'simple', + entries: translatedEntriesReversed, + }, + ], + }; + + const artifact1 = await buildArtifact(translatedExceptionList, 'linux', 'v1'); + const artifact2 = await buildArtifact(translatedExceptionListReversed, 'linux', 'v1'); + expect(artifact1.decodedSha256).toEqual(artifact2.decodedSha256); + }); + + test('it should return a stable hash regardless of order of items', async () => { + const translatedItems: TranslatedExceptionListItem[] = [ + { + type: 'simple', + entries: [ + { + entries: [ + { + field: 'some.nested.field', + operator: 'included', + type: 'exact_cased', + value: 'some value', + }, + ], + field: 'some.parentField', + type: 'nested', + }, + ], + }, + { + type: 'simple', + entries: [ + { + field: 'nested.field', + operator: 'included', + type: 'exact_cased', + value: 'some value', + }, + ], + }, + ]; + + const translatedExceptionList = { + entries: translatedItems, + }; + + const translatedExceptionListReversed = { + entries: translatedItems.reverse(), + }; + + const artifact1 = await buildArtifact(translatedExceptionList, 'linux', 'v1'); + const artifact2 = await buildArtifact(translatedExceptionListReversed, 'linux', 'v1'); + expect(artifact1.decodedSha256).toEqual(artifact2.decodedSha256); + }); }); diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts b/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts index e6fd4bad97c5f..68fa2a0511a48 100644 --- a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts +++ b/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts @@ -25,6 +25,8 @@ import { translatedEntryMatchMatcher, translatedEntryMatchAnyMatcher, TranslatedExceptionListItem, + internalArtifactCompleteSchema, + InternalArtifactCompleteSchema, } from '../../schemas'; import { ArtifactConstants } from './common'; @@ -32,7 +34,7 @@ export async function buildArtifact( exceptions: WrappedTranslatedExceptionList, os: string, schemaVersion: string -): Promise { +): Promise { const exceptionsBuffer = Buffer.from(JSON.stringify(exceptions)); const sha256 = createHash('sha256').update(exceptionsBuffer.toString()).digest('hex'); @@ -45,11 +47,32 @@ export async function buildArtifact( encodedSha256: sha256, decodedSize: exceptionsBuffer.byteLength, encodedSize: exceptionsBuffer.byteLength, - created: Date.now(), body: exceptionsBuffer.toString('base64'), }; } +export async function maybeCompressArtifact( + uncompressedArtifact: InternalArtifactSchema +): Promise { + const compressedArtifact = { ...uncompressedArtifact }; + if (internalArtifactCompleteSchema.is(uncompressedArtifact)) { + const compressedExceptionList = await compressExceptionList( + Buffer.from(uncompressedArtifact.body, 'base64') + ); + compressedArtifact.body = compressedExceptionList.toString('base64'); + compressedArtifact.encodedSize = compressedExceptionList.byteLength; + compressedArtifact.compressionAlgorithm = 'zlib'; + compressedArtifact.encodedSha256 = createHash('sha256') + .update(compressedExceptionList) + .digest('hex'); + } + return compressedArtifact; +} + +export function isCompressed(artifact: InternalArtifactSchema) { + return artifact.compressionAlgorithm === 'zlib'; +} + export async function getFullEndpointExceptionList( eClient: ExceptionListClient, os: string, @@ -136,7 +159,7 @@ function translateItem( const itemSet = new Set(); return { type: item.type, - entries: item.entries.reduce((translatedEntries: TranslatedEntry[], entry) => { + entries: item.entries.reduce((translatedEntries, entry) => { const translatedEntry = translateEntry(schemaVersion, entry); if (translatedEntry !== undefined && translatedEntryType.is(translatedEntry)) { const itemHash = createHash('sha256').update(JSON.stringify(translatedEntry)).digest('hex'); @@ -156,8 +179,8 @@ function translateEntry( ): TranslatedEntry | undefined { switch (entry.type) { case 'nested': { - const nestedEntries = entry.entries.reduce( - (entries: TranslatedEntryNestedEntry[], nestedEntry) => { + const nestedEntries = entry.entries.reduce( + (entries, nestedEntry) => { const translatedEntry = translateEntry(schemaVersion, nestedEntry); if (nestedEntry !== undefined && translatedEntryNestedEntry.is(translatedEntry)) { entries.push(translatedEntry); diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/manifest.test.ts b/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/manifest.test.ts index e1f6bac2620ea..95587c6fc105d 100644 --- a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/manifest.test.ts +++ b/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/manifest.test.ts @@ -5,103 +5,125 @@ */ import { ManifestSchemaVersion } from '../../../../common/endpoint/schema/common'; -import { InternalArtifactSchema } from '../../schemas'; -import { - getInternalArtifactMock, - getInternalArtifactMockWithDiffs, -} from '../../schemas/artifacts/saved_objects.mock'; -import { ManifestConstants } from './common'; +import { InternalArtifactCompleteSchema } from '../../schemas'; +import { ManifestConstants, getArtifactId } from './common'; import { Manifest } from './manifest'; +import { + getMockArtifacts, + getMockManifest, + getMockManifestWithDiffs, + getEmptyMockManifest, +} from './mocks'; describe('manifest', () => { describe('Manifest object sanity checks', () => { - const artifacts: InternalArtifactSchema[] = []; - const now = new Date(); + let artifacts: InternalArtifactCompleteSchema[] = []; let manifest1: Manifest; let manifest2: Manifest; + let emptyManifest: Manifest; beforeAll(async () => { - const artifactLinux = await getInternalArtifactMock('linux', 'v1'); - const artifactMacos = await getInternalArtifactMock('macos', 'v1'); - const artifactWindows = await getInternalArtifactMock('windows', 'v1'); - artifacts.push(artifactLinux); - artifacts.push(artifactMacos); - artifacts.push(artifactWindows); - - manifest1 = new Manifest(now, 'v1', ManifestConstants.INITIAL_VERSION); - manifest1.addEntry(artifactLinux); - manifest1.addEntry(artifactMacos); - manifest1.addEntry(artifactWindows); - manifest1.setVersion('abcd'); - - const newArtifactLinux = await getInternalArtifactMockWithDiffs('linux', 'v1'); - manifest2 = new Manifest(new Date(), 'v1', ManifestConstants.INITIAL_VERSION); - manifest2.addEntry(newArtifactLinux); - manifest2.addEntry(artifactMacos); - manifest2.addEntry(artifactWindows); + artifacts = await getMockArtifacts({ compress: true }); + manifest1 = await getMockManifest({ compress: true }); + manifest2 = await getMockManifestWithDiffs({ compress: true }); + emptyManifest = await getEmptyMockManifest({ compress: true }); }); test('Can create manifest with valid schema version', () => { - const manifest = new Manifest(new Date(), 'v1', ManifestConstants.INITIAL_VERSION); + const manifest = new Manifest('v1'); expect(manifest).toBeInstanceOf(Manifest); }); test('Cannot create manifest with invalid schema version', () => { expect(() => { - new Manifest( - new Date(), - 'abcd' as ManifestSchemaVersion, - ManifestConstants.INITIAL_VERSION - ); + new Manifest('abcd' as ManifestSchemaVersion); }).toThrow(); }); + test('Empty manifest transforms correctly to expected endpoint format', async () => { + expect(emptyManifest.toEndpointFormat()).toStrictEqual({ + artifacts: { + 'endpoint-exceptionlist-linux-v1': { + compression_algorithm: 'zlib', + encryption_algorithm: 'none', + decoded_sha256: 'd801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', + encoded_sha256: 'f8e6afa1d5662f5b37f83337af774b5785b5b7f1daee08b7b00c2d6813874cda', + decoded_size: 14, + encoded_size: 22, + relative_url: + '/api/endpoint/artifacts/download/endpoint-exceptionlist-linux-v1/d801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', + }, + 'endpoint-exceptionlist-macos-v1': { + compression_algorithm: 'zlib', + encryption_algorithm: 'none', + decoded_sha256: 'd801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', + encoded_sha256: 'f8e6afa1d5662f5b37f83337af774b5785b5b7f1daee08b7b00c2d6813874cda', + decoded_size: 14, + encoded_size: 22, + relative_url: + '/api/endpoint/artifacts/download/endpoint-exceptionlist-macos-v1/d801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', + }, + 'endpoint-exceptionlist-windows-v1': { + compression_algorithm: 'zlib', + encryption_algorithm: 'none', + decoded_sha256: 'd801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', + encoded_sha256: 'f8e6afa1d5662f5b37f83337af774b5785b5b7f1daee08b7b00c2d6813874cda', + decoded_size: 14, + encoded_size: 22, + relative_url: + '/api/endpoint/artifacts/download/endpoint-exceptionlist-windows-v1/d801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', + }, + }, + manifest_version: 'a9b7ef358a363f327f479e31efc4f228b2277a7fb4d1914ca9b4e7ca9ffcf537', + schema_version: 'v1', + }); + }); + test('Manifest transforms correctly to expected endpoint format', async () => { expect(manifest1.toEndpointFormat()).toStrictEqual({ artifacts: { 'endpoint-exceptionlist-linux-v1': { - compression_algorithm: 'none', + compression_algorithm: 'zlib', encryption_algorithm: 'none', - decoded_sha256: '5f16e5e338c53e77cfa945c17c11b175c3967bf109aa87131de41fb93b149735', - encoded_sha256: '5f16e5e338c53e77cfa945c17c11b175c3967bf109aa87131de41fb93b149735', - decoded_size: 430, - encoded_size: 430, + decoded_sha256: '96b76a1a911662053a1562ac14c4ff1e87c2ff550d6fe52e1e0b3790526597d3', + encoded_sha256: '975382ab55d019cbab0bbac207a54e2a7d489fad6e8f6de34fc6402e5ef37b1e', + decoded_size: 432, + encoded_size: 147, relative_url: - '/api/endpoint/artifacts/download/endpoint-exceptionlist-linux-v1/5f16e5e338c53e77cfa945c17c11b175c3967bf109aa87131de41fb93b149735', + '/api/endpoint/artifacts/download/endpoint-exceptionlist-linux-v1/96b76a1a911662053a1562ac14c4ff1e87c2ff550d6fe52e1e0b3790526597d3', }, 'endpoint-exceptionlist-macos-v1': { - compression_algorithm: 'none', + compression_algorithm: 'zlib', encryption_algorithm: 'none', - decoded_sha256: '5f16e5e338c53e77cfa945c17c11b175c3967bf109aa87131de41fb93b149735', - encoded_sha256: '5f16e5e338c53e77cfa945c17c11b175c3967bf109aa87131de41fb93b149735', - decoded_size: 430, - encoded_size: 430, + decoded_sha256: '96b76a1a911662053a1562ac14c4ff1e87c2ff550d6fe52e1e0b3790526597d3', + encoded_sha256: '975382ab55d019cbab0bbac207a54e2a7d489fad6e8f6de34fc6402e5ef37b1e', + decoded_size: 432, + encoded_size: 147, relative_url: - '/api/endpoint/artifacts/download/endpoint-exceptionlist-macos-v1/5f16e5e338c53e77cfa945c17c11b175c3967bf109aa87131de41fb93b149735', + '/api/endpoint/artifacts/download/endpoint-exceptionlist-macos-v1/96b76a1a911662053a1562ac14c4ff1e87c2ff550d6fe52e1e0b3790526597d3', }, 'endpoint-exceptionlist-windows-v1': { - compression_algorithm: 'none', + compression_algorithm: 'zlib', encryption_algorithm: 'none', - decoded_sha256: '5f16e5e338c53e77cfa945c17c11b175c3967bf109aa87131de41fb93b149735', - encoded_sha256: '5f16e5e338c53e77cfa945c17c11b175c3967bf109aa87131de41fb93b149735', - decoded_size: 430, - encoded_size: 430, + decoded_sha256: '96b76a1a911662053a1562ac14c4ff1e87c2ff550d6fe52e1e0b3790526597d3', + encoded_sha256: '975382ab55d019cbab0bbac207a54e2a7d489fad6e8f6de34fc6402e5ef37b1e', + decoded_size: 432, + encoded_size: 147, relative_url: - '/api/endpoint/artifacts/download/endpoint-exceptionlist-windows-v1/5f16e5e338c53e77cfa945c17c11b175c3967bf109aa87131de41fb93b149735', + '/api/endpoint/artifacts/download/endpoint-exceptionlist-windows-v1/96b76a1a911662053a1562ac14c4ff1e87c2ff550d6fe52e1e0b3790526597d3', }, }, - manifest_version: 'abcd', + manifest_version: 'a7f4760bfa2662e85e30fe4fb8c01b4c4a20938c76ab21d3c5a3e781e547cce7', schema_version: 'v1', }); }); test('Manifest transforms correctly to expected saved object format', async () => { expect(manifest1.toSavedObject()).toStrictEqual({ - created: now.getTime(), ids: [ - 'endpoint-exceptionlist-linux-v1-5f16e5e338c53e77cfa945c17c11b175c3967bf109aa87131de41fb93b149735', - 'endpoint-exceptionlist-macos-v1-5f16e5e338c53e77cfa945c17c11b175c3967bf109aa87131de41fb93b149735', - 'endpoint-exceptionlist-windows-v1-5f16e5e338c53e77cfa945c17c11b175c3967bf109aa87131de41fb93b149735', + 'endpoint-exceptionlist-linux-v1-96b76a1a911662053a1562ac14c4ff1e87c2ff550d6fe52e1e0b3790526597d3', + 'endpoint-exceptionlist-macos-v1-96b76a1a911662053a1562ac14c4ff1e87c2ff550d6fe52e1e0b3790526597d3', + 'endpoint-exceptionlist-windows-v1-96b76a1a911662053a1562ac14c4ff1e87c2ff550d6fe52e1e0b3790526597d3', ], }); }); @@ -111,12 +133,12 @@ describe('manifest', () => { expect(diffs).toEqual([ { id: - 'endpoint-exceptionlist-linux-v1-5f16e5e338c53e77cfa945c17c11b175c3967bf109aa87131de41fb93b149735', + 'endpoint-exceptionlist-linux-v1-96b76a1a911662053a1562ac14c4ff1e87c2ff550d6fe52e1e0b3790526597d3', type: 'delete', }, { id: - 'endpoint-exceptionlist-linux-v1-3d3546e94f70493021ee845be32c66e36ea7a720c64b4d608d8029fe949f7e51', + 'endpoint-exceptionlist-linux-v1-0a5a2013a79f9e60682472284a1be45ab1ff68b9b43426d00d665016612c15c8', type: 'add', }, ]); @@ -124,7 +146,7 @@ describe('manifest', () => { test('Manifest returns data for given artifact', async () => { const artifact = artifacts[0]; - const returned = manifest1.getArtifact(`${artifact.identifier}-${artifact.decodedSha256}`); + const returned = manifest1.getArtifact(getArtifactId(artifact)); expect(returned).toEqual(artifact); }); @@ -132,39 +154,35 @@ describe('manifest', () => { const entries = manifest1.getEntries(); const keys = Object.keys(entries); expect(keys).toEqual([ - 'endpoint-exceptionlist-linux-v1-5f16e5e338c53e77cfa945c17c11b175c3967bf109aa87131de41fb93b149735', - 'endpoint-exceptionlist-macos-v1-5f16e5e338c53e77cfa945c17c11b175c3967bf109aa87131de41fb93b149735', - 'endpoint-exceptionlist-windows-v1-5f16e5e338c53e77cfa945c17c11b175c3967bf109aa87131de41fb93b149735', + 'endpoint-exceptionlist-linux-v1-96b76a1a911662053a1562ac14c4ff1e87c2ff550d6fe52e1e0b3790526597d3', + 'endpoint-exceptionlist-macos-v1-96b76a1a911662053a1562ac14c4ff1e87c2ff550d6fe52e1e0b3790526597d3', + 'endpoint-exceptionlist-windows-v1-96b76a1a911662053a1562ac14c4ff1e87c2ff550d6fe52e1e0b3790526597d3', ]); }); test('Manifest returns true if contains artifact', async () => { const found = manifest1.contains( - 'endpoint-exceptionlist-macos-v1-5f16e5e338c53e77cfa945c17c11b175c3967bf109aa87131de41fb93b149735' + 'endpoint-exceptionlist-macos-v1-96b76a1a911662053a1562ac14c4ff1e87c2ff550d6fe52e1e0b3790526597d3' ); expect(found).toEqual(true); }); test('Manifest can be created from list of artifacts', async () => { - const oldManifest = new Manifest( - new Date(), - ManifestConstants.SCHEMA_VERSION, - ManifestConstants.INITIAL_VERSION - ); + const oldManifest = new Manifest(ManifestConstants.SCHEMA_VERSION); const manifest = Manifest.fromArtifacts(artifacts, 'v1', oldManifest); expect( manifest.contains( - 'endpoint-exceptionlist-linux-v1-5f16e5e338c53e77cfa945c17c11b175c3967bf109aa87131de41fb93b149735' + 'endpoint-exceptionlist-linux-v1-96b76a1a911662053a1562ac14c4ff1e87c2ff550d6fe52e1e0b3790526597d3' ) ).toEqual(true); expect( manifest.contains( - 'endpoint-exceptionlist-macos-v1-5f16e5e338c53e77cfa945c17c11b175c3967bf109aa87131de41fb93b149735' + 'endpoint-exceptionlist-macos-v1-96b76a1a911662053a1562ac14c4ff1e87c2ff550d6fe52e1e0b3790526597d3' ) ).toEqual(true); expect( manifest.contains( - 'endpoint-exceptionlist-windows-v1-5f16e5e338c53e77cfa945c17c11b175c3967bf109aa87131de41fb93b149735' + 'endpoint-exceptionlist-windows-v1-96b76a1a911662053a1562ac14c4ff1e87c2ff550d6fe52e1e0b3790526597d3' ) ).toEqual(true); }); diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/manifest.ts b/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/manifest.ts index 576ecb08d6923..6ece2bf0f48e8 100644 --- a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/manifest.ts +++ b/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/manifest.ts @@ -4,15 +4,22 @@ * you may not use this file except in compliance with the Elastic License. */ +import { createHash } from 'crypto'; import { validate } from '../../../../common/validate'; -import { InternalArtifactSchema, InternalManifestSchema } from '../../schemas/artifacts'; +import { + InternalArtifactSchema, + InternalManifestSchema, + internalArtifactCompleteSchema, + InternalArtifactCompleteSchema, +} from '../../schemas/artifacts'; import { manifestSchemaVersion, ManifestSchemaVersion, } from '../../../../common/endpoint/schema/common'; import { ManifestSchema, manifestSchema } from '../../../../common/endpoint/schema/manifest'; -import { ManifestConstants } from './common'; import { ManifestEntry } from './manifest_entry'; +import { maybeCompressArtifact, isCompressed } from './lists'; +import { getArtifactId } from './common'; export interface ManifestDiff { type: string; @@ -20,15 +27,13 @@ export interface ManifestDiff { } export class Manifest { - private created: Date; private entries: Record; private schemaVersion: ManifestSchemaVersion; // For concurrency control - private version: string; + private version: string | undefined; - constructor(created: Date, schemaVersion: string, version: string) { - this.created = created; + constructor(schemaVersion: string, version?: string) { this.entries = {}; this.version = version; @@ -38,20 +43,24 @@ export class Manifest { ); if (errors != null || validated === null) { - throw new Error(`Invalid manifest version: ${schemaVersion}`); + throw new Error(`Invalid manifest schema version: ${schemaVersion}`); } this.schemaVersion = validated; } + public static getDefault(schemaVersion: string) { + return new Manifest(schemaVersion); + } + public static fromArtifacts( - artifacts: InternalArtifactSchema[], + artifacts: InternalArtifactCompleteSchema[], schemaVersion: string, oldManifest: Manifest ): Manifest { - const manifest = new Manifest(new Date(), schemaVersion, oldManifest.getVersion()); + const manifest = new Manifest(schemaVersion, oldManifest.getSoVersion()); artifacts.forEach((artifact) => { - const id = `${artifact.identifier}-${artifact.decodedSha256}`; + const id = getArtifactId(artifact); const existingArtifact = oldManifest.getArtifact(id); if (existingArtifact) { manifest.addEntry(existingArtifact); @@ -62,15 +71,70 @@ export class Manifest { return manifest; } + public static fromPkgConfig(manifestPkgConfig: ManifestSchema): Manifest | null { + if (manifestSchema.is(manifestPkgConfig)) { + const manifest = new Manifest(manifestPkgConfig.schema_version); + for (const [identifier, artifactRecord] of Object.entries(manifestPkgConfig.artifacts)) { + const artifact = { + identifier, + compressionAlgorithm: artifactRecord.compression_algorithm, + encryptionAlgorithm: artifactRecord.encryption_algorithm, + decodedSha256: artifactRecord.decoded_sha256, + decodedSize: artifactRecord.decoded_size, + encodedSha256: artifactRecord.encoded_sha256, + encodedSize: artifactRecord.encoded_size, + }; + manifest.addEntry(artifact); + } + return manifest; + } else { + return null; + } + } + + public async compressArtifact(id: string): Promise { + try { + const artifact = this.getArtifact(id); + if (artifact == null) { + throw new Error(`Corrupted manifest detected. Artifact ${id} not in manifest.`); + } + + const compressedArtifact = await maybeCompressArtifact(artifact); + if (!isCompressed(compressedArtifact)) { + throw new Error(`Unable to compress artifact: ${id}`); + } else if (!internalArtifactCompleteSchema.is(compressedArtifact)) { + throw new Error(`Incomplete artifact detected: ${id}`); + } + this.addEntry(compressedArtifact); + } catch (err) { + return err; + } + return null; + } + + public equals(manifest: Manifest): boolean { + return this.getSha256() === manifest.getSha256(); + } + + public getSha256(): string { + let sha256 = createHash('sha256'); + Object.keys(this.entries) + .sort() + .forEach((docId) => { + sha256 = sha256.update(docId); + }); + return sha256.digest('hex'); + } + public getSchemaVersion(): ManifestSchemaVersion { return this.schemaVersion; } - public getVersion(): string { + public getSoVersion(): string | undefined { return this.version; } - public setVersion(version: string) { + public setSoVersion(version: string) { this.version = version; } @@ -87,8 +151,12 @@ export class Manifest { return this.entries; } + public getEntry(artifactId: string): ManifestEntry | undefined { + return this.entries[artifactId]; + } + public getArtifact(artifactId: string): InternalArtifactSchema | undefined { - return this.entries[artifactId]?.getArtifact(); + return this.getEntry(artifactId)?.getArtifact(); } public diff(manifest: Manifest): ManifestDiff[] { @@ -111,7 +179,7 @@ export class Manifest { public toEndpointFormat(): ManifestSchema { const manifestObj: ManifestSchema = { - manifest_version: this.version ?? ManifestConstants.INITIAL_VERSION, + manifest_version: this.getSha256(), schema_version: this.schemaVersion, artifacts: {}, }; @@ -130,7 +198,6 @@ export class Manifest { public toSavedObject(): InternalManifestSchema { return { - created: this.created.getTime(), ids: Object.keys(this.entries), }; } diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/manifest_entry.test.ts b/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/manifest_entry.test.ts index 7ea2a07210c55..d7bd57547de0a 100644 --- a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/manifest_entry.test.ts +++ b/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/manifest_entry.test.ts @@ -14,7 +14,7 @@ describe('manifest_entry', () => { let manifestEntry: ManifestEntry; beforeAll(async () => { - artifact = await getInternalArtifactMock('windows', 'v1'); + artifact = await getInternalArtifactMock('windows', 'v1', { compress: true }); manifestEntry = new ManifestEntry(artifact); }); @@ -24,7 +24,7 @@ describe('manifest_entry', () => { test('Correct doc_id is returned', () => { expect(manifestEntry.getDocId()).toEqual( - 'endpoint-exceptionlist-windows-v1-5f16e5e338c53e77cfa945c17c11b175c3967bf109aa87131de41fb93b149735' + 'endpoint-exceptionlist-windows-v1-96b76a1a911662053a1562ac14c4ff1e87c2ff550d6fe52e1e0b3790526597d3' ); }); @@ -34,21 +34,21 @@ describe('manifest_entry', () => { test('Correct sha256 is returned', () => { expect(manifestEntry.getEncodedSha256()).toEqual( - '5f16e5e338c53e77cfa945c17c11b175c3967bf109aa87131de41fb93b149735' + '975382ab55d019cbab0bbac207a54e2a7d489fad6e8f6de34fc6402e5ef37b1e' ); expect(manifestEntry.getDecodedSha256()).toEqual( - '5f16e5e338c53e77cfa945c17c11b175c3967bf109aa87131de41fb93b149735' + '96b76a1a911662053a1562ac14c4ff1e87c2ff550d6fe52e1e0b3790526597d3' ); }); test('Correct size is returned', () => { - expect(manifestEntry.getEncodedSize()).toEqual(430); - expect(manifestEntry.getDecodedSize()).toEqual(430); + expect(manifestEntry.getEncodedSize()).toEqual(147); + expect(manifestEntry.getDecodedSize()).toEqual(432); }); test('Correct url is returned', () => { expect(manifestEntry.getUrl()).toEqual( - '/api/endpoint/artifacts/download/endpoint-exceptionlist-windows-v1/5f16e5e338c53e77cfa945c17c11b175c3967bf109aa87131de41fb93b149735' + '/api/endpoint/artifacts/download/endpoint-exceptionlist-windows-v1/96b76a1a911662053a1562ac14c4ff1e87c2ff550d6fe52e1e0b3790526597d3' ); }); @@ -58,17 +58,15 @@ describe('manifest_entry', () => { test('Correct record is returned', () => { expect(manifestEntry.getRecord()).toEqual({ - compression_algorithm: 'none', + compression_algorithm: 'zlib', encryption_algorithm: 'none', - decoded_sha256: '5f16e5e338c53e77cfa945c17c11b175c3967bf109aa87131de41fb93b149735', - encoded_sha256: '5f16e5e338c53e77cfa945c17c11b175c3967bf109aa87131de41fb93b149735', - decoded_size: 430, - encoded_size: 430, + decoded_sha256: '96b76a1a911662053a1562ac14c4ff1e87c2ff550d6fe52e1e0b3790526597d3', + encoded_sha256: '975382ab55d019cbab0bbac207a54e2a7d489fad6e8f6de34fc6402e5ef37b1e', + decoded_size: 432, + encoded_size: 147, relative_url: - '/api/endpoint/artifacts/download/endpoint-exceptionlist-windows-v1/5f16e5e338c53e77cfa945c17c11b175c3967bf109aa87131de41fb93b149735', + '/api/endpoint/artifacts/download/endpoint-exceptionlist-windows-v1/96b76a1a911662053a1562ac14c4ff1e87c2ff550d6fe52e1e0b3790526597d3', }); }); - - // TODO: add test for entry with compression }); }); diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/manifest_entry.ts b/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/manifest_entry.ts index b35e0c2b9ad6e..b6c103e24f024 100644 --- a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/manifest_entry.ts +++ b/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/manifest_entry.ts @@ -7,6 +7,7 @@ import { InternalArtifactSchema } from '../../schemas/artifacts'; import { CompressionAlgorithm } from '../../../../common/endpoint/schema/common'; import { ManifestEntrySchema } from '../../../../common/endpoint/schema/manifest'; +import { getArtifactId } from './common'; export class ManifestEntry { private artifact: InternalArtifactSchema; @@ -16,7 +17,7 @@ export class ManifestEntry { } public getDocId(): string { - return `${this.getIdentifier()}-${this.getDecodedSha256()}`; + return getArtifactId(this.artifact); } public getIdentifier(): string { diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/mocks.ts b/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/mocks.ts new file mode 100644 index 0000000000000..097151ee835ba --- /dev/null +++ b/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/mocks.ts @@ -0,0 +1,68 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { InternalArtifactCompleteSchema } from '../../schemas/artifacts'; +import { + getInternalArtifactMock, + getInternalArtifactMockWithDiffs, + getEmptyInternalArtifactMock, +} from '../../schemas/artifacts/saved_objects.mock'; +import { ArtifactConstants } from './common'; +import { Manifest } from './manifest'; + +export const getMockArtifacts = async (opts?: { compress: boolean }) => { + return Promise.all( + ArtifactConstants.SUPPORTED_OPERATING_SYSTEMS.map>( + async (os) => { + return getInternalArtifactMock(os, 'v1', opts); + } + ) + ); +}; + +export const getMockArtifactsWithDiff = async (opts?: { compress: boolean }) => { + return Promise.all( + ArtifactConstants.SUPPORTED_OPERATING_SYSTEMS.map>( + async (os) => { + if (os === 'linux') { + return getInternalArtifactMockWithDiffs(os, 'v1'); + } + return getInternalArtifactMock(os, 'v1', opts); + } + ) + ); +}; + +export const getEmptyMockArtifacts = async (opts?: { compress: boolean }) => { + return Promise.all( + ArtifactConstants.SUPPORTED_OPERATING_SYSTEMS.map>( + async (os) => { + return getEmptyInternalArtifactMock(os, 'v1', opts); + } + ) + ); +}; + +export const getMockManifest = async (opts?: { compress: boolean }) => { + const manifest = new Manifest('v1'); + const artifacts = await getMockArtifacts(opts); + artifacts.forEach((artifact) => manifest.addEntry(artifact)); + return manifest; +}; + +export const getMockManifestWithDiffs = async (opts?: { compress: boolean }) => { + const manifest = new Manifest('v1'); + const artifacts = await getMockArtifactsWithDiff(opts); + artifacts.forEach((artifact) => manifest.addEntry(artifact)); + return manifest; +}; + +export const getEmptyMockManifest = async (opts?: { compress: boolean }) => { + const manifest = new Manifest('v1'); + const artifacts = await getEmptyMockArtifacts(opts); + artifacts.forEach((artifact) => manifest.addEntry(artifact)); + return manifest; +}; diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/task.ts b/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/task.ts index 583f4499f591b..ba164059866ea 100644 --- a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/task.ts +++ b/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/task.ts @@ -11,7 +11,8 @@ import { TaskManagerStartContract, } from '../../../../../task_manager/server'; import { EndpointAppContext } from '../../types'; -import { reportErrors } from './common'; +import { reportErrors, ManifestConstants } from './common'; +import { InternalArtifactCompleteSchema } from '../../schemas/artifacts'; export const ManifestTaskConstants = { TIMEOUT: '1m', @@ -89,37 +90,66 @@ export class ManifestTask { return; } - let errors: Error[] = []; try { - // get snapshot based on exception-list-agnostic SOs - // with diffs from last dispatched manifest - const snapshot = await manifestManager.getSnapshot(); - if (snapshot && snapshot.diffs.length > 0) { - // create new artifacts - errors = await manifestManager.syncArtifacts(snapshot, 'add'); - if (errors.length) { - reportErrors(this.logger, errors); - throw new Error('Error writing new artifacts.'); - } - // write to ingest-manager package config - errors = await manifestManager.dispatch(snapshot.manifest); - if (errors.length) { - reportErrors(this.logger, errors); - throw new Error('Error dispatching manifest.'); + // Last manifest we computed, which was saved to ES + const oldManifest = await manifestManager.getLastComputedManifest( + ManifestConstants.SCHEMA_VERSION + ); + if (oldManifest == null) { + this.logger.debug('User manifest not available yet.'); + return; + } + + // New computed manifest based on current state of exception list + const newManifest = await manifestManager.buildNewManifest( + ManifestConstants.SCHEMA_VERSION, + oldManifest + ); + const diffs = newManifest.diff(oldManifest); + + // Compress new artifacts + const adds = diffs.filter((diff) => diff.type === 'add').map((diff) => diff.id); + for (const artifactId of adds) { + const compressError = await newManifest.compressArtifact(artifactId); + if (compressError) { + throw compressError; } - // commit latest manifest state to user-artifact-manifest SO - const error = await manifestManager.commit(snapshot.manifest); + } + + // Persist new artifacts + const artifacts = adds + .map((artifactId) => newManifest.getArtifact(artifactId)) + .filter((artifact): artifact is InternalArtifactCompleteSchema => artifact !== undefined); + if (artifacts.length !== adds.length) { + throw new Error('Invalid artifact encountered.'); + } + const persistErrors = await manifestManager.pushArtifacts(artifacts); + if (persistErrors.length) { + reportErrors(this.logger, persistErrors); + throw new Error('Unable to persist new artifacts.'); + } + + // Commit latest manifest state, if different + if (diffs.length) { + const error = await manifestManager.commit(newManifest); if (error) { - reportErrors(this.logger, [error]); - throw new Error('Error committing manifest.'); - } - // clean up old artifacts - errors = await manifestManager.syncArtifacts(snapshot, 'delete'); - if (errors.length) { - reportErrors(this.logger, errors); - throw new Error('Error cleaning up outdated artifacts.'); + throw error; } } + + // Try dispatching to ingest-manager package configs + const dispatchErrors = await manifestManager.tryDispatch(newManifest); + if (dispatchErrors.length) { + reportErrors(this.logger, dispatchErrors); + throw new Error('Error dispatching manifest.'); + } + + // Try to clean up superceded artifacts + const deletes = diffs.filter((diff) => diff.type === 'delete').map((diff) => diff.id); + const deleteErrors = await manifestManager.deleteArtifacts(deletes); + if (deleteErrors.length) { + reportErrors(this.logger, deleteErrors); + } } catch (err) { this.logger.error(err); } diff --git a/x-pack/plugins/security_solution/server/endpoint/mocks.ts b/x-pack/plugins/security_solution/server/endpoint/mocks.ts index 6a8c26e08d9dd..9ca447d53bf45 100644 --- a/x-pack/plugins/security_solution/server/endpoint/mocks.ts +++ b/x-pack/plugins/security_solution/server/endpoint/mocks.ts @@ -6,8 +6,6 @@ import { ILegacyScopedClusterClient, SavedObjectsClientContract } from 'kibana/server'; import { loggingSystemMock, savedObjectsServiceMock } from 'src/core/server/mocks'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { loggerMock } from 'src/core/server/logging/logger.mock'; import { xpackMocks } from '../../../../mocks'; import { AgentService, @@ -15,28 +13,24 @@ import { ExternalCallback, } from '../../../ingest_manager/server'; import { createPackageConfigServiceMock } from '../../../ingest_manager/server/mocks'; -import { ConfigType } from '../config'; import { createMockConfig } from '../lib/detection_engine/routes/__mocks__'; import { EndpointAppContextService, EndpointAppContextServiceStartContract, } from './endpoint_app_context_services'; -import { - ManifestManagerMock, - getManifestManagerMock, -} from './services/artifacts/manifest_manager/manifest_manager.mock'; +import { ManifestManager } from './services/artifacts/manifest_manager/manifest_manager'; +import { getManifestManagerMock } from './services/artifacts/manifest_manager/manifest_manager.mock'; import { EndpointAppContext } from './types'; /** * Creates a mocked EndpointAppContext. */ export const createMockEndpointAppContext = ( - mockManifestManager?: ManifestManagerMock + mockManifestManager?: ManifestManager ): EndpointAppContext => { return { logFactory: loggingSystemMock.create(), - // @ts-ignore - config: createMockConfig() as ConfigType, + config: () => Promise.resolve(createMockConfig()), service: createMockEndpointAppContextService(mockManifestManager), }; }; @@ -45,16 +39,15 @@ export const createMockEndpointAppContext = ( * Creates a mocked EndpointAppContextService */ export const createMockEndpointAppContextService = ( - mockManifestManager?: ManifestManagerMock + mockManifestManager?: ManifestManager ): jest.Mocked => { - return { + return ({ start: jest.fn(), stop: jest.fn(), getAgentService: jest.fn(), - // @ts-ignore - getManifestManager: mockManifestManager ?? jest.fn(), + getManifestManager: jest.fn().mockReturnValue(mockManifestManager ?? jest.fn()), getScopedSavedObjectsClient: jest.fn(), - }; + } as unknown) as jest.Mocked; }; /** @@ -65,7 +58,7 @@ export const createMockEndpointAppContextServiceStartContract = (): jest.Mocked< > => { return { agentService: createMockAgentService(), - logger: loggerMock.create(), + logger: loggingSystemMock.create().get('mock_endpoint_app_context'), savedObjectsStart: savedObjectsServiceMock.createStartContract(), manifestManager: getManifestManagerMock(), registerIngestCallback: jest.fn< diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/artifacts/download_exception_list.ts b/x-pack/plugins/security_solution/server/endpoint/routes/artifacts/download_exception_list.ts index 1b364a04a4272..218f7c059da48 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/artifacts/download_exception_list.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/artifacts/download_exception_list.ts @@ -20,7 +20,7 @@ import { DownloadArtifactRequestParamsSchema, downloadArtifactRequestParamsSchema, downloadArtifactResponseSchema, - InternalArtifactSchema, + InternalArtifactCompleteSchema, } from '../../schemas/artifacts'; import { EndpointAppContext } from '../../types'; @@ -86,8 +86,8 @@ export function registerDownloadExceptionListRoute( } else { logger.debug(`Cache MISS artifact ${id}`); return scopedSOClient - .get(ArtifactConstants.SAVED_OBJECT_TYPE, id) - .then((artifact: SavedObject) => { + .get(ArtifactConstants.SAVED_OBJECT_TYPE, id) + .then((artifact: SavedObject) => { const body = Buffer.from(artifact.attributes.body, 'base64'); cache.set(id, body); return buildAndValidateResponse(artifact.attributes.identifier, body); diff --git a/x-pack/plugins/security_solution/server/endpoint/schemas/artifacts/lists.mock.ts b/x-pack/plugins/security_solution/server/endpoint/schemas/artifacts/lists.mock.ts index 343b192163479..2cef1f3be69c1 100644 --- a/x-pack/plugins/security_solution/server/endpoint/schemas/artifacts/lists.mock.ts +++ b/x-pack/plugins/security_solution/server/endpoint/schemas/artifacts/lists.mock.ts @@ -15,13 +15,13 @@ export const getTranslatedExceptionListMock = (): WrappedTranslatedExceptionList { entries: [ { - field: 'some.not.nested.field', + field: 'some.nested.field', operator: 'included', type: 'exact_cased', value: 'some value', }, ], - field: 'some.field', + field: 'some.parentField', type: 'nested', }, { diff --git a/x-pack/plugins/security_solution/server/endpoint/schemas/artifacts/saved_objects.mock.ts b/x-pack/plugins/security_solution/server/endpoint/schemas/artifacts/saved_objects.mock.ts index 183a819807ed2..d95627601a183 100644 --- a/x-pack/plugins/security_solution/server/endpoint/schemas/artifacts/saved_objects.mock.ts +++ b/x-pack/plugins/security_solution/server/endpoint/schemas/artifacts/saved_objects.mock.ts @@ -4,37 +4,53 @@ * you may not use this file except in compliance with the Elastic License. */ -import { ArtifactConstants, buildArtifact } from '../../lib/artifacts'; +import { buildArtifact, maybeCompressArtifact, isCompressed } from '../../lib/artifacts'; import { getTranslatedExceptionListMock } from './lists.mock'; -import { InternalArtifactSchema, InternalManifestSchema } from './saved_objects'; +import { + InternalManifestSchema, + internalArtifactCompleteSchema, + InternalArtifactCompleteSchema, +} from './saved_objects'; + +const compressArtifact = async (artifact: InternalArtifactCompleteSchema) => { + const compressedArtifact = await maybeCompressArtifact(artifact); + if (!isCompressed(compressedArtifact)) { + throw new Error(`Unable to compress artifact: ${artifact.identifier}`); + } else if (!internalArtifactCompleteSchema.is(compressedArtifact)) { + throw new Error(`Incomplete artifact detected: ${artifact.identifier}`); + } + return compressedArtifact; +}; export const getInternalArtifactMock = async ( os: string, - schemaVersion: string -): Promise => { - return buildArtifact(getTranslatedExceptionListMock(), os, schemaVersion); + schemaVersion: string, + opts?: { compress: boolean } +): Promise => { + const artifact = await buildArtifact(getTranslatedExceptionListMock(), os, schemaVersion); + return opts?.compress ? compressArtifact(artifact) : artifact; }; -export const getInternalArtifactMockWithDiffs = async ( +export const getEmptyInternalArtifactMock = async ( os: string, - schemaVersion: string -): Promise => { - const mock = getTranslatedExceptionListMock(); - mock.entries.pop(); - return buildArtifact(mock, os, schemaVersion); + schemaVersion: string, + opts?: { compress: boolean } +): Promise => { + const artifact = await buildArtifact({ entries: [] }, os, schemaVersion); + return opts?.compress ? compressArtifact(artifact) : artifact; }; -export const getInternalArtifactsMock = async ( +export const getInternalArtifactMockWithDiffs = async ( os: string, - schemaVersion: string -): Promise => { - // @ts-ignore - return ArtifactConstants.SUPPORTED_OPERATING_SYSTEMS.map(async () => { - await buildArtifact(getTranslatedExceptionListMock(), os, schemaVersion); - }); + schemaVersion: string, + opts?: { compress: boolean } +): Promise => { + const mock = getTranslatedExceptionListMock(); + mock.entries.pop(); + const artifact = await buildArtifact(mock, os, schemaVersion); + return opts?.compress ? compressArtifact(artifact) : artifact; }; export const getInternalManifestMock = (): InternalManifestSchema => ({ - created: Date.now(), ids: [], }); diff --git a/x-pack/plugins/security_solution/server/endpoint/schemas/artifacts/saved_objects.ts b/x-pack/plugins/security_solution/server/endpoint/schemas/artifacts/saved_objects.ts index aa11f4409269a..4dea916dcb436 100644 --- a/x-pack/plugins/security_solution/server/endpoint/schemas/artifacts/saved_objects.ts +++ b/x-pack/plugins/security_solution/server/endpoint/schemas/artifacts/saved_objects.ts @@ -16,7 +16,7 @@ import { created } from './common'; export const body = t.string; // base64 -export const internalArtifactSchema = t.exact( +export const internalArtifactRecordSchema = t.exact( t.type({ identifier, compressionAlgorithm, @@ -25,18 +25,49 @@ export const internalArtifactSchema = t.exact( decodedSize: size, encodedSha256: sha256, encodedSize: size, - created, - body, }) ); +export type InternalArtifactRecordSchema = t.TypeOf; +export const internalArtifactAdditionalFields = { + body, +}; + +export const internalArtifactSchema = t.intersection([ + internalArtifactRecordSchema, + t.partial(internalArtifactAdditionalFields), +]); export type InternalArtifactSchema = t.TypeOf; +export const internalArtifactCompleteSchema = t.intersection([ + internalArtifactRecordSchema, + t.exact(t.type(internalArtifactAdditionalFields)), +]); +export type InternalArtifactCompleteSchema = t.TypeOf; + +export const internalArtifactCreateSchema = t.intersection([ + internalArtifactCompleteSchema, + t.exact( + t.type({ + created, + }) + ), +]); +export type InternalArtifactCreateSchema = t.TypeOf; + export const internalManifestSchema = t.exact( t.type({ - created, ids: t.array(identifier), }) ); - export type InternalManifestSchema = t.TypeOf; + +export const internalManifestCreateSchema = t.intersection([ + internalManifestSchema, + t.exact( + t.type({ + created, + }) + ), +]); +export type InternalManifestCreateSchema = t.TypeOf; diff --git a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/artifact_client.test.ts b/x-pack/plugins/security_solution/server/endpoint/services/artifacts/artifact_client.test.ts index 3e3b12c04d65c..0787231e242cb 100644 --- a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/artifact_client.test.ts +++ b/x-pack/plugins/security_solution/server/endpoint/services/artifacts/artifact_client.test.ts @@ -5,7 +5,7 @@ */ import { savedObjectsClientMock } from 'src/core/server/mocks'; -import { ArtifactConstants } from '../../lib/artifacts'; +import { ArtifactConstants, getArtifactId } from '../../lib/artifacts'; import { getInternalArtifactMock } from '../../schemas/artifacts/saved_objects.mock'; import { getArtifactClientMock } from './artifact_client.mock'; import { ArtifactClient } from './artifact_client'; @@ -31,8 +31,11 @@ describe('artifact_client', () => { await artifactClient.createArtifact(artifact); expect(savedObjectsClient.create).toHaveBeenCalledWith( ArtifactConstants.SAVED_OBJECT_TYPE, - artifact, - { id: artifactClient.getArtifactId(artifact) } + { + ...artifact, + created: expect.any(Number), + }, + { id: getArtifactId(artifact) } ); }); diff --git a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/artifact_client.ts b/x-pack/plugins/security_solution/server/endpoint/services/artifacts/artifact_client.ts index ca53a891c4d6b..6138b4fb7e6dc 100644 --- a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/artifact_client.ts +++ b/x-pack/plugins/security_solution/server/endpoint/services/artifacts/artifact_client.ts @@ -5,8 +5,11 @@ */ import { SavedObject, SavedObjectsClientContract } from 'src/core/server'; -import { ArtifactConstants } from '../../lib/artifacts'; -import { InternalArtifactSchema } from '../../schemas/artifacts'; +import { ArtifactConstants, getArtifactId } from '../../lib/artifacts'; +import { + InternalArtifactCompleteSchema, + InternalArtifactCreateSchema, +} from '../../schemas/artifacts'; export class ArtifactClient { private savedObjectsClient: SavedObjectsClientContract; @@ -15,24 +18,23 @@ export class ArtifactClient { this.savedObjectsClient = savedObjectsClient; } - public getArtifactId(artifact: InternalArtifactSchema) { - return `${artifact.identifier}-${artifact.decodedSha256}`; - } - - public async getArtifact(id: string): Promise> { - return this.savedObjectsClient.get( + public async getArtifact(id: string): Promise> { + return this.savedObjectsClient.get( ArtifactConstants.SAVED_OBJECT_TYPE, id ); } public async createArtifact( - artifact: InternalArtifactSchema - ): Promise> { - return this.savedObjectsClient.create( + artifact: InternalArtifactCompleteSchema + ): Promise> { + return this.savedObjectsClient.create( ArtifactConstants.SAVED_OBJECT_TYPE, - artifact, - { id: this.getArtifactId(artifact) } + { + ...artifact, + created: Date.now(), + }, + { id: getArtifactId(artifact) } ); } diff --git a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_client.test.ts b/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_client.test.ts index fe3f193bc8ff5..6db29289e983d 100644 --- a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_client.test.ts +++ b/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_client.test.ts @@ -38,7 +38,10 @@ describe('manifest_client', () => { await manifestClient.createManifest(manifest); expect(savedObjectsClient.create).toHaveBeenCalledWith( ManifestConstants.SAVED_OBJECT_TYPE, - manifest, + { + ...manifest, + created: expect.any(Number), + }, { id: manifestClient.getManifestId() } ); }); diff --git a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_client.ts b/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_client.ts index 45182841e56fc..385f115e6301a 100644 --- a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_client.ts +++ b/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_client.ts @@ -15,7 +15,7 @@ import { } from '../../../../common/endpoint/schema/common'; import { validate } from '../../../../common/validate'; import { ManifestConstants } from '../../lib/artifacts'; -import { InternalManifestSchema } from '../../schemas/artifacts'; +import { InternalManifestSchema, InternalManifestCreateSchema } from '../../schemas/artifacts'; interface UpdateManifestOpts { version: string; @@ -57,9 +57,12 @@ export class ManifestClient { public async createManifest( manifest: InternalManifestSchema ): Promise> { - return this.savedObjectsClient.create( + return this.savedObjectsClient.create( ManifestConstants.SAVED_OBJECT_TYPE, - manifest, + { + ...manifest, + created: Date.now(), + }, { id: this.getManifestId() } ); } diff --git a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.mock.ts b/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.mock.ts index 3e4fee8871b8a..08cdb9816a1c1 100644 --- a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.mock.ts +++ b/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.mock.ts @@ -6,53 +6,34 @@ import { savedObjectsClientMock, loggingSystemMock } from 'src/core/server/mocks'; import { Logger } from 'src/core/server'; -import { createPackageConfigMock } from '../../../../../../ingest_manager/common/mocks'; +import { + createPackageConfigWithManifestMock, + createPackageConfigWithInitialManifestMock, +} from '../../../../../../ingest_manager/common/mocks'; import { PackageConfigServiceInterface } from '../../../../../../ingest_manager/server'; import { createPackageConfigServiceMock } from '../../../../../../ingest_manager/server/mocks'; -import { getFoundExceptionListItemSchemaMock } from '../../../../../../lists/common/schemas/response/found_exception_list_item_schema.mock'; import { listMock } from '../../../../../../lists/server/mocks'; -import { - ExceptionsCache, - Manifest, - buildArtifact, - getFullEndpointExceptionList, -} from '../../../lib/artifacts'; -import { ManifestConstants } from '../../../lib/artifacts/common'; -import { InternalArtifactSchema } from '../../../schemas/artifacts'; +import { ExceptionsCache } from '../../../lib/artifacts'; import { getArtifactClientMock } from '../artifact_client.mock'; import { getManifestClientMock } from '../manifest_client.mock'; import { ManifestManager } from './manifest_manager'; +import { + getMockManifest, + getMockArtifactsWithDiff, + getEmptyMockArtifacts, +} from '../../../lib/artifacts/mocks'; -async function mockBuildExceptionListArtifacts( - os: string, - schemaVersion: string -): Promise { - const mockExceptionClient = listMock.getExceptionListClient(); - const first = getFoundExceptionListItemSchemaMock(); - mockExceptionClient.findExceptionListItem = jest.fn().mockReturnValueOnce(first); - const exceptions = await getFullEndpointExceptionList(mockExceptionClient, os, schemaVersion); - return [await buildArtifact(exceptions, os, schemaVersion)]; -} - -export class ManifestManagerMock extends ManifestManager { - protected buildExceptionListArtifacts = jest - .fn() - .mockResolvedValue(mockBuildExceptionListArtifacts('linux', 'v1')); - - public getLastDispatchedManifest = jest - .fn() - .mockResolvedValue(new Manifest(new Date(), 'v1', ManifestConstants.INITIAL_VERSION)); - - protected getManifestClient = jest - .fn() - .mockReturnValue(getManifestClientMock(this.savedObjectsClient)); +export enum ManifestManagerMockType { + InitialSystemState, + NormalFlow, } export const getManifestManagerMock = (opts?: { + mockType?: ManifestManagerMockType; cache?: ExceptionsCache; packageConfigService?: jest.Mocked; savedObjectsClient?: ReturnType; -}): ManifestManagerMock => { +}): ManifestManager => { let cache = new ExceptionsCache(5); if (opts?.cache !== undefined) { cache = opts.cache; @@ -64,7 +45,11 @@ export const getManifestManagerMock = (opts?: { } packageConfigService.list = jest.fn().mockResolvedValue({ total: 1, - items: [{ version: 'abcd', ...createPackageConfigMock() }], + items: [ + { version: 'policy-1-version', ...createPackageConfigWithManifestMock() }, + { version: 'policy-2-version', ...createPackageConfigWithInitialManifestMock() }, + { version: 'policy-3-version', ...createPackageConfigWithInitialManifestMock() }, + ], }); let savedObjectsClient = savedObjectsClientMock.create(); @@ -72,6 +57,32 @@ export const getManifestManagerMock = (opts?: { savedObjectsClient = opts.savedObjectsClient; } + class ManifestManagerMock extends ManifestManager { + protected buildExceptionListArtifacts = jest.fn().mockImplementation(() => { + const mockType = opts?.mockType ?? ManifestManagerMockType.NormalFlow; + switch (mockType) { + case ManifestManagerMockType.InitialSystemState: + return getEmptyMockArtifacts(); + case ManifestManagerMockType.NormalFlow: + return getMockArtifactsWithDiff(); + } + }); + + public getLastComputedManifest = jest.fn().mockImplementation(() => { + const mockType = opts?.mockType ?? ManifestManagerMockType.NormalFlow; + switch (mockType) { + case ManifestManagerMockType.InitialSystemState: + return null; + case ManifestManagerMockType.NormalFlow: + return getMockManifest({ compress: true }); + } + }); + + protected getManifestClient = jest + .fn() + .mockReturnValue(getManifestClientMock(this.savedObjectsClient)); + } + const manifestManager = new ManifestManagerMock({ artifactClient: getArtifactClientMock(savedObjectsClient), cache, diff --git a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.test.ts b/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.test.ts index 80d325ece765c..ff331f7d017f4 100644 --- a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.test.ts +++ b/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.test.ts @@ -10,40 +10,71 @@ import { createPackageConfigServiceMock } from '../../../../../../ingest_manager import { ArtifactConstants, ManifestConstants, - Manifest, ExceptionsCache, + isCompleteArtifact, } from '../../../lib/artifacts'; import { getManifestManagerMock } from './manifest_manager.mock'; describe('manifest_manager', () => { describe('ManifestManager sanity checks', () => { - test('ManifestManager can snapshot manifest', async () => { + test('ManifestManager can retrieve and diff manifests', async () => { const manifestManager = getManifestManagerMock(); - const snapshot = await manifestManager.getSnapshot(); - expect(snapshot!.diffs).toEqual([ + const oldManifest = await manifestManager.getLastComputedManifest( + ManifestConstants.SCHEMA_VERSION + ); + const newManifest = await manifestManager.buildNewManifest( + ManifestConstants.SCHEMA_VERSION, + oldManifest! + ); + expect(newManifest.diff(oldManifest!)).toEqual([ { id: - 'endpoint-exceptionlist-linux-v1-1a8295e6ccb93022c6f5ceb8997b29f2912389b3b38f52a8f5a2ff7b0154b1bc', + 'endpoint-exceptionlist-linux-v1-96b76a1a911662053a1562ac14c4ff1e87c2ff550d6fe52e1e0b3790526597d3', + type: 'delete', + }, + { + id: + 'endpoint-exceptionlist-linux-v1-0a5a2013a79f9e60682472284a1be45ab1ff68b9b43426d00d665016612c15c8', type: 'add', }, ]); - expect(snapshot!.manifest).toBeInstanceOf(Manifest); }); test('ManifestManager populates cache properly', async () => { const cache = new ExceptionsCache(5); const manifestManager = getManifestManagerMock({ cache }); - const snapshot = await manifestManager.getSnapshot(); - expect(snapshot!.diffs).toEqual([ + const oldManifest = await manifestManager.getLastComputedManifest( + ManifestConstants.SCHEMA_VERSION + ); + const newManifest = await manifestManager.buildNewManifest( + ManifestConstants.SCHEMA_VERSION, + oldManifest! + ); + const diffs = newManifest.diff(oldManifest!); + expect(diffs).toEqual([ { id: - 'endpoint-exceptionlist-linux-v1-1a8295e6ccb93022c6f5ceb8997b29f2912389b3b38f52a8f5a2ff7b0154b1bc', + 'endpoint-exceptionlist-linux-v1-96b76a1a911662053a1562ac14c4ff1e87c2ff550d6fe52e1e0b3790526597d3', + type: 'delete', + }, + { + id: + 'endpoint-exceptionlist-linux-v1-0a5a2013a79f9e60682472284a1be45ab1ff68b9b43426d00d665016612c15c8', type: 'add', }, ]); - await manifestManager.syncArtifacts(snapshot!, 'add'); - const diff = snapshot!.diffs[0]; - const entry = JSON.parse(inflateSync(cache.get(diff!.id)! as Buffer).toString()); + + const newArtifactId = diffs[1].id; + await newManifest.compressArtifact(newArtifactId); + const artifact = newManifest.getArtifact(newArtifactId)!; + + if (isCompleteArtifact(artifact)) { + await manifestManager.pushArtifacts([artifact]); // caches the artifact + } else { + throw new Error('Artifact is missing a body.'); + } + + const entry = JSON.parse(inflateSync(cache.get(newArtifactId)! as Buffer).toString()); expect(entry).toEqual({ entries: [ { @@ -52,7 +83,7 @@ describe('manifest_manager', () => { { entries: [ { - field: 'nested.field', + field: 'some.nested.field', operator: 'included', type: 'exact_cased', value: 'some value', @@ -73,28 +104,77 @@ describe('manifest_manager', () => { }); }); + test('ManifestManager cannot dispatch incomplete (uncompressed) artifact', async () => { + const packageConfigService = createPackageConfigServiceMock(); + const manifestManager = getManifestManagerMock({ packageConfigService }); + const oldManifest = await manifestManager.getLastComputedManifest( + ManifestConstants.SCHEMA_VERSION + ); + const newManifest = await manifestManager.buildNewManifest( + ManifestConstants.SCHEMA_VERSION, + oldManifest! + ); + const dispatchErrors = await manifestManager.tryDispatch(newManifest); + expect(dispatchErrors.length).toEqual(1); + expect(dispatchErrors[0].message).toEqual('Invalid manifest'); + }); + test('ManifestManager can dispatch manifest', async () => { const packageConfigService = createPackageConfigServiceMock(); const manifestManager = getManifestManagerMock({ packageConfigService }); - const snapshot = await manifestManager.getSnapshot(); - const dispatchErrors = await manifestManager.dispatch(snapshot!.manifest); + const oldManifest = await manifestManager.getLastComputedManifest( + ManifestConstants.SCHEMA_VERSION + ); + const newManifest = await manifestManager.buildNewManifest( + ManifestConstants.SCHEMA_VERSION, + oldManifest! + ); + const diffs = newManifest.diff(oldManifest!); + const newArtifactId = diffs[1].id; + await newManifest.compressArtifact(newArtifactId); + + const dispatchErrors = await manifestManager.tryDispatch(newManifest); + expect(dispatchErrors).toEqual([]); - const entries = snapshot!.manifest.getEntries(); - const artifact = Object.values(entries)[0].getArtifact(); + + // 2 policies updated... 1 is already up-to-date + expect(packageConfigService.update.mock.calls.length).toEqual(2); + expect( packageConfigService.update.mock.calls[0][2].inputs[0].config!.artifact_manifest.value ).toEqual({ - manifest_version: ManifestConstants.INITIAL_VERSION, + manifest_version: '520f6cf88b3f36a065c6ca81058d5f8690aadadf6fe857f8dec4cc37589e7283', schema_version: 'v1', artifacts: { - [artifact.identifier]: { - compression_algorithm: 'none', + 'endpoint-exceptionlist-linux-v1': { + compression_algorithm: 'zlib', encryption_algorithm: 'none', - decoded_sha256: artifact.decodedSha256, - encoded_sha256: artifact.encodedSha256, - decoded_size: artifact.decodedSize, - encoded_size: artifact.encodedSize, - relative_url: `/api/endpoint/artifacts/download/${artifact.identifier}/${artifact.decodedSha256}`, + decoded_sha256: '0a5a2013a79f9e60682472284a1be45ab1ff68b9b43426d00d665016612c15c8', + encoded_sha256: '57941169bb2c5416f9bd7224776c8462cb9a2be0fe8b87e6213e77a1d29be824', + decoded_size: 292, + encoded_size: 131, + relative_url: + '/api/endpoint/artifacts/download/endpoint-exceptionlist-linux-v1/0a5a2013a79f9e60682472284a1be45ab1ff68b9b43426d00d665016612c15c8', + }, + 'endpoint-exceptionlist-macos-v1': { + compression_algorithm: 'zlib', + encryption_algorithm: 'none', + decoded_sha256: '96b76a1a911662053a1562ac14c4ff1e87c2ff550d6fe52e1e0b3790526597d3', + encoded_sha256: '975382ab55d019cbab0bbac207a54e2a7d489fad6e8f6de34fc6402e5ef37b1e', + decoded_size: 432, + encoded_size: 147, + relative_url: + '/api/endpoint/artifacts/download/endpoint-exceptionlist-macos-v1/96b76a1a911662053a1562ac14c4ff1e87c2ff550d6fe52e1e0b3790526597d3', + }, + 'endpoint-exceptionlist-windows-v1': { + compression_algorithm: 'zlib', + encryption_algorithm: 'none', + decoded_sha256: '96b76a1a911662053a1562ac14c4ff1e87c2ff550d6fe52e1e0b3790526597d3', + encoded_sha256: '975382ab55d019cbab0bbac207a54e2a7d489fad6e8f6de34fc6402e5ef37b1e', + decoded_size: 432, + encoded_size: 147, + relative_url: + '/api/endpoint/artifacts/download/endpoint-exceptionlist-windows-v1/96b76a1a911662053a1562ac14c4ff1e87c2ff550d6fe52e1e0b3790526597d3', }, }, }); @@ -103,29 +183,20 @@ describe('manifest_manager', () => { test('ManifestManager fails to dispatch on conflict', async () => { const packageConfigService = createPackageConfigServiceMock(); const manifestManager = getManifestManagerMock({ packageConfigService }); - const snapshot = await manifestManager.getSnapshot(); - packageConfigService.update.mockRejectedValue({ status: 409 }); - const dispatchErrors = await manifestManager.dispatch(snapshot!.manifest); + const oldManifest = await manifestManager.getLastComputedManifest( + ManifestConstants.SCHEMA_VERSION + ); + const newManifest = await manifestManager.buildNewManifest( + ManifestConstants.SCHEMA_VERSION, + oldManifest! + ); + const diffs = newManifest.diff(oldManifest!); + const newArtifactId = diffs[1].id; + await newManifest.compressArtifact(newArtifactId); + + packageConfigService.update.mockRejectedValueOnce({ status: 409 }); + const dispatchErrors = await manifestManager.tryDispatch(newManifest); expect(dispatchErrors).toEqual([{ status: 409 }]); - const entries = snapshot!.manifest.getEntries(); - const artifact = Object.values(entries)[0].getArtifact(); - expect( - packageConfigService.update.mock.calls[0][2].inputs[0].config!.artifact_manifest.value - ).toEqual({ - manifest_version: ManifestConstants.INITIAL_VERSION, - schema_version: 'v1', - artifacts: { - [artifact.identifier]: { - compression_algorithm: 'none', - encryption_algorithm: 'none', - decoded_sha256: artifact.decodedSha256, - encoded_sha256: artifact.encodedSha256, - decoded_size: artifact.decodedSize, - encoded_size: artifact.encodedSize, - relative_url: `/api/endpoint/artifacts/download/${artifact.identifier}/${artifact.decodedSha256}`, - }, - }, - }); }); test('ManifestManager can commit manifest', async () => { @@ -134,37 +205,43 @@ describe('manifest_manager', () => { savedObjectsClient, }); - const snapshot = await manifestManager.getSnapshot(); - await manifestManager.syncArtifacts(snapshot!, 'add'); - - const diff = { - id: 'abcd', - type: 'delete', - }; - snapshot!.diffs.push(diff); - - const dispatched = await manifestManager.dispatch(snapshot!.manifest); - expect(dispatched).toEqual([]); + const oldManifest = await manifestManager.getLastComputedManifest( + ManifestConstants.SCHEMA_VERSION + ); + const newManifest = await manifestManager.buildNewManifest( + ManifestConstants.SCHEMA_VERSION, + oldManifest! + ); + const diffs = newManifest.diff(oldManifest!); + const oldArtifactId = diffs[0].id; + const newArtifactId = diffs[1].id; + await newManifest.compressArtifact(newArtifactId); - await manifestManager.commit(snapshot!.manifest); + const artifact = newManifest.getArtifact(newArtifactId)!; + if (isCompleteArtifact(artifact)) { + await manifestManager.pushArtifacts([artifact]); + } else { + throw new Error('Artifact is missing a body.'); + } - await manifestManager.syncArtifacts(snapshot!, 'delete'); + await manifestManager.commit(newManifest); + await manifestManager.deleteArtifacts([oldArtifactId]); // created new artifact expect(savedObjectsClient.create.mock.calls[0][0]).toEqual( ArtifactConstants.SAVED_OBJECT_TYPE ); - // deleted old artifact - expect(savedObjectsClient.delete).toHaveBeenCalledWith( - ArtifactConstants.SAVED_OBJECT_TYPE, - 'abcd' - ); - // committed new manifest expect(savedObjectsClient.create.mock.calls[1][0]).toEqual( ManifestConstants.SAVED_OBJECT_TYPE ); + + // deleted old artifact + expect(savedObjectsClient.delete).toHaveBeenCalledWith( + ArtifactConstants.SAVED_OBJECT_TYPE, + oldArtifactId + ); }); }); }); diff --git a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.ts b/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.ts index c8cad32ab746e..2501f07cb26e0 100644 --- a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.ts +++ b/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.ts @@ -5,10 +5,11 @@ */ import { Logger, SavedObjectsClientContract } from 'src/core/server'; -import { createHash } from 'crypto'; import { PackageConfigServiceInterface } from '../../../../../../ingest_manager/server'; import { ExceptionListClient } from '../../../../../../lists/server'; import { ManifestSchemaVersion } from '../../../../../common/endpoint/schema/common'; +import { manifestDispatchSchema } from '../../../../../common/endpoint/schema/manifest'; + import { ArtifactConstants, ManifestConstants, @@ -17,11 +18,14 @@ import { getFullEndpointExceptionList, ExceptionsCache, ManifestDiff, + getArtifactId, } from '../../../lib/artifacts'; -import { InternalArtifactSchema } from '../../../schemas/artifacts'; +import { + InternalArtifactCompleteSchema, + internalArtifactCompleteSchema, +} from '../../../schemas/artifacts'; import { ArtifactClient } from '../artifact_client'; import { ManifestClient } from '../manifest_client'; -import { compressExceptionList } from '../../../lib/artifacts/lists'; export interface ManifestManagerContext { savedObjectsClient: SavedObjectsClientContract; @@ -73,82 +77,86 @@ export class ManifestManager { * state of exception-list-agnostic SOs. * * @param schemaVersion The schema version of the artifact - * @returns {Promise} An array of uncompressed artifacts built from exception-list-agnostic SOs. + * @returns {Promise} An array of uncompressed artifacts built from exception-list-agnostic SOs. * @throws Throws/rejects if there are errors building the list. */ protected async buildExceptionListArtifacts( schemaVersion: string - ): Promise { - // TODO: should wrap in try/catch? - return ArtifactConstants.SUPPORTED_OPERATING_SYSTEMS.reduce( - async (acc: Promise, os) => { - const exceptionList = await getFullEndpointExceptionList( - this.exceptionListClient, - os, - schemaVersion - ); - const artifacts = await acc; - const artifact = await buildArtifact(exceptionList, os, schemaVersion); - artifacts.push(artifact); - return Promise.resolve(artifacts); - }, - Promise.resolve([]) - ); + ): Promise { + return ArtifactConstants.SUPPORTED_OPERATING_SYSTEMS.reduce< + Promise + >(async (acc, os) => { + const exceptionList = await getFullEndpointExceptionList( + this.exceptionListClient, + os, + schemaVersion + ); + const artifacts = await acc; + const artifact = await buildArtifact(exceptionList, os, schemaVersion); + return Promise.resolve([...artifacts, artifact]); + }, Promise.resolve([])); } /** - * Writes new artifact SOs based on provided snapshot. + * Writes new artifact SO. * - * @param snapshot A ManifestSnapshot to use for writing the artifacts. - * @returns {Promise} Any errors encountered. + * @param artifact An InternalArtifactCompleteSchema representing the artifact. + * @returns {Promise} An error, if encountered, or null. */ - private async writeArtifacts(snapshot: ManifestSnapshot): Promise { - const errors: Error[] = []; - for (const diff of snapshot.diffs) { - const artifact = snapshot.manifest.getArtifact(diff.id); - if (artifact === undefined) { - throw new Error( - `Corrupted manifest detected. Diff contained artifact ${diff.id} not in manifest.` - ); + protected async pushArtifact(artifact: InternalArtifactCompleteSchema): Promise { + const artifactId = getArtifactId(artifact); + try { + // Write the artifact SO + await this.artifactClient.createArtifact(artifact); + + // Cache the compressed body of the artifact + this.cache.set(artifactId, Buffer.from(artifact.body, 'base64')); + } catch (err) { + if (err.status === 409) { + this.logger.debug(`Tried to create artifact ${artifactId}, but it already exists.`); + } else { + return err; } + } - const compressedArtifact = await compressExceptionList(Buffer.from(artifact.body, 'base64')); - artifact.body = compressedArtifact.toString('base64'); - artifact.encodedSize = compressedArtifact.byteLength; - artifact.compressionAlgorithm = 'zlib'; - artifact.encodedSha256 = createHash('sha256').update(compressedArtifact).digest('hex'); + return null; + } - try { - // Write the artifact SO - await this.artifactClient.createArtifact(artifact); - // Cache the compressed body of the artifact - this.cache.set(diff.id, Buffer.from(artifact.body, 'base64')); - } catch (err) { - if (err.status === 409) { - this.logger.debug(`Tried to create artifact ${diff.id}, but it already exists.`); - } else { - // TODO: log error here? + /** + * Writes new artifact SOs. + * + * @param artifacts An InternalArtifactCompleteSchema array representing the artifacts. + * @returns {Promise} Any errors encountered. + */ + public async pushArtifacts(artifacts: InternalArtifactCompleteSchema[]): Promise { + const errors: Error[] = []; + for (const artifact of artifacts) { + if (internalArtifactCompleteSchema.is(artifact)) { + const err = await this.pushArtifact(artifact); + if (err) { errors.push(err); } + } else { + errors.push(new Error(`Incomplete artifact: ${getArtifactId(artifact)}`)); } } return errors; } /** - * Deletes old artifact SOs based on provided snapshot. + * Deletes outdated artifact SOs. + * + * The artifact may still remain in the cache. * - * @param snapshot A ManifestSnapshot to use for deleting the artifacts. + * @param artifactIds The IDs of the artifact to delete.. * @returns {Promise} Any errors encountered. */ - private async deleteArtifacts(snapshot: ManifestSnapshot): Promise { + public async deleteArtifacts(artifactIds: string[]): Promise { const errors: Error[] = []; - for (const diff of snapshot.diffs) { + for (const artifactId of artifactIds) { try { - // Delete the artifact SO - await this.artifactClient.deleteArtifact(diff.id); - // TODO: should we delete the cache entry here? - this.logger.info(`Cleaned up artifact ${diff.id}`); + await this.artifactClient.deleteArtifact(artifactId); + this.logger.info(`Cleaned up artifact ${artifactId}`); } catch (err) { errors.push(err); } @@ -157,14 +165,14 @@ export class ManifestManager { } /** - * Returns the last dispatched manifest based on the current state of the + * Returns the last computed manifest based on the state of the * user-artifact-manifest SO. * * @param schemaVersion The schema version of the manifest. - * @returns {Promise} The last dispatched manifest, or null if does not exist. + * @returns {Promise} The last computed manifest, or null if does not exist. * @throws Throws/rejects if there is an unexpected error retrieving the manifest. */ - public async getLastDispatchedManifest(schemaVersion: string): Promise { + public async getLastComputedManifest(schemaVersion: string): Promise { try { const manifestClient = this.getManifestClient(schemaVersion); const manifestSo = await manifestClient.getManifest(); @@ -173,11 +181,7 @@ export class ManifestManager { throw new Error('No version returned for manifest.'); } - const manifest = new Manifest( - new Date(manifestSo.attributes.created), - schemaVersion, - manifestSo.version - ); + const manifest = new Manifest(schemaVersion, manifestSo.version); for (const id of manifestSo.attributes.ids) { const artifactSo = await this.artifactClient.getArtifact(id); @@ -193,89 +197,42 @@ export class ManifestManager { } /** - * Snapshots a manifest based on current state of exception-list-agnostic SOs. + * Builds a new manifest based on the current user exception list. * - * @param opts Optional parameters for snapshot retrieval. - * @param opts.initialize Initialize a new Manifest when no manifest SO can be retrieved. - * @returns {Promise} A snapshot of the manifest, or null if not initialized. + * @param schemaVersion The schema version of the manifest. + * @param baselineManifest A baseline manifest to use for initializing pre-existing artifacts. + * @returns {Promise} A new Manifest object reprenting the current exception list. */ - public async getSnapshot(opts?: ManifestSnapshotOpts): Promise { - try { - let oldManifest: Manifest | null; - - // Get the last-dispatched manifest - oldManifest = await this.getLastDispatchedManifest(ManifestConstants.SCHEMA_VERSION); - - if (oldManifest === null && opts !== undefined && opts.initialize) { - oldManifest = new Manifest( - new Date(), - ManifestConstants.SCHEMA_VERSION, - ManifestConstants.INITIAL_VERSION - ); // create empty manifest - } else if (oldManifest == null) { - this.logger.debug('Manifest does not exist yet. Waiting...'); - return null; - } - - // Build new exception list artifacts - const artifacts = await this.buildExceptionListArtifacts(ArtifactConstants.SCHEMA_VERSION); - - // Build new manifest - const newManifest = Manifest.fromArtifacts( - artifacts, - ManifestConstants.SCHEMA_VERSION, - oldManifest - ); - - // Get diffs - const diffs = newManifest.diff(oldManifest); + public async buildNewManifest( + schemaVersion: string, + baselineManifest?: Manifest + ): Promise { + // Build new exception list artifacts + const artifacts = await this.buildExceptionListArtifacts(ArtifactConstants.SCHEMA_VERSION); + + // Build new manifest + const manifest = Manifest.fromArtifacts( + artifacts, + ManifestConstants.SCHEMA_VERSION, + baselineManifest ?? Manifest.getDefault(schemaVersion) + ); - return { - manifest: newManifest, - diffs, - }; - } catch (err) { - this.logger.error(err); - return null; - } + return manifest; } /** - * Syncs artifacts based on provided snapshot. - * - * Creates artifacts that do not yet exist and cleans up old artifacts that have been - * superceded by this snapshot. + * Dispatches the manifest by writing it to the endpoint package config, if different + * from the manifest already in the config. * - * @param snapshot A ManifestSnapshot to use for sync. + * @param manifest The Manifest to dispatch. * @returns {Promise} Any errors encountered. */ - public async syncArtifacts( - snapshot: ManifestSnapshot, - diffType: 'add' | 'delete' - ): Promise { - const filteredDiffs = snapshot.diffs.filter((diff) => { - return diff.type === diffType; - }); - - const tmpSnapshot = { ...snapshot }; - tmpSnapshot.diffs = filteredDiffs; - - if (diffType === 'add') { - return this.writeArtifacts(tmpSnapshot); - } else if (diffType === 'delete') { - return this.deleteArtifacts(tmpSnapshot); + public async tryDispatch(manifest: Manifest): Promise { + const serializedManifest = manifest.toEndpointFormat(); + if (!manifestDispatchSchema.is(serializedManifest)) { + return [new Error('Invalid manifest')]; } - return [new Error(`Unsupported diff type: ${diffType}`)]; - } - - /** - * Dispatches the manifest by writing it to the endpoint package config. - * - * @param manifest The Manifest to dispatch. - * @returns {Promise} Any errors encountered. - */ - public async dispatch(manifest: Manifest): Promise { let paging = true; let page = 1; const errors: Error[] = []; @@ -293,16 +250,25 @@ export class ManifestManager { const artifactManifest = newPackageConfig.inputs[0].config.artifact_manifest ?? { value: {}, }; - artifactManifest.value = manifest.toEndpointFormat(); - newPackageConfig.inputs[0].config.artifact_manifest = artifactManifest; - - try { - await this.packageConfigService.update(this.savedObjectsClient, id, newPackageConfig); - this.logger.debug( - `Updated package config ${id} with manifest version ${manifest.getVersion()}` - ); - } catch (err) { - errors.push(err); + + const oldManifest = + Manifest.fromPkgConfig(artifactManifest.value) ?? + Manifest.getDefault(ManifestConstants.SCHEMA_VERSION); + if (!manifest.equals(oldManifest)) { + newPackageConfig.inputs[0].config.artifact_manifest = { + value: serializedManifest, + }; + + try { + await this.packageConfigService.update(this.savedObjectsClient, id, newPackageConfig); + this.logger.debug( + `Updated package config ${id} with manifest version ${manifest.getSha256()}` + ); + } catch (err) { + errors.push(err); + } + } else { + this.logger.debug(`No change in package config: ${id}`); } } else { errors.push(new Error(`Package config ${id} has no config.`)); @@ -317,46 +283,32 @@ export class ManifestManager { } /** - * Commits a manifest to indicate that it has been dispatched. + * Commits a manifest to indicate that a new version has been computed. * * @param manifest The Manifest to commit. - * @returns {Promise} An error if encountered, or null if successful. + * @returns {Promise} An error, if encountered, or null. */ public async commit(manifest: Manifest): Promise { try { const manifestClient = this.getManifestClient(manifest.getSchemaVersion()); // Commit the new manifest - if (manifest.getVersion() === ManifestConstants.INITIAL_VERSION) { - await manifestClient.createManifest(manifest.toSavedObject()); + const manifestSo = manifest.toSavedObject(); + const version = manifest.getSoVersion(); + + if (version == null) { + await manifestClient.createManifest(manifestSo); } else { - const version = manifest.getVersion(); - if (version === ManifestConstants.INITIAL_VERSION) { - throw new Error('Updating existing manifest with baseline version. Bad state.'); - } - await manifestClient.updateManifest(manifest.toSavedObject(), { + await manifestClient.updateManifest(manifestSo, { version, }); } - this.logger.info(`Committed manifest ${manifest.getVersion()}`); + this.logger.info(`Committed manifest ${manifest.getSha256()}`); } catch (err) { return err; } return null; } - - /** - * Confirms that a packageConfig exists with provided name. - */ - public async confirmPackageConfigExists(name: string) { - // TODO: what if there are multiple results? uh oh. - const { total } = await this.packageConfigService.list(this.savedObjectsClient, { - page: 1, - perPage: 20, - kuery: `ingest-package-configs.name:${name}`, - }); - return total > 0; - } } From 466380e3b6e5541041d6479d28f9fdf336ff5a8b Mon Sep 17 00:00:00 2001 From: Spencer Date: Fri, 17 Jul 2020 13:53:54 -0700 Subject: [PATCH 38/59] [kbn/dev-utils] add RunWithCommands utility (#72311) Co-authored-by: spalger --- packages/kbn-dev-utils/src/index.ts | 2 +- packages/kbn-dev-utils/src/run/cleanup.ts | 94 +++++++++ packages/kbn-dev-utils/src/run/flags.test.ts | 18 +- packages/kbn-dev-utils/src/run/flags.ts | 79 ++++--- packages/kbn-dev-utils/src/run/help.test.ts | 199 ++++++++++++++++++ packages/kbn-dev-utils/src/run/help.ts | 150 +++++++++++++ packages/kbn-dev-utils/src/run/index.ts | 7 +- packages/kbn-dev-utils/src/run/run.ts | 119 ++++------- .../src/run/run_with_commands.test.ts | 77 +++++++ .../src/run/run_with_commands.ts | 136 ++++++++++++ 10 files changed, 743 insertions(+), 138 deletions(-) create mode 100644 packages/kbn-dev-utils/src/run/cleanup.ts create mode 100644 packages/kbn-dev-utils/src/run/help.test.ts create mode 100644 packages/kbn-dev-utils/src/run/help.ts create mode 100644 packages/kbn-dev-utils/src/run/run_with_commands.test.ts create mode 100644 packages/kbn-dev-utils/src/run/run_with_commands.ts diff --git a/packages/kbn-dev-utils/src/index.ts b/packages/kbn-dev-utils/src/index.ts index 3e9e6238df9dc..582526f939e42 100644 --- a/packages/kbn-dev-utils/src/index.ts +++ b/packages/kbn-dev-utils/src/index.ts @@ -33,9 +33,9 @@ export { KBN_P12_PATH, KBN_P12_PASSWORD, } from './certs'; -export { run, createFailError, createFlagError, combineErrors, isFailError, Flags } from './run'; export { REPO_ROOT } from './repo_root'; export { KbnClient } from './kbn_client'; +export * from './run'; export * from './axios'; export * from './stdio'; export * from './ci_stats_reporter'; diff --git a/packages/kbn-dev-utils/src/run/cleanup.ts b/packages/kbn-dev-utils/src/run/cleanup.ts new file mode 100644 index 0000000000000..84c3bbcb591d2 --- /dev/null +++ b/packages/kbn-dev-utils/src/run/cleanup.ts @@ -0,0 +1,94 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { inspect } from 'util'; + +import exitHook from 'exit-hook'; + +import { ToolingLog } from '../tooling_log'; +import { isFailError } from './fail'; + +export type CleanupTask = () => void; + +export class Cleanup { + static setup(log: ToolingLog, helpText: string) { + const onUnhandledRejection = (error: any) => { + log.error('UNHANDLED PROMISE REJECTION'); + log.error( + error instanceof Error + ? error + : new Error(`non-Error type rejection value: ${inspect(error)}`) + ); + process.exit(1); + }; + + process.on('unhandledRejection', onUnhandledRejection); + + const cleanup = new Cleanup(log, helpText, [ + () => process.removeListener('unhandledRejection', onUnhandledRejection), + ]); + + cleanup.add(exitHook(() => cleanup.execute())); + + return cleanup; + } + + constructor( + private readonly log: ToolingLog, + public helpText: string, + private readonly tasks: CleanupTask[] + ) {} + + add(task: CleanupTask) { + this.tasks.push(task); + } + + execute(topLevelError?: any) { + const tasks = this.tasks.slice(0); + this.tasks.length = 0; + + for (const task of tasks) { + try { + task(); + } catch (error) { + this.onError(error); + } + } + + if (topLevelError) { + this.onError(topLevelError); + } + } + + private onError(error: any) { + if (isFailError(error)) { + this.log.error(error.message); + + if (error.showHelp) { + this.log.write(this.helpText); + } + + process.exitCode = error.exitCode; + } else { + this.log.error('UNHANDLED ERROR'); + this.log.error(error); + process.exitCode = 1; + } + } +} diff --git a/packages/kbn-dev-utils/src/run/flags.test.ts b/packages/kbn-dev-utils/src/run/flags.test.ts index c730067a84f46..f6ff70b7abeb4 100644 --- a/packages/kbn-dev-utils/src/run/flags.test.ts +++ b/packages/kbn-dev-utils/src/run/flags.test.ts @@ -22,14 +22,12 @@ import { getFlags } from './flags'; it('gets flags correctly', () => { expect( getFlags(['-a', '--abc=bcd', '--foo=bar', '--no-bar', '--foo=baz', '--box', 'yes', '-zxy'], { - flags: { - boolean: ['x'], - string: ['abc'], - alias: { - x: 'extra', - }, - allowUnexpected: true, + boolean: ['x'], + string: ['abc'], + alias: { + x: 'extra', }, + allowUnexpected: true, }) ).toMatchInlineSnapshot(` Object { @@ -60,10 +58,8 @@ it('gets flags correctly', () => { it('guesses types for unexpected flags', () => { expect( getFlags(['-abc', '--abc=bcd', '--no-foo', '--bar'], { - flags: { - allowUnexpected: true, - guessTypesForUnexpectedFlags: true, - }, + allowUnexpected: true, + guessTypesForUnexpectedFlags: true, }) ).toMatchInlineSnapshot(` Object { diff --git a/packages/kbn-dev-utils/src/run/flags.ts b/packages/kbn-dev-utils/src/run/flags.ts index c809a40d8512b..12642bceca15a 100644 --- a/packages/kbn-dev-utils/src/run/flags.ts +++ b/packages/kbn-dev-utils/src/run/flags.ts @@ -17,12 +17,9 @@ * under the License. */ -import { relative } from 'path'; - -import dedent from 'dedent'; import getopts from 'getopts'; -import { Options } from './run'; +import { RunOptions } from './run'; export interface Flags { verbose: boolean; @@ -36,23 +33,52 @@ export interface Flags { [key: string]: undefined | boolean | string | string[]; } -export function getFlags(argv: string[], options: Options): Flags { +export interface FlagOptions { + allowUnexpected?: boolean; + guessTypesForUnexpectedFlags?: boolean; + help?: string; + alias?: { [key: string]: string | string[] }; + boolean?: string[]; + string?: string[]; + default?: { [key: string]: any }; +} + +export function mergeFlagOptions(global: FlagOptions = {}, local: FlagOptions = {}): FlagOptions { + return { + alias: { + ...global.alias, + ...local.alias, + }, + boolean: [...(global.boolean || []), ...(local.boolean || [])], + string: [...(global.string || []), ...(local.string || [])], + default: { + ...global.alias, + ...local.alias, + }, + + help: local.help, + + allowUnexpected: !!(global.allowUnexpected || local.allowUnexpected), + guessTypesForUnexpectedFlags: !!(global.allowUnexpected || local.allowUnexpected), + }; +} + +export function getFlags(argv: string[], flagOptions: RunOptions['flags'] = {}): Flags { const unexpectedNames = new Set(); - const flagOpts = options.flags || {}; const { verbose, quiet, silent, debug, help, _, ...others } = getopts(argv, { - string: flagOpts.string, - boolean: [...(flagOpts.boolean || []), 'verbose', 'quiet', 'silent', 'debug', 'help'], + string: flagOptions.string, + boolean: [...(flagOptions.boolean || []), 'verbose', 'quiet', 'silent', 'debug', 'help'], alias: { - ...(flagOpts.alias || {}), + ...flagOptions.alias, v: 'verbose', }, - default: flagOpts.default, + default: flagOptions.default, unknown: (name: string) => { unexpectedNames.add(name); - return flagOpts.guessTypesForUnexpectedFlags; + return !!flagOptions.guessTypesForUnexpectedFlags; }, - } as any); + }); const unexpected: string[] = []; for (const unexpectedName of unexpectedNames) { @@ -119,32 +145,3 @@ export function getFlags(argv: string[], options: Options): Flags { ...others, }; } - -export function getHelp(options: Options) { - const usage = options.usage || `node ${relative(process.cwd(), process.argv[1])}`; - - const optionHelp = ( - dedent(options?.flags?.help || '') + - '\n' + - dedent` - --verbose, -v Log verbosely - --debug Log debug messages (less than verbose) - --quiet Only log errors - --silent Don't log anything - --help Show this message - ` - ) - .split('\n') - .filter(Boolean) - .join('\n '); - - return ` - ${usage} - - ${dedent(options.description || 'Runs a dev task') - .split('\n') - .join('\n ')} - - Options: - ${optionHelp + '\n\n'}`; -} diff --git a/packages/kbn-dev-utils/src/run/help.test.ts b/packages/kbn-dev-utils/src/run/help.test.ts new file mode 100644 index 0000000000000..27be7ad28b81a --- /dev/null +++ b/packages/kbn-dev-utils/src/run/help.test.ts @@ -0,0 +1,199 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { getCommandLevelHelp, getHelp, getHelpForAllCommands } from './help'; +import { Command } from './run_with_commands'; + +const fooCommand: Command = { + description: ` + Some thing that we wrote to help us execute things. + + Example: + + foo = bar = baz + + Are you getting it? + `, + name: 'foo', + run: () => {}, + flags: { + help: ` + --foo Some flag + --bar Another flag + Secondary info + --baz, -b Hey hello + `, + }, + usage: 'foo [...names]', +}; + +const barCommand: Command = { + description: ` + Some other thing that we wrote to help us execute things. + `, + name: 'bar', + run: () => {}, + flags: { + help: ` + --baz, -b Hey hello + `, + }, + usage: 'bar [...names]', +}; + +describe('getHelp()', () => { + it('returns the expected output', () => { + expect( + getHelp({ + description: fooCommand.description, + flagHelp: fooCommand.flags?.help, + usage: ` + node scripts/foo --bar --baz + `, + }) + ).toMatchInlineSnapshot(` + " + node scripts/foo --bar --baz + + Some thing that we wrote to help us execute things. + + Example: + + foo = bar = baz + + Are you getting it? + + Options: + --foo Some flag + --bar Another flag + Secondary info + --baz, -b Hey hello + --verbose, -v Log verbosely + --debug Log debug messages (less than verbose) + --quiet Only log errors + --silent Don't log anything + --help Show this message + + " + `); + }); +}); + +describe('getCommandLevelHelp()', () => { + it('returns the expected output', () => { + expect( + getCommandLevelHelp({ + command: fooCommand, + globalFlagHelp: ` + --global-flag some flag that applies to all commands + `, + }) + ).toMatchInlineSnapshot(` + " + node node_modules/jest-worker/build/workers/processChild.js foo [...names] + + Some thing that we wrote to help us execute things. + + Example: + + foo = bar = baz + + Are you getting it? + + Command-specific options: + --foo Some flag + --bar Another flag + Secondary info + --baz, -b Hey hello + + Global options: + --global-flag some flag that applies to all commands + --verbose, -v Log verbosely + --debug Log debug messages (less than verbose) + --quiet Only log errors + --silent Don't log anything + --help Show this message + + To see the help for other commands run: + node node_modules/jest-worker/build/workers/processChild.js help [command] + + To see the list of commands run: + node node_modules/jest-worker/build/workers/processChild.js --help + + " + `); + }); +}); + +describe('getHelpForAllCommands()', () => { + it('returns the expected output', () => { + expect( + getHelpForAllCommands({ + commands: [fooCommand, barCommand], + globalFlagHelp: ` + --global-flag some flag that applies to all commands + `, + usage: ` + node scripts/my_cli + `, + }) + ).toMatchInlineSnapshot(` + " + node scripts/my_cli [command] [...args] + + Runs a dev task + + Commands: + foo [...names] + Some thing that we wrote to help us execute things. + + Example: + + foo = bar = baz + + Are you getting it? + + Options: + --foo Some flag + --bar Another flag + Secondary info + --baz, -b Hey hello + + bar [...names] + Some other thing that we wrote to help us execute things. + + Options: + --baz, -b Hey hello + + + Global options: + --global-flag some flag that applies to all commands + --verbose, -v Log verbosely + --debug Log debug messages (less than verbose) + --quiet Only log errors + --silent Don't log anything + --help Show this message + + To show the help information about a specific command run: + node scripts/my_cli help [command] + + " + `); + }); +}); diff --git a/packages/kbn-dev-utils/src/run/help.ts b/packages/kbn-dev-utils/src/run/help.ts new file mode 100644 index 0000000000000..351c01da5ebe2 --- /dev/null +++ b/packages/kbn-dev-utils/src/run/help.ts @@ -0,0 +1,150 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import Path from 'path'; + +import 'core-js/features/string/repeat'; +import dedent from 'dedent'; + +import { Command } from './run_with_commands'; + +const DEFAULT_GLOBAL_USAGE = `node ${Path.relative(process.cwd(), process.argv[1])}`; +export const GLOBAL_FLAGS = dedent` + --verbose, -v Log verbosely + --debug Log debug messages (less than verbose) + --quiet Only log errors + --silent Don't log anything + --help Show this message +`; + +export function indent(str: string, depth: number) { + const prefix = ' '.repeat(depth); + return str + .split('\n') + .map((line, i) => `${i > 0 ? `\n${prefix}` : ''}${line}`) + .join(''); +} + +export function joinAndTrimLines(...strings: Array) { + return strings.filter(Boolean).join('\n').split('\n').filter(Boolean).join(`\n`); +} + +export function getHelp({ + description, + usage, + flagHelp, +}: { + description?: string; + usage?: string; + flagHelp?: string; +}) { + const optionHelp = joinAndTrimLines(dedent(flagHelp || ''), GLOBAL_FLAGS); + + return ` + ${dedent(usage || '') || DEFAULT_GLOBAL_USAGE} + + ${indent(dedent(description || 'Runs a dev task'), 2)} + + Options: + ${indent(optionHelp, 4)}\n\n`; +} + +export function getCommandLevelHelp({ + usage, + globalFlagHelp, + command, +}: { + usage?: string; + globalFlagHelp?: string; + command: Command; +}) { + const globalUsage = dedent(usage || '') || DEFAULT_GLOBAL_USAGE; + const globalHelp = joinAndTrimLines(dedent(globalFlagHelp || ''), GLOBAL_FLAGS); + + const commandUsage = dedent(command.usage || '') || `${command.name} [...args]`; + const commandFlags = joinAndTrimLines(dedent(command.flags?.help || '')); + + return ` + ${globalUsage} ${commandUsage} + + ${indent(dedent(command.description || 'Runs a dev task'), 2)} + + Command-specific options: + ${indent(commandFlags, 4)} + + Global options: + ${indent(globalHelp, 4)} + + To see the help for other commands run: + ${globalUsage} help [command] + + To see the list of commands run: + ${globalUsage} --help\n\n`; +} + +export function getHelpForAllCommands({ + description, + usage, + globalFlagHelp, + commands, +}: { + description?: string; + usage?: string; + globalFlagHelp?: string; + commands: Array>; +}) { + const globalUsage = dedent(usage || '') || DEFAULT_GLOBAL_USAGE; + const globalHelp = joinAndTrimLines(dedent(globalFlagHelp || ''), GLOBAL_FLAGS); + + const commandsHelp = commands + .map((command) => { + const options = command.flags?.help + ? '\n' + + dedent` + Options: + ${indent( + joinAndTrimLines(dedent(command.flags?.help || '')), + ' '.length + )} + ` + + '\n' + : ''; + + return [ + dedent(command.usage || '') || command.name, + ` ${indent(dedent(command.description || 'Runs a dev task'), 2)}`, + ...([indent(options, 2)] || []), + ].join('\n'); + }) + .join('\n'); + + return ` + ${globalUsage} [command] [...args] + + ${indent(dedent(description || 'Runs a dev task'), 2)} + + Commands: + ${indent(commandsHelp, 4)} + + Global options: + ${indent(globalHelp, 4)} + + To show the help information about a specific command run: + ${globalUsage} help [command]\n\n`; +} diff --git a/packages/kbn-dev-utils/src/run/index.ts b/packages/kbn-dev-utils/src/run/index.ts index 5e1a42deefffb..070ce740bf202 100644 --- a/packages/kbn-dev-utils/src/run/index.ts +++ b/packages/kbn-dev-utils/src/run/index.ts @@ -17,6 +17,7 @@ * under the License. */ -export { run } from './run'; -export { Flags } from './flags'; -export { createFailError, createFlagError, combineErrors, isFailError } from './fail'; +export * from './run'; +export * from './run_with_commands'; +export * from './flags'; +export * from './fail'; diff --git a/packages/kbn-dev-utils/src/run/run.ts b/packages/kbn-dev-utils/src/run/run.ts index 029d428565163..2a844bcbc27eb 100644 --- a/packages/kbn-dev-utils/src/run/run.ts +++ b/packages/kbn-dev-utils/src/run/run.ts @@ -17,48 +17,37 @@ * under the License. */ -import { inspect } from 'util'; - -// @ts-ignore @types are outdated and module is super simple -import exitHook from 'exit-hook'; - import { pickLevelFromFlags, ToolingLog, LogLevel } from '../tooling_log'; -import { createFlagError, isFailError } from './fail'; -import { Flags, getFlags, getHelp } from './flags'; +import { createFlagError } from './fail'; +import { Flags, getFlags, FlagOptions } from './flags'; import { ProcRunner, withProcRunner } from '../proc_runner'; +import { getHelp } from './help'; +import { CleanupTask, Cleanup } from './cleanup'; -type CleanupTask = () => void; -type RunFn = (args: { +export interface RunContext { log: ToolingLog; flags: Flags; procRunner: ProcRunner; addCleanupTask: (task: CleanupTask) => void; -}) => Promise | void; +} +export type RunFn = (context: RunContext) => Promise | void; -export interface Options { +export interface RunOptions { usage?: string; description?: string; log?: { defaultLevel?: LogLevel; }; - flags?: { - allowUnexpected?: boolean; - guessTypesForUnexpectedFlags?: boolean; - help?: string; - alias?: { [key: string]: string | string[] }; - boolean?: string[]; - string?: string[]; - default?: { [key: string]: any }; - }; + flags?: FlagOptions; } -export async function run(fn: RunFn, options: Options = {}) { - const flags = getFlags(process.argv.slice(2), options); - - if (flags.help) { - process.stderr.write(getHelp(options)); - process.exit(1); - } +export async function run(fn: RunFn, options: RunOptions = {}) { + const flags = getFlags(process.argv.slice(2), options.flags); + const helpText = getHelp({ + description: options.description, + usage: options.usage, + flagHelp: options.flags?.help, + }); const log = new ToolingLog({ level: pickLevelFromFlags(flags, { @@ -67,67 +56,33 @@ export async function run(fn: RunFn, options: Options = {}) { writeTo: process.stdout, }); - process.on('unhandledRejection', (error) => { - log.error('UNHANDLED PROMISE REJECTION'); - log.error( - error instanceof Error - ? error - : new Error(`non-Error type rejection value: ${inspect(error)}`) - ); - process.exit(1); - }); - - const handleErrorWithoutExit = (error: any) => { - if (isFailError(error)) { - log.error(error.message); - - if (error.showHelp) { - log.write(getHelp(options)); - } - - process.exitCode = error.exitCode; - } else { - log.error('UNHANDLED ERROR'); - log.error(error); - process.exitCode = 1; - } - }; - - const doCleanup = () => { - const tasks = cleanupTasks.slice(0); - cleanupTasks.length = 0; + if (flags.help) { + log.write(helpText); + process.exit(); + } - for (const task of tasks) { - try { - task(); - } catch (error) { - handleErrorWithoutExit(error); - } - } - }; + const cleanup = Cleanup.setup(log, helpText); - const unhookExit: CleanupTask = exitHook(doCleanup); - const cleanupTasks: CleanupTask[] = [unhookExit]; + if (!options.flags?.allowUnexpected && flags.unexpected.length) { + const error = createFlagError(`Unknown flag(s) "${flags.unexpected.join('", "')}"`); + cleanup.execute(error); + return; + } try { - if (!options.flags?.allowUnexpected && flags.unexpected.length) { - throw createFlagError(`Unknown flag(s) "${flags.unexpected.join('", "')}"`); - } - - try { - await withProcRunner(log, async (procRunner) => { - await fn({ - log, - flags, - procRunner, - addCleanupTask: (task: CleanupTask) => cleanupTasks.push(task), - }); + await withProcRunner(log, async (procRunner) => { + await fn({ + log, + flags, + procRunner, + addCleanupTask: cleanup.add.bind(cleanup), }); - } finally { - doCleanup(); - } + }); } catch (error) { - handleErrorWithoutExit(error); + cleanup.execute(error); + // process.exitCode is set by `cleanup` when necessary process.exit(); + } finally { + cleanup.execute(); } } diff --git a/packages/kbn-dev-utils/src/run/run_with_commands.test.ts b/packages/kbn-dev-utils/src/run/run_with_commands.test.ts new file mode 100644 index 0000000000000..eb7708998751c --- /dev/null +++ b/packages/kbn-dev-utils/src/run/run_with_commands.test.ts @@ -0,0 +1,77 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { RunWithCommands } from './run_with_commands'; +import { ToolingLog, ToolingLogCollectingWriter } from '../tooling_log'; +import { ProcRunner } from '../proc_runner'; + +const testLog = new ToolingLog(); +const testLogWriter = new ToolingLogCollectingWriter(); +testLog.setWriters([testLogWriter]); + +const testCli = new RunWithCommands({ + usage: 'node scripts/test_cli [...options]', + description: 'test cli', + extendContext: async () => { + return { + extraContext: true, + }; + }, + globalFlags: { + boolean: ['some-bool'], + help: ` + --some-bool description + `, + }, +}); + +beforeEach(() => { + process.argv = ['node', 'scripts/test_cli', 'foo', '--some-bool']; + jest.clearAllMocks(); +}); + +it('extends the context using extendContext()', async () => { + const context: any = await new Promise((resolve) => { + testCli.command({ name: 'foo', description: 'some command', run: resolve }).execute(); + }); + + expect(context).toEqual({ + log: expect.any(ToolingLog), + flags: expect.any(Object), + addCleanupTask: expect.any(Function), + procRunner: expect.any(ProcRunner), + extraContext: true, + }); + + expect(context.flags).toMatchInlineSnapshot(` + Object { + "_": Array [ + "foo", + ], + "debug": false, + "help": false, + "quiet": false, + "silent": false, + "some-bool": true, + "unexpected": Array [], + "v": false, + "verbose": false, + } + `); +}); diff --git a/packages/kbn-dev-utils/src/run/run_with_commands.ts b/packages/kbn-dev-utils/src/run/run_with_commands.ts new file mode 100644 index 0000000000000..9fb069e4b2d35 --- /dev/null +++ b/packages/kbn-dev-utils/src/run/run_with_commands.ts @@ -0,0 +1,136 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { ToolingLog, pickLevelFromFlags } from '../tooling_log'; +import { RunContext, RunOptions } from './run'; +import { getFlags, FlagOptions, mergeFlagOptions } from './flags'; +import { Cleanup } from './cleanup'; +import { getHelpForAllCommands, getCommandLevelHelp } from './help'; +import { createFlagError } from './fail'; +import { withProcRunner } from '../proc_runner'; + +export type CommandRunFn = (context: RunContext & T) => Promise | void; + +export interface Command { + name: string; + run: CommandRunFn; + description: RunOptions['description']; + usage?: RunOptions['usage']; + flags?: FlagOptions; +} + +export interface RunWithCommandsOptions { + log?: RunOptions['log']; + description?: RunOptions['description']; + usage?: RunOptions['usage']; + globalFlags?: FlagOptions; + extendContext?(context: RunContext): Promise | T; +} + +export class RunWithCommands { + constructor( + private readonly options: RunWithCommandsOptions, + private readonly commands: Array> = [] + ) {} + + command(options: Command) { + return new RunWithCommands(this.options, this.commands.concat(options)); + } + + async execute() { + const globalFlags = getFlags(process.argv.slice(2), { + allowUnexpected: true, + }); + + const isHelpCommand = globalFlags._[0] === 'help'; + const commandName = isHelpCommand ? globalFlags._[1] : globalFlags._[0]; + const command = this.commands.find((c) => c.name === commandName); + const log = new ToolingLog({ + level: pickLevelFromFlags(globalFlags, { + default: this.options.log?.defaultLevel, + }), + writeTo: process.stdout, + }); + + const globalHelp = getHelpForAllCommands({ + description: this.options.description, + usage: this.options.usage, + globalFlagHelp: this.options.globalFlags?.help, + commands: this.commands, + }); + const cleanup = Cleanup.setup(log, globalHelp); + + if (!command) { + if (globalFlags.help) { + log.write(globalHelp); + process.exit(); + } + + const error = createFlagError( + commandName ? `unknown command [${commandName}]` : `missing command name` + ); + cleanup.execute(error); + process.exit(1); + } + + const commandFlagOptions = mergeFlagOptions(this.options.globalFlags, command.flags); + const commandFlags = getFlags(process.argv.slice(2), commandFlagOptions); + const commandHelp = getCommandLevelHelp({ + usage: this.options.usage, + globalFlagHelp: this.options.globalFlags?.help, + command, + }); + cleanup.helpText = commandHelp; + + if (commandFlags.help || isHelpCommand) { + cleanup.execute(); + log.write(commandHelp); + process.exit(); + } + + if (!commandFlagOptions.allowUnexpected && commandFlags.unexpected.length) { + cleanup.execute(createFlagError(`Unknown flag(s) "${commandFlags.unexpected.join('", "')}"`)); + return; + } + + try { + await withProcRunner(log, async (procRunner) => { + const context: RunContext = { + log, + flags: commandFlags, + procRunner, + addCleanupTask: cleanup.add, + }; + + const extendedContext = { + ...context, + ...(this.options.extendContext ? await this.options.extendContext(context) : ({} as T)), + }; + + await command.run(extendedContext); + }); + } catch (error) { + cleanup.execute(error); + // exitCode is set by `cleanup` when necessary + process.exit(); + } finally { + cleanup.execute(); + } + } +} From f487867fda2f3c5386d28525dd72958af5fbc81a Mon Sep 17 00:00:00 2001 From: "Devin W. Hurley" Date: Fri, 17 Jul 2020 17:13:34 -0400 Subject: [PATCH 39/59] [SIEM] Updates consumer in export_rule archive (#72324) --- .../es_archives/export_rule/data.json.gz | Bin 1911 -> 1931 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/x-pack/test/security_solution_cypress/es_archives/export_rule/data.json.gz b/x-pack/test/security_solution_cypress/es_archives/export_rule/data.json.gz index 3c1a0f663a8eeb58dbe0626b067a086f52f975ef..373251d9e4f93d8097029345aa45aba959dd7a08 100644 GIT binary patch literal 1931 zcmV;62Xy!!iwFpN;}Kr~17u-zVJ>QOZ*Bn9Sy@x#Iu?HCS9tPtmv&;ud#3IKTLYIR z&ZcOR0rP zQ2QVk9uO6B(g59I2*>4As>POSO?7>VDL8Jp<)Rq+A^0 zu@tQjiH~B`)29@ch%9*7K`FGC7UWXENfI+y{MT&p-yceJDbfYoPjdSh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u^}3En^icod?e3L*7n)g;6tA2MFL%AtLqPcfjYgRu{50yrgi2)fKppF@X_Y?Z z$sx)n9!XEbZ7^vpV~Q$+UvZ194}jBlE&XQw`^PIdtegmCJAO(c*rxC4)-RF>BdF@v zBCffXQI5FtgCbroxqmX^(hloqM%*NUUJpQaVntB-W?-< xLDFU@fKNkh2h~6E&12KBLryNdYc_wKD?zdIsy70;m8n%L=YRStDGUA`001%rx*-4n From f0d3cb96a4bc453150b74ecef923e5423571c647 Mon Sep 17 00:00:00 2001 From: Chris Roberson Date: Fri, 17 Jul 2020 17:15:25 -0400 Subject: [PATCH 40/59] [Monitoring] Fix issue with ES node detail status (#72298) * Fix issue with ES node detail status * Add test --- .../monitoring/public/alerts/status.tsx | 4 ++ .../components/elasticsearch/node/advanced.js | 4 +- .../elasticsearch/node_detail_status/index.js | 9 ++- .../public/directives/main/index.html | 1 + .../elasticsearch/node/advanced/index.js | 17 +++++- .../monitoring/elasticsearch/node_detail.js | 59 +++++++++++++++++++ .../monitoring/elasticsearch_node_detail.js | 4 ++ 7 files changed, 92 insertions(+), 6 deletions(-) diff --git a/x-pack/plugins/monitoring/public/alerts/status.tsx b/x-pack/plugins/monitoring/public/alerts/status.tsx index d15dcc9974863..9c262884d7257 100644 --- a/x-pack/plugins/monitoring/public/alerts/status.tsx +++ b/x-pack/plugins/monitoring/public/alerts/status.tsx @@ -20,6 +20,10 @@ interface Props { export const AlertsStatus: React.FC = (props: Props) => { const { alerts, showBadge = false, showOnlyCount = false } = props; + if (!alerts) { + return null; + } + let atLeastOneDanger = false; const count = Object.values(alerts).reduce((cnt, alertStatus) => { if (alertStatus.states.length) { diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/node/advanced.js b/x-pack/plugins/monitoring/public/components/elasticsearch/node/advanced.js index 6fea34ed9c901..b2a17515bbb96 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/node/advanced.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/node/advanced.js @@ -19,7 +19,7 @@ import { NodeDetailStatus } from '../node_detail_status'; import { MonitoringTimeseriesContainer } from '../../chart'; import { FormattedMessage } from '@kbn/i18n/react'; -export const AdvancedNode = ({ nodeSummary, metrics, ...props }) => { +export const AdvancedNode = ({ nodeSummary, metrics, alerts, ...props }) => { const metricsToShow = [ metrics.node_gc, metrics.node_gc_time, @@ -50,7 +50,7 @@ export const AdvancedNode = ({ nodeSummary, metrics, ...props }) => { - + diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/node_detail_status/index.js b/x-pack/plugins/monitoring/public/components/elasticsearch/node_detail_status/index.js index 18533b3bd4b5e..85b4d0daddade 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/node_detail_status/index.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/node_detail_status/index.js @@ -9,8 +9,9 @@ import { SummaryStatus } from '../../summary_status'; import { NodeStatusIcon } from '../node'; import { formatMetric } from '../../../lib/format_number'; import { i18n } from '@kbn/i18n'; +import { AlertsStatus } from '../../../alerts/status'; -export function NodeDetailStatus({ stats, alerts }) { +export function NodeDetailStatus({ stats, alerts = {} }) { const { transport_address: transportAddress, usedHeap, @@ -29,8 +30,10 @@ export function NodeDetailStatus({ stats, alerts }) { const metrics = [ { - label: 'Alerts', - value: {Object.values(alerts).length}, + label: i18n.translate('xpack.monitoring.elasticsearch.nodeDetailStatus.alerts', { + defaultMessage: 'Alerts', + }), + value: , }, { label: i18n.translate('xpack.monitoring.elasticsearch.nodeDetailStatus.transportAddress', { diff --git a/x-pack/plugins/monitoring/public/directives/main/index.html b/x-pack/plugins/monitoring/public/directives/main/index.html index 39d357813b3f2..fabd207d72b1f 100644 --- a/x-pack/plugins/monitoring/public/directives/main/index.html +++ b/x-pack/plugins/monitoring/public/directives/main/index.html @@ -90,6 +90,7 @@ { + describe('Active Nodes', () => { + const { setup, tearDown } = getLifecycleMethods(getService, getPageObjects); + + before(async () => { + await setup('monitoring/singlecluster-three-nodes-shard-relocation', { + from: 'Oct 5, 2017 @ 20:31:48.354', + to: 'Oct 5, 2017 @ 20:35:12.176', + }); + + // go to nodes listing + await overview.clickEsNodes(); + expect(await nodesList.isOnListing()).to.be(true); + }); + + after(async () => { + await tearDown(); + }); + + afterEach(async () => { + await PageObjects.monitoring.clickBreadcrumb('~breadcrumbEsNodes'); // return back for next test + }); + + it('should show node summary of master node with 20 indices and 38 shards', async () => { + await nodesList.clickRowByResolver('jUT5KdxfRbORSCWkb5zjmA'); + await nodeDetail.clickAdvanced(); + + expect(await nodeDetail.getSummary()).to.eql({ + transportAddress: 'Transport Address\n127.0.0.1:9300', + jvmHeap: 'JVM Heap\n29%', + freeDiskSpace: 'Free Disk Space\n173.9 GB (37.42%)', + documentCount: 'Documents\n24.8k', + dataSize: 'Data\n50.4 MB', + indicesCount: 'Indices\n20', + shardsCount: 'Shards\n38', + nodeType: 'Type\nMaster Node', + status: 'Status: Online', + }); + }); + + it('should show node summary of data node with 4 indices and 4 shards', async () => { + await nodesList.clickRowByResolver('bwQWH-7IQY-mFPpfoaoFXQ'); + await nodeDetail.clickAdvanced(); + + expect(await nodeDetail.getSummary()).to.eql({ + transportAddress: 'Transport Address\n127.0.0.1:9302', + jvmHeap: 'JVM Heap\n17%', + freeDiskSpace: 'Free Disk Space\n173.9 GB (37.42%)', + documentCount: 'Documents\n240', + dataSize: 'Data\n1.4 MB', + indicesCount: 'Indices\n4', + shardsCount: 'Shards\n4', + nodeType: 'Type\nNode', + status: 'Status: Online', + }); + }); + }); + }); }); } diff --git a/x-pack/test/functional/services/monitoring/elasticsearch_node_detail.js b/x-pack/test/functional/services/monitoring/elasticsearch_node_detail.js index 2cfa7628c0c4b..41b69403829f7 100644 --- a/x-pack/test/functional/services/monitoring/elasticsearch_node_detail.js +++ b/x-pack/test/functional/services/monitoring/elasticsearch_node_detail.js @@ -19,6 +19,10 @@ export function MonitoringElasticsearchNodeDetailProvider({ getService }) { const SUBJ_SUMMARY_STATUS = `${SUBJ_SUMMARY} > statusIcon`; return new (class ElasticsearchNodeDetail { + async clickAdvanced() { + return testSubjects.click('esNodeDetailAdvancedLink'); + } + async getSummary() { return { transportAddress: await testSubjects.getVisibleText(SUBJ_SUMMARY_TRANSPORT_ADDRESS), From 7519c1f8c33ffea28b9e8daacdbebe05080125f3 Mon Sep 17 00:00:00 2001 From: Lee Drengenberg Date: Fri, 17 Jul 2020 16:42:56 -0500 Subject: [PATCH 41/59] use WORKSPACE env var for stack_functional_integration tests, fix navigate path (#71908) Co-authored-by: Elastic Machine --- .../configs/config.stack_functional_integration_base.js | 8 ++++++-- .../test/functional/apps/sample_data/e_commerce.js | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/x-pack/test/stack_functional_integration/configs/config.stack_functional_integration_base.js b/x-pack/test/stack_functional_integration/configs/config.stack_functional_integration_base.js index a34d158496ba0..96d338a04b01b 100644 --- a/x-pack/test/stack_functional_integration/configs/config.stack_functional_integration_base.js +++ b/x-pack/test/stack_functional_integration/configs/config.stack_functional_integration_base.js @@ -12,12 +12,16 @@ import { esTestConfig, kbnTestConfig } from '@kbn/test'; const reportName = 'Stack Functional Integration Tests'; const testsFolder = '../test/functional/apps'; -const stateFilePath = '../../../../../integration-test/qa/envvars.sh'; -const prepend = (testFile) => require.resolve(`${testsFolder}/${testFile}`); const log = new ToolingLog({ level: 'info', writeTo: process.stdout, }); +log.info(`WORKSPACE in config file ${process.env.WORKSPACE}`); +const stateFilePath = process.env.WORKSPACE + ? `${process.env.WORKSPACE}/qa/envvars.sh` + : '../../../../../integration-test/qa/envvars.sh'; + +const prepend = (testFile) => require.resolve(`${testsFolder}/${testFile}`); export default async ({ readConfigFile }) => { const defaultConfigs = await readConfigFile(require.resolve('../../functional/config')); diff --git a/x-pack/test/stack_functional_integration/test/functional/apps/sample_data/e_commerce.js b/x-pack/test/stack_functional_integration/test/functional/apps/sample_data/e_commerce.js index 306f30133f6ee..0286f6984e89e 100644 --- a/x-pack/test/stack_functional_integration/test/functional/apps/sample_data/e_commerce.js +++ b/x-pack/test/stack_functional_integration/test/functional/apps/sample_data/e_commerce.js @@ -12,7 +12,7 @@ export default function ({ getService, getPageObjects }) { before(async () => { await browser.setWindowSize(1200, 800); - await PageObjects.common.navigateToUrl('home', '/home/tutorial_directory/sampleData', { + await PageObjects.common.navigateToUrl('home', '/tutorial_directory/sampleData', { useActualUrl: true, insertTimestamp: false, }); From 7aa600bff7250655dbbb80b026c67eed46f2969c Mon Sep 17 00:00:00 2001 From: Lisa Cawley Date: Fri, 17 Jul 2020 14:53:04 -0700 Subject: [PATCH 42/59] [DOCS] Removes occurrences of X-Pack Security and Reporting (#72302) --- docs/dev-tools/grokdebugger/index.asciidoc | 2 +- docs/settings/monitoring-settings.asciidoc | 2 +- docs/setup/install.asciidoc | 4 ++-- .../monitoring/monitoring-kibana.asciidoc | 15 +++++++------ docs/user/reporting/chromium-sandbox.asciidoc | 12 +++++----- .../reporting/configuring-reporting.asciidoc | 10 ++++----- .../user/reporting/development/index.asciidoc | 10 +++++---- docs/user/reporting/gs-index.asciidoc | 2 +- docs/user/reporting/index.asciidoc | 2 +- docs/user/reporting/script-example.asciidoc | 3 ++- docs/user/reporting/watch-example.asciidoc | 2 +- docs/user/security/reporting.asciidoc | 16 +++++++------- docs/user/security/securing-kibana.asciidoc | 22 +++++++++---------- 13 files changed, 54 insertions(+), 48 deletions(-) diff --git a/docs/dev-tools/grokdebugger/index.asciidoc b/docs/dev-tools/grokdebugger/index.asciidoc index 5162e806edd07..994836de7a1a2 100644 --- a/docs/dev-tools/grokdebugger/index.asciidoc +++ b/docs/dev-tools/grokdebugger/index.asciidoc @@ -32,7 +32,7 @@ in ingest node and Logstash. This example walks you through using the *Grok Debugger*. This tool is automatically enabled in {kib}. -NOTE: If you're using {security}, you must have the `manage_pipeline` +NOTE: If you're using {stack-security-features}, you must have the `manage_pipeline` permission to use the Grok Debugger. . Open the menu, go to *Dev Tools*, then click *Grok Debugger*. diff --git a/docs/settings/monitoring-settings.asciidoc b/docs/settings/monitoring-settings.asciidoc index 48b5b5eb5d0c0..5b8fa0725d96b 100644 --- a/docs/settings/monitoring-settings.asciidoc +++ b/docs/settings/monitoring-settings.asciidoc @@ -7,7 +7,7 @@ By default, the Monitoring application is enabled, but data collection is disabled. When you first start {kib} monitoring, you are prompted to -enable data collection. If you are using {security}, you must be +enable data collection. If you are using {stack-security-features}, you must be signed in as a user with the `cluster:manage` privilege to enable data collection. The built-in `superuser` role has this privilege and the built-in `elastic` user has this role. diff --git a/docs/setup/install.asciidoc b/docs/setup/install.asciidoc index 73036da8f1390..cb47210cb3f08 100644 --- a/docs/setup/install.asciidoc +++ b/docs/setup/install.asciidoc @@ -53,8 +53,8 @@ Formulae are available from the Elastic Homebrew tap for installing {kib} on mac <> IMPORTANT: If your Elasticsearch installation is protected by -{ref}/elasticsearch-security.html[{security}] see -{kibana-ref}/using-kibana-with-security.html[Configuring security in Kibana] for +{ref}/elasticsearch-security.html[{stack-security-features}] see +{kibana-ref}/using-kibana-with-security.html[Configuring security in {kib}] for additional setup instructions. include::install/targz.asciidoc[] diff --git a/docs/user/monitoring/monitoring-kibana.asciidoc b/docs/user/monitoring/monitoring-kibana.asciidoc index b9ec3982eb3c5..bb8b3e5d42851 100644 --- a/docs/user/monitoring/monitoring-kibana.asciidoc +++ b/docs/user/monitoring/monitoring-kibana.asciidoc @@ -20,9 +20,10 @@ node in the production cluster. By default, it is is disabled (`false`). + -- NOTE: You can specify this setting in either the `elasticsearch.yml` on each -node or across the cluster as a dynamic cluster setting. If {es} -{security-features} are enabled, you must have `monitor` cluster privileges to -view the cluster settings and `manage` cluster privileges to change them. +node or across the cluster as a dynamic cluster setting. If +{stack-security-features} are enabled, you must have `monitor` cluster +privileges to view the cluster settings and `manage` cluster privileges to +change them. -- @@ -33,7 +34,7 @@ view the cluster settings and `manage` cluster privileges to change them. -- By default, if you are running {kib} locally, go to `http://localhost:5601/`. -If {es} {security-features} are enabled, log in. +If {security-features} are enabled, log in. -- ... Open the menu, then go to *Stack Monitoring*. If data collection is @@ -80,13 +81,13 @@ monitoring cluster prevents production cluster outages from impacting your ability to access your monitoring data. It also prevents monitoring activities from impacting the performance of your production cluster. -If {security} is enabled on the production cluster, use an HTTPS URL such -as `https://:9200` in this setting. +If {security-features} are enabled on the production cluster, use an HTTPS +URL such as `https://:9200` in this setting. =============================== -- -. If the Elastic {security-features} are enabled on the production cluster: +. If {security-features} are enabled on the production cluster: .. Verify that there is a valid user ID and password in the `elasticsearch.username` and diff --git a/docs/user/reporting/chromium-sandbox.asciidoc b/docs/user/reporting/chromium-sandbox.asciidoc index bfef5b8b86c6b..dcb421261c067 100644 --- a/docs/user/reporting/chromium-sandbox.asciidoc +++ b/docs/user/reporting/chromium-sandbox.asciidoc @@ -2,14 +2,16 @@ [[reporting-chromium-sandbox]] === Chromium sandbox -When {reporting} uses the Chromium browser for generating PDF reports, it's recommended to use the sandbox for -an additional layer of security. The Chromium sandbox uses operating system provided mechanisms to ensure that -code execution cannot make persistent changes to the computer or access confidential information. The specific -sandboxing techniques differ for each operating system. +When {report-features} uses the Chromium browser for generating PDF reports, +it's recommended to use the sandbox for an additional layer of security. The +Chromium sandbox uses operating system provided mechanisms to ensure that +code execution cannot make persistent changes to the computer or access +confidential information. The specific sandboxing techniques differ for each +operating system. ==== Linux sandbox The Linux sandbox depends on user namespaces, which were introduced with the 3.8 Linux kernel. However, many -distributions don't have user namespaces enabled by default, or they require the CAP_SYS_ADMIN capability. {reporting} +distributions don't have user namespaces enabled by default, or they require the CAP_SYS_ADMIN capability. The {report-features} will automatically disable the sandbox when it is running on Debian and CentOS as additional steps are required to enable unprivileged usernamespaces. In these situations, you'll see the following message in your {kib} startup logs: `Chromium sandbox provides an additional layer of protection, but is not supported for your OS. diff --git a/docs/user/reporting/configuring-reporting.asciidoc b/docs/user/reporting/configuring-reporting.asciidoc index 7489e2cf51f61..ca2d79bb2dec0 100644 --- a/docs/user/reporting/configuring-reporting.asciidoc +++ b/docs/user/reporting/configuring-reporting.asciidoc @@ -2,8 +2,8 @@ [[configuring-reporting]] == Reporting configuration -You can configure settings in `kibana.yml` to control how {reporting} -communicates with the {kib} server, manages background jobs, and captures +You can configure settings in `kibana.yml` to control how the {report-features} +communicate with the {kib} server, manages background jobs, and captures screenshots. See <> for the complete list of settings. @@ -11,9 +11,9 @@ list of settings. [[encryption-keys]] === Encryption keys for multiple {kib} instances -By default, a new encryption key is generated for {reporting} each time -you start {kib}. This means if a static encryption key is not persisted in the -{kib} configuration, any pending reports will fail when you restart {kib}. +By default, a new encryption key is generated for the {report-features} each +time you start {kib}. This means if a static encryption key is not persisted in +the {kib} configuration, any pending reports will fail when you restart {kib}. If you are load balancing across multiple {kib} instances, they need to have the same reporting encryption key. Otherwise, report generation will fail if a diff --git a/docs/user/reporting/development/index.asciidoc b/docs/user/reporting/development/index.asciidoc index a64e540da0c70..4e86c803bd82d 100644 --- a/docs/user/reporting/development/index.asciidoc +++ b/docs/user/reporting/development/index.asciidoc @@ -1,9 +1,11 @@ [role="xpack"] [[reporting-integration]] == Reporting integration -Integrating a {kib} application with {reporting} requires a minimum amount of code, and the goal is to not have to -modify the Reporting code as we add additional applications. Instead, applications abide by a contract that Reporting -uses to determine the information that is required to export CSVs and PDFs. +Integrating a {kib} application with the {report-features} requires a minimum +amount of code, and the goal is to not have to modify the reporting code as we +add additional applications. Instead, applications abide by a contract that +{report-features} use to determine the information that is required to export +CSVs and PDFs. [IMPORTANT] ============================================== @@ -18,7 +20,7 @@ X-Pack uses the `share` plugin of the Kibana platform to register actions in the [float] === Generate job URL -To generate a new {reporting} job, different export types require different `jobParams` that are Rison encoded into a URL +To generate a new reporting job, different export types require different `jobParams` that are Rison encoded into a URL that abide by the following convention: `/api/reporting/generate?jobParams=${rison.encode(jobParams)}`. If you use the aforementioned <> then this detail will be abstracted away, but if you provide a custom UI for generating the report, you will have to generate the URL and create a POST request to the URL. diff --git a/docs/user/reporting/gs-index.asciidoc b/docs/user/reporting/gs-index.asciidoc index 87918ee76340e..46c1fd38b7d69 100644 --- a/docs/user/reporting/gs-index.asciidoc +++ b/docs/user/reporting/gs-index.asciidoc @@ -21,7 +21,7 @@ You can also <>. IMPORTANT: Reports are stored in the `.reporting-*` indices. Any user with access to these indices has access to every report generated by all users. -To use {reporting} in a production environment, +To use {report-features} in a production environment, <>. -- diff --git a/docs/user/reporting/index.asciidoc b/docs/user/reporting/index.asciidoc index 6acdbbe3f0a99..e4e4b461ac2bd 100644 --- a/docs/user/reporting/index.asciidoc +++ b/docs/user/reporting/index.asciidoc @@ -19,7 +19,7 @@ image::user/reporting/images/share-button.png["Share"] [float] == Setup -{reporting} is automatically enabled in {kib}. It runs a custom build of the Chromium web browser, which +The {report-features} are automatically enabled in {kib}. It runs a custom build of the Chromium web browser, which runs on the server in headless mode to load {kib} and capture the rendered {kib} charts as images. Chromium is an open-source project not related to Elastic, but the Chromium binary for {kib} has been custom-built by Elastic to ensure it diff --git a/docs/user/reporting/script-example.asciidoc b/docs/user/reporting/script-example.asciidoc index 88f48ad1d3182..94301fc6fb448 100644 --- a/docs/user/reporting/script-example.asciidoc +++ b/docs/user/reporting/script-example.asciidoc @@ -19,7 +19,8 @@ curl \ // CONSOLE <1> `POST` method is required. -<2> Provide user credentials for a user with permission to access Kibana and X-Pack reporting. +<2> Provide user credentials for a user with permission to access Kibana and +{report-features}. <3> The `kbn-version` header is required for all `POST` requests to Kibana. **The value must match the dotted-numeral version of the Kibana instance.** <4> The POST URL. You can copy and paste the URL for any report from the Kibana UI. diff --git a/docs/user/reporting/watch-example.asciidoc b/docs/user/reporting/watch-example.asciidoc index 627e31017230c..253722fefecc0 100644 --- a/docs/user/reporting/watch-example.asciidoc +++ b/docs/user/reporting/watch-example.asciidoc @@ -52,7 +52,7 @@ report from the Kibana UI. <3> Optional, default is 40 <4> Optional, default is 15s <5> Provide user credentials for a user with permission to access Kibana and -{reporting}. +the {report-features}. //For more information, see <>. //<>. diff --git a/docs/user/security/reporting.asciidoc b/docs/user/security/reporting.asciidoc index 30340e1db989a..4e02759ce99cb 100644 --- a/docs/user/security/reporting.asciidoc +++ b/docs/user/security/reporting.asciidoc @@ -5,8 +5,8 @@ Reporting operates by creating and updating documents in {es} in response to user actions in {kib}. -To use {reporting} with {security} enabled, you need to -<>. +To use {report-features} with {security-features} enabled, you need to +<>. If you are automatically generating reports with {ref}/xpack-alerting.html[{watcher}], you also need to configure {watcher} to trust the {kib} server's certificate. @@ -118,10 +118,10 @@ reporting_user: === Secure the reporting endpoints In a production environment, you should restrict access to -the {reporting} endpoints to authorized users. This requires that you: +the reporting endpoints to authorized users. This requires that you: -. Enable {security} on your {es} cluster. For more information, -see {ref}/security-getting-started.html[Getting Started with Security]. +. Enable {stack-security-features} on your {es} cluster. For more information, +see {ref}/security-getting-started.html[Getting started with security]. . Configure TLS/SSL encryption for the {kib} server. For more information, see <>. . Specify the {kib} server's CA certificate chain in `elasticsearch.yml`: @@ -150,13 +150,13 @@ For more information, see {ref}/notification-settings.html#ssl-notification-sett -- . Add one or more users who have the permissions -necessary to use {kib} and {reporting}. For more information, see +necessary to use {kib} and {report-features}. For more information, see <>. -Once you've enabled SSL for {kib}, all requests to the {reporting} endpoints +Once you've enabled SSL for {kib}, all requests to the reporting endpoints must include valid credentials. For example, see the following page which includes a watch that submits requests as the built-in `elastic` user: <>. For more information about configuring watches, see -{ref}/how-watcher-works.html[How Watcher works]. +{ref}/how-watcher-works.html[How {watcher} works]. diff --git a/docs/user/security/securing-kibana.asciidoc b/docs/user/security/securing-kibana.asciidoc index b30acd0ed2e53..0177ac94bd402 100644 --- a/docs/user/security/securing-kibana.asciidoc +++ b/docs/user/security/securing-kibana.asciidoc @@ -5,21 +5,21 @@ Configure security ++++ -{kib} users have to log in when {security} is enabled on your cluster. You -configure {security} roles for your {kib} users to control what data those users -can access. +{kib} users have to log in when {stack-security-features} are enabled on your +cluster. You configure roles for your {kib} users to control what data those +users can access. Most requests made through {kib} to {es} are authenticated by using the credentials of the logged-in user. There are, however, a few internal requests that the {kib} server needs to make to the {es} cluster. For this reason, you must configure credentials for the {kib} server to use for those requests. -With {security} enabled, if you load a {kib} dashboard that accesses data in an -index that you are not authorized to view, you get an error that indicates the -index does not exist. {security} do not currently provide a way to control which -users can load which dashboards. +With {security-features} enabled, if you load a {kib} dashboard that accesses +data in an index that you are not authorized to view, you get an error that +indicates the index does not exist. The {security-features} do not currently +provide a way to control which users can load which dashboards. -To use {kib} with {security}: +To use {kib} with {security-features}: . {ref}/configuring-security.html[Configure security in {es}]. @@ -38,8 +38,8 @@ elasticsearch.password: "kibanapassword" The {kib} server submits requests as this user to access the cluster monitoring APIs and the `.kibana` index. The server does _not_ need access to user indices. -The password for the built-in `kibana_system` user is typically set as part of the -{security} configuration process on {es}. For more information, see +The password for the built-in `kibana_system` user is typically set as part of +the security configuration process on {es}. For more information, see {ref}/built-in-users.html[Built-in users]. -- @@ -53,7 +53,7 @@ as the encryption key. xpack.security.encryptionKey: "something_at_least_32_characters" -------------------------------------------------------------------------------- -For more information, see <>. +For more information, see <>. -- . Optional: Set a timeout to expire idle sessions. By default, a session stays From dc7db09533f62d43a70e2a903c89e19b81ae8287 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Fri, 17 Jul 2020 16:29:23 -0600 Subject: [PATCH 43/59] [Maps] convert SavedGisMap to TS (#72286) * [Maps] convert SavedGisMap to TS * i18n translate new map title --- .../{saved_gis_map.js => saved_gis_map.ts} | 65 ++++++++++++------- .../maps/public/selectors/map_selectors.ts | 4 +- 2 files changed, 42 insertions(+), 27 deletions(-) rename x-pack/plugins/maps/public/routing/bootstrap/services/{saved_gis_map.js => saved_gis_map.ts} (64%) diff --git a/x-pack/plugins/maps/public/routing/bootstrap/services/saved_gis_map.js b/x-pack/plugins/maps/public/routing/bootstrap/services/saved_gis_map.ts similarity index 64% rename from x-pack/plugins/maps/public/routing/bootstrap/services/saved_gis_map.js rename to x-pack/plugins/maps/public/routing/bootstrap/services/saved_gis_map.ts index f8c783f673bab..4b474424bcdab 100644 --- a/x-pack/plugins/maps/public/routing/bootstrap/services/saved_gis_map.js +++ b/x-pack/plugins/maps/public/routing/bootstrap/services/saved_gis_map.ts @@ -5,7 +5,13 @@ */ import _ from 'lodash'; -import { createSavedObjectClass } from '../../../../../../../src/plugins/saved_objects/public'; +import { SavedObjectReference } from 'kibana/public'; +import { i18n } from '@kbn/i18n'; +import { + createSavedObjectClass, + SavedObject, + SavedObjectKibanaServices, +} from '../../../../../../../src/plugins/saved_objects/public'; import { getTimeFilters, getMapZoom, @@ -18,65 +24,74 @@ import { } from '../../../selectors/map_selectors'; import { getIsLayerTOCOpen, getOpenTOCDetails } from '../../../selectors/ui_selectors'; import { copyPersistentState } from '../../../reducers/util'; +// @ts-expect-error import { extractReferences, injectReferences } from '../../../../common/migrations/references'; import { getExistingMapPath, MAP_SAVED_OBJECT_TYPE } from '../../../../common/constants'; +// @ts-expect-error import { getStore } from '../../store_operations'; +import { MapStoreState } from '../../../reducers/store'; +import { LayerDescriptor } from '../../../../common/descriptor_types'; + +export interface ISavedGisMap extends SavedObject { + layerListJSON?: string; + mapStateJSON?: string; + uiStateJSON?: string; + getLayerList(): LayerDescriptor[]; + syncWithStore(): void; +} -export function createSavedGisMapClass(services) { +export function createSavedGisMapClass(services: SavedObjectKibanaServices) { const SavedObjectClass = createSavedObjectClass(services); - class SavedGisMap extends SavedObjectClass { - static type = MAP_SAVED_OBJECT_TYPE; + class SavedGisMap extends SavedObjectClass implements ISavedGisMap { + public static type = MAP_SAVED_OBJECT_TYPE; // Mappings are used to place object properties into saved object _source - static mapping = { + public static mapping = { title: 'text', description: 'text', mapStateJSON: 'text', layerListJSON: 'text', uiStateJSON: 'text', }; - static fieldOrder = ['title', 'description']; - static searchSource = false; + public static fieldOrder = ['title', 'description']; + public static searchSource = false; - constructor(id) { + public showInRecentlyAccessed = true; + public layerListJSON?: string; + public mapStateJSON?: string; + public uiStateJSON?: string; + + constructor(id: string) { super({ type: SavedGisMap.type, mapping: SavedGisMap.mapping, searchSource: SavedGisMap.searchSource, extractReferences, - injectReferences: (savedObject, references) => { + injectReferences: (savedObject: ISavedGisMap, references: SavedObjectReference[]) => { const { attributes } = injectReferences({ attributes: { layerListJSON: savedObject.layerListJSON }, references, }); savedObject.layerListJSON = attributes.layerListJSON; - - const indexPatternIds = references - .filter((reference) => { - return reference.type === 'index-pattern'; - }) - .map((reference) => { - return reference.id; - }); - savedObject.indexPatternIds = _.uniq(indexPatternIds); }, // if this is null/undefined then the SavedObject will be assigned the defaults - id: id, + id, // default values that will get assigned if the doc is new defaults: { - title: 'New Map', + title: i18n.translate('xpack.maps.newMapTitle', { + defaultMessage: 'New Map', + }), description: '', }, }); - this.showInRecentlyAccessed = true; - } - getFullPath() { - return getExistingMapPath(this.id); + this.getFullPath = () => { + return getExistingMapPath(this.id!); + }; } getLayerList() { @@ -84,7 +99,7 @@ export function createSavedGisMapClass(services) { } syncWithStore() { - const state = getStore().getState(); + const state: MapStoreState = getStore().getState(); const layerList = getLayerListRaw(state); const layerListConfigOnly = copyPersistentState(layerList); this.layerListJSON = JSON.stringify(layerListConfigOnly); diff --git a/x-pack/plugins/maps/public/selectors/map_selectors.ts b/x-pack/plugins/maps/public/selectors/map_selectors.ts index fe2cfec3c761c..e082398a02a9e 100644 --- a/x-pack/plugins/maps/public/selectors/map_selectors.ts +++ b/x-pack/plugins/maps/public/selectors/map_selectors.ts @@ -52,6 +52,7 @@ import { ISource } from '../classes/sources/source'; import { ITMSSource } from '../classes/sources/tms_source'; import { IVectorSource } from '../classes/sources/vector_source'; import { ILayer } from '../classes/layers/layer'; +import { ISavedGisMap } from '../routing/bootstrap/services/saved_gis_map'; function createLayerInstance( layerDescriptor: LayerDescriptor, @@ -419,12 +420,11 @@ export const areLayersLoaded = createSelector( export function hasUnsavedChanges( state: MapStoreState, - savedMap: unknown, + savedMap: ISavedGisMap, initialLayerListConfig: LayerDescriptor[] ) { const layerListConfigOnly = copyPersistentState(getLayerListRaw(state)); - // @ts-expect-error const savedLayerList = savedMap.getLayerList(); return !savedLayerList From ef875cf9fe3ff27f9014a7c5d7418c27acbbacef Mon Sep 17 00:00:00 2001 From: Spencer Date: Fri, 17 Jul 2020 16:41:52 -0700 Subject: [PATCH 44/59] [esArchiver] actually re-delete the .kibana index if we lose recreate race (#72354) Co-authored-by: spalger --- src/es_archiver/lib/indices/create_index_stream.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/es_archiver/lib/indices/create_index_stream.ts b/src/es_archiver/lib/indices/create_index_stream.ts index 5629f95c7c9c6..fa4c95dc73166 100644 --- a/src/es_archiver/lib/indices/create_index_stream.ts +++ b/src/es_archiver/lib/indices/create_index_stream.ts @@ -20,7 +20,6 @@ import { Transform, Readable } from 'stream'; import { inspect } from 'util'; -import { get, once } from 'lodash'; import { Client } from 'elasticsearch'; import { ToolingLog } from '@kbn/dev-utils'; @@ -54,7 +53,7 @@ export function createCreateIndexStream({ // If we're trying to import Kibana index docs, we need to ensure that // previous indices are removed so we're starting w/ a clean slate for // migrations. This only needs to be done once per archive load operation. - const deleteKibanaIndicesOnce = once(deleteKibanaIndices); + let kibanaIndexAlreadyDeleted = false; async function handleDoc(stream: Readable, record: DocRecord) { if (skipDocsFromIndices.has(record.value.index)) { @@ -70,8 +69,9 @@ export function createCreateIndexStream({ async function attemptToCreate(attemptNumber = 1) { try { - if (isKibana) { - await deleteKibanaIndicesOnce({ client, stats, log }); + if (isKibana && !kibanaIndexAlreadyDeleted) { + await deleteKibanaIndices({ client, stats, log }); + kibanaIndexAlreadyDeleted = true; } await client.indices.create({ @@ -90,6 +90,7 @@ export function createCreateIndexStream({ err?.body?.error?.reason?.includes('index exists with the same name as the alias') && attemptNumber < 3 ) { + kibanaIndexAlreadyDeleted = false; const aliasStr = inspect(aliases); log.info( `failed to create aliases [${aliasStr}] because ES indicated an index/alias already exists, trying again` @@ -98,10 +99,7 @@ export function createCreateIndexStream({ return; } - if ( - get(err, 'body.error.type') !== 'resource_already_exists_exception' || - attemptNumber >= 3 - ) { + if (err?.body?.error?.type !== 'resource_already_exists_exception' || attemptNumber >= 3) { throw err; } From 105e3a6c7ecc39442f10c8ec030f6297e0b56cd4 Mon Sep 17 00:00:00 2001 From: Dmitry Lemeshko Date: Sat, 18 Jul 2020 17:47:53 +0200 Subject: [PATCH 45/59] update chromedriver to 84 (#72228) Co-authored-by: Elastic Machine --- package.json | 4 ++-- yarn.lock | 32 ++++++++++++++++++++++++-------- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index a22871e314bae..ceb3ac4cca937 100644 --- a/package.json +++ b/package.json @@ -322,7 +322,7 @@ "@types/browserslist-useragent": "^3.0.0", "@types/chance": "^1.0.0", "@types/cheerio": "^0.22.10", - "@types/chromedriver": "^2.38.0", + "@types/chromedriver": "^81.0.0", "@types/classnames": "^2.2.9", "@types/color": "^3.0.0", "@types/d3": "^3.5.43", @@ -411,7 +411,7 @@ "chai": "3.5.0", "chance": "1.0.18", "cheerio": "0.22.0", - "chromedriver": "^83.0.0", + "chromedriver": "^84.0.0", "classnames": "2.2.6", "dedent": "^0.7.0", "delete-empty": "^2.0.0", diff --git a/yarn.lock b/yarn.lock index e5975efe0b7d5..3924655b5e43e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4784,10 +4784,10 @@ resolved "https://registry.yarnpkg.com/@types/chroma-js/-/chroma-js-2.0.0.tgz#b0fc98c8625d963f14e8138e0a7961103303ab22" integrity sha512-iomunXsXjDxhm2y1OeJt8NwmgC7RyNkPAOddlYVGsbGoX8+1jYt84SG4/tf6RWcwzROLx1kPXPE95by1s+ebIg== -"@types/chromedriver@^2.38.0": - version "2.38.0" - resolved "https://registry.yarnpkg.com/@types/chromedriver/-/chromedriver-2.38.0.tgz#971032b73eb7f44036f4f5bed59a7fd5b468014f" - integrity sha512-vcPGkZt1y2YVXKAY8SwCvU0u9mgw9+7tBV4HGb0YX/6bu1WXbb61bf8Y/N+xNCYwEj/Ug1UAMnhCcsSohXzRXw== +"@types/chromedriver@^81.0.0": + version "81.0.0" + resolved "https://registry.yarnpkg.com/@types/chromedriver/-/chromedriver-81.0.0.tgz#d7c97bd2b1de34270f44e60f4eee43bfdba3a8e2" + integrity sha512-Oqwo24DPn5lYI66aA74ApKrfAqVFEjC66raiB/2eHhhryYiumlMpRTR/++riaRcXmfrLXrIiNTtE+Op4vGCIFQ== dependencies: "@types/node" "*" @@ -6726,6 +6726,13 @@ agent-base@^4.1.0: dependencies: es6-promisify "^5.0.0" +agent-base@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.3.0.tgz#8165f01c436009bccad0b1d122f05ed770efc6ee" + integrity sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg== + dependencies: + es6-promisify "^5.0.0" + agentkeepalive@^3.4.1: version "3.4.1" resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-3.4.1.tgz#aa95aebc3a749bca5ed53e3880a09f5235b48f0c" @@ -9970,15 +9977,16 @@ chrome-trace-event@^1.0.2: dependencies: tslib "^1.9.0" -chromedriver@^83.0.0: - version "83.0.0" - resolved "https://registry.yarnpkg.com/chromedriver/-/chromedriver-83.0.0.tgz#75d7d838e58014658c3990089464166fef951926" - integrity sha512-AePp9ykma+z4aKPRqlbzvVlc22VsQ6+rgF+0aL3B5onHOncK18dWSkLrSSJMczP/mXILN9ohGsvpuTwoRSj6OQ== +chromedriver@^84.0.0: + version "84.0.0" + resolved "https://registry.yarnpkg.com/chromedriver/-/chromedriver-84.0.0.tgz#980d72bf0990bbfbce282074d15448296c55d89d" + integrity sha512-fNX9eT1C38D1W8r5ss9ty42eDK+GIkCZVKukfeDs0XSBeKfyT0o/vbMdPr9MUkWQ+vIcFAS5hFGp9E3+xoaMeQ== dependencies: "@testim/chrome-version" "^1.0.7" axios "^0.19.2" del "^5.1.0" extract-zip "^2.0.0" + https-proxy-agent "^2.2.4" mkdirp "^1.0.4" tcp-port-used "^1.0.1" @@ -17448,6 +17456,14 @@ https-proxy-agent@2.2.1, https-proxy-agent@^2.2.1: agent-base "^4.1.0" debug "^3.1.0" +https-proxy-agent@^2.2.4: + version "2.2.4" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz#4ee7a737abd92678a293d9b34a1af4d0d08c787b" + integrity sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg== + dependencies: + agent-base "^4.3.0" + debug "^3.1.0" + https-proxy-agent@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-4.0.0.tgz#702b71fb5520a132a66de1f67541d9e62154d82b" From a28463d82a38bac9b04470c8836c14536a528220 Mon Sep 17 00:00:00 2001 From: Marco Liberati Date: Mon, 20 Jul 2020 10:22:05 +0200 Subject: [PATCH 46/59] Fix float percentiles line chart (#71902) Co-authored-by: Elastic Machine --- .../public/vislib/lib/types/point_series.js | 18 +- .../vislib/lib/types/point_series.test.js | 20 +- .../types/testdata_linechart_percentile.json | 608 +++++++++--------- ...data_linechart_percentile_float_value.json | 463 +++++++++++++ ...nechart_percentile_float_value_result.json | 456 +++++++++++++ .../testdata_linechart_percentile_result.json | 333 +++++++++- 6 files changed, 1586 insertions(+), 312 deletions(-) create mode 100644 src/plugins/vis_type_vislib/public/vislib/lib/types/testdata_linechart_percentile_float_value.json create mode 100644 src/plugins/vis_type_vislib/public/vislib/lib/types/testdata_linechart_percentile_float_value_result.json diff --git a/src/plugins/vis_type_vislib/public/vislib/lib/types/point_series.js b/src/plugins/vis_type_vislib/public/vislib/lib/types/point_series.js index 438c071d74532..03b5af2572d94 100644 --- a/src/plugins/vis_type_vislib/public/vislib/lib/types/point_series.js +++ b/src/plugins/vis_type_vislib/public/vislib/lib/types/point_series.js @@ -21,7 +21,23 @@ import _ from 'lodash'; import { i18n } from '@kbn/i18n'; function getSeriId(seri) { - return seri.id && seri.id.indexOf('.') !== -1 ? seri.id.split('.')[0] : seri.id; + if (!seri.id) { + return; + } + // Ideally the format should be either ID or "ID.SERIES" + // but for some values the SERIES components gets a bit more complex + + // Float values are serialized as strings tuples (i.e. ['99.1']) rather than regular numbers (99.1) + // so the complete ids are in the format ID.['SERIES']: hence the specific brackets handler + const bracketsMarker = seri.id.indexOf('['); + if (bracketsMarker > -1) { + return seri.id.substring(0, bracketsMarker); + } + // Here's the dot check is enough + if (seri.id.indexOf('.') > -1) { + return seri.id.split('.')[0]; + } + return seri.id; } const createSeriesFromParams = (cfg, seri) => { diff --git a/src/plugins/vis_type_vislib/public/vislib/lib/types/point_series.test.js b/src/plugins/vis_type_vislib/public/vislib/lib/types/point_series.test.js index 62ff873f28134..b46054f3cd983 100644 --- a/src/plugins/vis_type_vislib/public/vislib/lib/types/point_series.test.js +++ b/src/plugins/vis_type_vislib/public/vislib/lib/types/point_series.test.js @@ -20,6 +20,8 @@ import stackedSeries from '../../../fixtures/mock_data/date_histogram/_stacked_s import { vislibPointSeriesTypes } from './point_series'; import percentileTestdata from './testdata_linechart_percentile.json'; import percentileTestdataResult from './testdata_linechart_percentile_result.json'; +import percentileTestdataFloatValue from './testdata_linechart_percentile_float_value.json'; +import percentileTestdataFloatValueResult from './testdata_linechart_percentile_float_value_result.json'; const maxBucketData = { get: (prop) => { @@ -215,18 +217,26 @@ describe('Point Series Config Type Class Test Suite', function () { }); describe('line chart', function () { - beforeEach(function () { + function prepareData({ cfg, data }) { const percentileDataObj = { get: (prop) => { return maxBucketData[prop] || maxBucketData.data[prop] || null; }, getLabels: () => [], - data: percentileTestdata.data, + data: data, }; - parsedConfig = vislibPointSeriesTypes.line(percentileTestdata.cfg, percentileDataObj); - }); + const parsedConfig = vislibPointSeriesTypes.line(cfg, percentileDataObj); + return parsedConfig; + } + it('should render a percentile line chart', function () { - expect(JSON.stringify(parsedConfig)).toEqual(JSON.stringify(percentileTestdataResult)); + const parsedConfig = prepareData(percentileTestdata); + expect(parsedConfig).toMatchObject(percentileTestdataResult); + }); + + it('should render a percentile line chart when value is float', function () { + const parsedConfig = prepareData(percentileTestdataFloatValue); + expect(parsedConfig).toMatchObject(percentileTestdataFloatValueResult); }); }); }); diff --git a/src/plugins/vis_type_vislib/public/vislib/lib/types/testdata_linechart_percentile.json b/src/plugins/vis_type_vislib/public/vislib/lib/types/testdata_linechart_percentile.json index 818d9133938fa..d52cb18727c05 100644 --- a/src/plugins/vis_type_vislib/public/vislib/lib/types/testdata_linechart_percentile.json +++ b/src/plugins/vis_type_vislib/public/vislib/lib/types/testdata_linechart_percentile.json @@ -140,320 +140,320 @@ } }, "yAxisLabel": "", - "series": [ - { - "id": "1.1", - "rawId": "col-1-1.1", - "label": "1st percentile of AvgTicketPrice", - "values": [ - { - "x": 1557460800000, - "y": 116.33676605224609, - "extraMetrics": [], - "xRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.1", - "name": "1st percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.1": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.1": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 0, - "row": 0, - "value": 1557460800000 + "hits": 2 + }, + "series": [ + { + "id": "1.1", + "rawId": "col-1-1.1", + "label": "1st percentile of AvgTicketPrice", + "values": [ + { + "x": 1557460800000, + "y": 116.33676605224609, + "extraMetrics": [], + "xRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.1", + "name": "1st percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.1": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.1": 223, + "col-2-1.50": 756 + } + ] }, - "yRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.1", - "name": "1st percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.1": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.1": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 1, - "row": 0, - "value": 116.33676605224609 + "column": 0, + "row": 0, + "value": 1557460800000 + }, + "yRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.1", + "name": "1st percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.1": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.1": 223, + "col-2-1.50": 756 + } + ] }, - "parent": null, - "series": "1st percentile of AvgTicketPrice", - "seriesId": "col-1-1.1" + "column": 1, + "row": 0, + "value": 116.33676605224609 }, - { - "x": 1557547200000, - "y": 223, - "extraMetrics": [], - "xRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.1", - "name": "1st percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.1": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.1": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 0, - "row": 1, - "value": 1557547200000 + "parent": null, + "series": "1st percentile of AvgTicketPrice", + "seriesId": "col-1-1.1" + }, + { + "x": 1557547200000, + "y": 223, + "extraMetrics": [], + "xRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.1", + "name": "1st percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.1": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.1": 223, + "col-2-1.50": 756 + } + ] }, - "yRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.1", - "name": "1st percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.1": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.1": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 1, - "row": 1, - "value": 223 + "column": 0, + "row": 1, + "value": 1557547200000 + }, + "yRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.1", + "name": "1st percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.1": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.1": 223, + "col-2-1.50": 756 + } + ] }, - "parent": null, - "series": "1st percentile of AvgTicketPrice", - "seriesId": "col-1-1.1" - } - ] - }, - { - "id": "1.50", - "rawId": "col-2-1.50", - "label": "50th percentile of AvgTicketPrice", - "values": [ - { - "x": 1557460800000, - "y": 658.8453063964844, - "extraMetrics": [], - "xRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.1", - "name": "1st percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.1": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.1": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 0, - "row": 0, - "value": 1557460800000 + "column": 1, + "row": 1, + "value": 223 + }, + "parent": null, + "series": "1st percentile of AvgTicketPrice", + "seriesId": "col-1-1.1" + } + ] + }, + { + "id": "1.50", + "rawId": "col-2-1.50", + "label": "50th percentile of AvgTicketPrice", + "values": [ + { + "x": 1557460800000, + "y": 658.8453063964844, + "extraMetrics": [], + "xRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.1", + "name": "1st percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.1": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.1": 223, + "col-2-1.50": 756 + } + ] }, - "yRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.1", - "name": "1st percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.1": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.1": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 2, - "row": 0, - "value": 658 + "column": 0, + "row": 0, + "value": 1557460800000 + }, + "yRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.1", + "name": "1st percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.1": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.1": 223, + "col-2-1.50": 756 + } + ] }, - "parent": null, - "series": "50th percentile of AvgTicketPrice", - "seriesId": "col-2-1.50" + "column": 2, + "row": 0, + "value": 658 }, - { - "x": 1557547200000, - "y": 756, - "extraMetrics": [], - "xRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.1", - "name": "1st percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.1": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.1": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 0, - "row": 1, - "value": 1557547200000 + "parent": null, + "series": "50th percentile of AvgTicketPrice", + "seriesId": "col-2-1.50" + }, + { + "x": 1557547200000, + "y": 756, + "extraMetrics": [], + "xRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.1", + "name": "1st percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.1": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.1": 223, + "col-2-1.50": 756 + } + ] }, - "yRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.1", - "name": "1st percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.1": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.1": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 2, - "row": 1, - "value": 756.2283554077148 + "column": 0, + "row": 1, + "value": 1557547200000 + }, + "yRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.1", + "name": "1st percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.1": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.1": 223, + "col-2-1.50": 756 + } + ] }, - "parent": null, - "series": "50th percentile of AvgTicketPrice", - "seriesId": "col-2-1.50" - } - ] - } - ], - "hits": 2 - }, + "column": 2, + "row": 1, + "value": 756.2283554077148 + }, + "parent": null, + "series": "50th percentile of AvgTicketPrice", + "seriesId": "col-2-1.50" + } + ] + } + ], "type": "series", "labels": [ "1st percentile of AvgTicketPrice", diff --git a/src/plugins/vis_type_vislib/public/vislib/lib/types/testdata_linechart_percentile_float_value.json b/src/plugins/vis_type_vislib/public/vislib/lib/types/testdata_linechart_percentile_float_value.json new file mode 100644 index 0000000000000..6e1a707229974 --- /dev/null +++ b/src/plugins/vis_type_vislib/public/vislib/lib/types/testdata_linechart_percentile_float_value.json @@ -0,0 +1,463 @@ +{ + "cfg": { + "addLegend": true, + "addTimeMarker": false, + "addTooltip": true, + "categoryAxes": [ + { + "id": "CategoryAxis-1", + "labels": { + "show": true, + "truncate": 100 + }, + "position": "bottom", + "scale": { + "type": "linear" + }, + "show": true, + "style": {}, + "title": {}, + "type": "category" + } + ], + "dimensions": { + "x": { + "accessor": 0, + "format": { + "id": "date", + "params": { + "pattern": "YYYY-MM-DD" + } + }, + "params": { + "date": true, + "interval": "P1D", + "format": "YYYY-MM-DD", + "bounds": { + "min": "2019-05-10T04:00:00.000Z", + "max": "2019-05-12T10:18:57.342Z" + } + }, + "aggType": "date_histogram" + }, + "y": [ + { + "accessor": 1, + "format": { + "id": "number", + "params": { + "pattern": "$0,0.[00]" + } + }, + "params": {}, + "aggType": "percentiles" + }, + { + "accessor": 2, + "format": { + "id": "number", + "params": { + "pattern": "$0,0.[00]" + } + }, + "params": {}, + "aggType": "percentiles" + } + ] + }, + "grid": { + "categoryLines": false, + "style": { + "color": "#eee" + } + }, + "legendPosition": "right", + "seriesParams": [ + { + "data": { + "id": "1", + "label": "Percentiles of AvgTicketPrice" + }, + "drawLinesBetweenPoints": true, + "interpolate": "cardinal", + "mode": "normal", + "show": "true", + "showCircles": true, + "type": "line", + "valueAxis": "ValueAxis-1" + } + ], + "times": [], + "type": "area", + "valueAxes": [ + { + "id": "ValueAxis-1", + "labels": { + "filter": false, + "rotate": 0, + "show": true, + "truncate": 100 + }, + "name": "LeftAxis-1", + "position": "left", + "scale": { + "mode": "normal", + "type": "linear" + }, + "show": true, + "style": {}, + "title": { + "text": "Percentiles of AvgTicketPrice" + }, + "type": "value" + } + ] + }, + "data": { + "uiState": {}, + "data": { + "xAxisOrderedValues": [ + 1557460800000, + 1557547200000 + ], + "xAxisFormat": { + "id": "date", + "params": { + "pattern": "YYYY-MM-DD" + } + }, + "xAxisLabel": "timestamp per day", + "ordered": { + "interval": "P1D", + "date": true, + "min": 1557460800000, + "max": 1557656337342 + }, + "yAxisFormat": { + "id": "number", + "params": { + "pattern": "$0,0.[00]" + } + }, + "yAxisLabel": "", + "hits": 2 + }, + "series": [ + { + "id": "1.['1.1']", + "rawId": "col-1-1.['1.1']", + "label": "1.1th percentile of AvgTicketPrice", + "values": [ + { + "x": 1557460800000, + "y": 116.33676605224609, + "extraMetrics": [], + "xRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.['1.1']", + "name": "1.1th percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.['1.1']": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.['1.1']": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 0, + "row": 0, + "value": 1557460800000 + }, + "yRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.['1.1']", + "name": "1.1th percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.['1.1']": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.['1.1']": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 1, + "row": 0, + "value": 116.33676605224609 + }, + "parent": null, + "series": "1.1th percentile of AvgTicketPrice", + "seriesId": "col-1-1.['1.1']" + }, + { + "x": 1557547200000, + "y": 223, + "extraMetrics": [], + "xRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.['1.1']", + "name": "1.1th percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.['1.1']": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.['1.1']": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 0, + "row": 1, + "value": 1557547200000 + }, + "yRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.['1.1']", + "name": "1.1th percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.['1.1']": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.['1.1']": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 1, + "row": 1, + "value": 223 + }, + "parent": null, + "series": "1.1th percentile of AvgTicketPrice", + "seriesId": "col-1-1.['1.1']" + } + ] + }, + { + "id": "1.50", + "rawId": "col-2-1.50", + "label": "50th percentile of AvgTicketPrice", + "values": [ + { + "x": 1557460800000, + "y": 658.8453063964844, + "extraMetrics": [], + "xRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.['1.1']", + "name": "1.1th percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.['1.1']": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.['1.1']": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 0, + "row": 0, + "value": 1557460800000 + }, + "yRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.['1.1']", + "name": "1.1th percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.['1.1']": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.['1.1']": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 2, + "row": 0, + "value": 658 + }, + "parent": null, + "series": "50th percentile of AvgTicketPrice", + "seriesId": "col-2-1.50" + }, + { + "x": 1557547200000, + "y": 756, + "extraMetrics": [], + "xRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.['1.1']", + "name": "1.1th percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.['1.1']": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.['1.1']": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 0, + "row": 1, + "value": 1557547200000 + }, + "yRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.['1.1']", + "name": "1.1th percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.['1.1']": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.['1.1']": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 2, + "row": 1, + "value": 756.2283554077148 + }, + "parent": null, + "series": "50th percentile of AvgTicketPrice", + "seriesId": "col-2-1.50" + } + ] + } + ], + "type": "series", + "labels": [ + "1.1th percentile of AvgTicketPrice", + "50th percentile of AvgTicketPrice" + ] + } +} \ No newline at end of file diff --git a/src/plugins/vis_type_vislib/public/vislib/lib/types/testdata_linechart_percentile_float_value_result.json b/src/plugins/vis_type_vislib/public/vislib/lib/types/testdata_linechart_percentile_float_value_result.json new file mode 100644 index 0000000000000..f7dd18f5eb712 --- /dev/null +++ b/src/plugins/vis_type_vislib/public/vislib/lib/types/testdata_linechart_percentile_float_value_result.json @@ -0,0 +1,456 @@ +{ + "addLegend": true, + "addTimeMarker": false, + "addTooltip": true, + "categoryAxes": [ + { + "id": "CategoryAxis-1", + "labels": { + "show": true, + "truncate": 100 + }, + "position": "bottom", + "scale": { + "type": "linear" + }, + "show": true, + "style": {}, + "title": { + "text": "Date Histogram" + }, + "type": "category" + } + ], + "dimensions": { + "x": { + "accessor": 0, + "format": { + "id": "date", + "params": { + "pattern": "YYYY-MM-DD" + } + }, + "params": { + "date": true, + "interval": "P1D", + "format": "YYYY-MM-DD", + "bounds": { + "min": "2019-05-10T04:00:00.000Z", + "max": "2019-05-12T10:18:57.342Z" + } + }, + "aggType": "date_histogram" + }, + "y": [ + { + "accessor": 1, + "format": { + "id": "number", + "params": { + "pattern": "$0,0.[00]" + } + }, + "params": {}, + "aggType": "percentiles" + }, + { + "accessor": 2, + "format": { + "id": "number", + "params": { + "pattern": "$0,0.[00]" + } + }, + "params": {}, + "aggType": "percentiles" + } + ] + }, + "grid": { + "categoryLines": false, + "style": { + "color": "#eee" + } + }, + "legendPosition": "right", + "seriesParams": [ + { + "data": { + "id": "1", + "label": "Percentiles of AvgTicketPrice" + }, + "drawLinesBetweenPoints": true, + "interpolate": "cardinal", + "mode": "normal", + "show": "true", + "showCircles": true, + "type": "line", + "valueAxis": "ValueAxis-1" + } + ], + "times": [], + "type": "point_series", + "valueAxes": [ + { + "id": "ValueAxis-1", + "labels": { + "filter": false, + "rotate": 0, + "show": true, + "truncate": 100 + }, + "name": "LeftAxis-1", + "position": "left", + "scale": { + "mode": "normal", + "type": "linear" + }, + "show": true, + "style": {}, + "title": { + "text": "Percentiles of AvgTicketPrice" + }, + "type": "value" + } + ], + "chartTitle": {}, + "mode": "normal", + "tooltip": { + "show": true + }, + "charts": [ + { + "type": "point_series", + "addTimeMarker": false, + "series": [ + { + "show": true, + "type": "area", + "mode": "normal", + "drawLinesBetweenPoints": true, + "showCircles": true, + "data": { + "id": "1.['1.1']", + "rawId": "col-1-1.['1.1']", + "label": "1.1th percentile of AvgTicketPrice", + "values": [ + { + "x": 1557460800000, + "y": 116.33676605224609, + "extraMetrics": [], + "xRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.['1.1']", + "name": "1.1th percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.['1.1']": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.['1.1']": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 0, + "row": 0, + "value": 1557460800000 + }, + "yRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.['1.1']", + "name": "1.1th percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.['1.1']": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.['1.1']": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 1, + "row": 0, + "value": 116.33676605224609 + }, + "parent": null, + "series": "1.1th percentile of AvgTicketPrice", + "seriesId": "col-1-1.['1.1']" + }, + { + "x": 1557547200000, + "y": 223, + "extraMetrics": [], + "xRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.['1.1']", + "name": "1.1th percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.['1.1']": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.['1.1']": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 0, + "row": 1, + "value": 1557547200000 + }, + "yRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.['1.1']", + "name": "1.1th percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.['1.1']": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.['1.1']": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 1, + "row": 1, + "value": 223 + }, + "parent": null, + "series": "1.1th percentile of AvgTicketPrice", + "seriesId": "col-1-1.['1.1']" + } + ] + } + }, + { + "data": { + "id": "1.50", + "rawId": "col-2-1.50", + "label": "50th percentile of AvgTicketPrice", + "values": [ + { + "x": 1557460800000, + "y": 658.8453063964844, + "extraMetrics": [], + "xRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.['1.1']", + "name": "1.1th percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.['1.1']": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.['1.1']": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 0, + "row": 0, + "value": 1557460800000 + }, + "yRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.['1.1']", + "name": "1.1th percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.['1.1']": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.['1.1']": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 2, + "row": 0, + "value": 658 + }, + "parent": null, + "series": "50th percentile of AvgTicketPrice", + "seriesId": "col-2-1.50" + }, + { + "x": 1557547200000, + "y": 756, + "extraMetrics": [], + "xRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.['1.1']", + "name": "1.1th percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.['1.1']": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.['1.1']": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 0, + "row": 1, + "value": 1557547200000 + }, + "yRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.['1.1']", + "name": "1.1th percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.['1.1']": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.['1.1']": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 2, + "row": 1, + "value": 756.2283554077148 + }, + "parent": null, + "series": "50th percentile of AvgTicketPrice", + "seriesId": "col-2-1.50" + } + ] + }, + "drawLinesBetweenPoints": true, + "interpolate": "cardinal", + "mode": "normal", + "show": "true", + "showCircles": true, + "type": "line", + "valueAxis": "ValueAxis-1" + } + ] + } + ], + "enableHover": true +} \ No newline at end of file diff --git a/src/plugins/vis_type_vislib/public/vislib/lib/types/testdata_linechart_percentile_result.json b/src/plugins/vis_type_vislib/public/vislib/lib/types/testdata_linechart_percentile_result.json index d50d20a70608b..02062c987564e 100644 --- a/src/plugins/vis_type_vislib/public/vislib/lib/types/testdata_linechart_percentile_result.json +++ b/src/plugins/vis_type_vislib/public/vislib/lib/types/testdata_linechart_percentile_result.json @@ -122,8 +122,337 @@ { "type": "point_series", "addTimeMarker": false, - "series": [] + "series": [ + { + "data": { + "id": "1.1", + "rawId": "col-1-1.1", + "label": "1st percentile of AvgTicketPrice", + "values": [ + { + "x": 1557460800000, + "y": 116.33676605224609, + "extraMetrics": [], + "xRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.1", + "name": "1st percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.1": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.1": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 0, + "row": 0, + "value": 1557460800000 + }, + "yRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.1", + "name": "1st percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.1": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.1": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 1, + "row": 0, + "value": 116.33676605224609 + }, + "parent": null, + "series": "1st percentile of AvgTicketPrice", + "seriesId": "col-1-1.1" + }, + { + "x": 1557547200000, + "y": 223, + "extraMetrics": [], + "xRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.1", + "name": "1st percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.1": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.1": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 0, + "row": 1, + "value": 1557547200000 + }, + "yRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.1", + "name": "1st percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.1": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.1": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 1, + "row": 1, + "value": 223 + }, + "parent": null, + "series": "1st percentile of AvgTicketPrice", + "seriesId": "col-1-1.1" + } + ] + }, + "drawLinesBetweenPoints": true, + "interpolate": "cardinal", + "mode": "normal", + "show": "true", + "showCircles": true, + "type": "line", + "valueAxis": "ValueAxis-1" + }, + { + "data": { + "id": "1.50", + "rawId": "col-2-1.50", + "label": "50th percentile of AvgTicketPrice", + "values": [ + { + "x": 1557460800000, + "y": 658.8453063964844, + "extraMetrics": [], + "xRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.1", + "name": "1st percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.1": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.1": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 0, + "row": 0, + "value": 1557460800000 + }, + "yRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.1", + "name": "1st percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.1": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.1": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 2, + "row": 0, + "value": 658 + }, + "parent": null, + "series": "50th percentile of AvgTicketPrice", + "seriesId": "col-2-1.50" + }, + { + "x": 1557547200000, + "y": 756, + "extraMetrics": [], + "xRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.1", + "name": "1st percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.1": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.1": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 0, + "row": 1, + "value": 1557547200000 + }, + "yRaw": { + "table": { + "columns": [ + { + "id": "col-0-2", + "name": "timestamp per day" + }, + { + "id": "col-1-1.1", + "name": "1st percentile of AvgTicketPrice" + }, + { + "id": "col-2-1.50", + "name": "50th percentile of AvgTicketPrice" + } + ], + "rows": [ + { + "col-0-2": 1557460800000, + "col-1-1.1": 116, + "col-2-1.50": 658 + }, + { + "col-0-2": 1557547200000, + "col-1-1.1": 223, + "col-2-1.50": 756 + } + ] + }, + "column": 2, + "row": 1, + "value": 756.2283554077148 + }, + "parent": null, + "series": "50th percentile of AvgTicketPrice", + "seriesId": "col-2-1.50" + } + ] + }, + "drawLinesBetweenPoints": true, + "interpolate": "cardinal", + "mode": "normal", + "show": "true", + "showCircles": true, + "type": "line", + "valueAxis": "ValueAxis-1" + } + ] } ], "enableHover": true -} +} \ No newline at end of file From 7cee2a6b15175928b38bb3d5d5531d7b887f0343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=AA=20Marcondes?= <55978943+cauemarcondes@users.noreply.github.com> Date: Mon, 20 Jul 2020 09:25:39 +0100 Subject: [PATCH 47/59] [Observability] Remove app logos (#72259) * removing app logos * fixing TS error --- .../public/components/app/empty_section/index.tsx | 2 -- x-pack/plugins/observability/public/pages/landing/index.tsx | 4 +--- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/x-pack/plugins/observability/public/components/app/empty_section/index.tsx b/x-pack/plugins/observability/public/components/app/empty_section/index.tsx index e19bf1678bc01..4c830b2b2f094 100644 --- a/x-pack/plugins/observability/public/components/app/empty_section/index.tsx +++ b/x-pack/plugins/observability/public/components/app/empty_section/index.tsx @@ -15,8 +15,6 @@ export const EmptySection = ({ section }: Props) => { return ( {section.title}} titleSize="xs" body={{section.description}} diff --git a/x-pack/plugins/observability/public/pages/landing/index.tsx b/x-pack/plugins/observability/public/pages/landing/index.tsx index da46791d9e855..81485953f8713 100644 --- a/x-pack/plugins/observability/public/pages/landing/index.tsx +++ b/x-pack/plugins/observability/public/pages/landing/index.tsx @@ -10,7 +10,6 @@ import { EuiFlexGrid, EuiFlexGroup, EuiFlexItem, - EuiIcon, EuiImage, EuiSpacer, EuiText, @@ -19,10 +18,10 @@ import { import { i18n } from '@kbn/i18n'; import React, { useContext } from 'react'; import styled, { ThemeContext } from 'styled-components'; +import { IngestManagerPanel } from '../../components/app/ingest_manager_panel'; import { WithHeaderLayout } from '../../components/app/layout/with_header'; import { usePluginContext } from '../../hooks/use_plugin_context'; import { appsSection } from '../home/section'; -import { IngestManagerPanel } from '../../components/app/ingest_manager_panel'; const EuiCardWithoutPadding = styled(EuiCard)` padding: 0; @@ -68,7 +67,6 @@ export const LandingPage = () => { } title={

{app.title}

From b39c46eeac36d65eaaf18bdbaa29ba86d9cea26c Mon Sep 17 00:00:00 2001 From: James Gowdy Date: Mon, 20 Jul 2020 09:30:06 +0100 Subject: [PATCH 48/59] [ML] Disabling secondary auth headers when security is disabled (#72371) Co-authored-by: Elastic Machine --- x-pack/plugins/ml/server/lib/request_authorization.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/ml/server/lib/request_authorization.ts b/x-pack/plugins/ml/server/lib/request_authorization.ts index 01df0900b96f4..d40909a3a3a4c 100644 --- a/x-pack/plugins/ml/server/lib/request_authorization.ts +++ b/x-pack/plugins/ml/server/lib/request_authorization.ts @@ -7,7 +7,9 @@ import { KibanaRequest } from 'kibana/server'; export function getAuthorizationHeader(request: KibanaRequest) { - return { - headers: { 'es-secondary-authorization': request.headers.authorization }, - }; + return request.headers.authorization === undefined + ? {} + : { + headers: { 'es-secondary-authorization': request.headers.authorization }, + }; } From ec4f9d50ba311122cf5f6583e790a86db13e462a Mon Sep 17 00:00:00 2001 From: Matthias Wilhelm Date: Mon, 20 Jul 2020 10:43:12 +0200 Subject: [PATCH 49/59] Migrate and cleanup legacy scss (#69369) --- src/core/public/index.scss | 3 +- .../public/styles}/_ace_overrides.scss | 5 +- src/core/public/styles/_base.scss | 58 +++ src/core/public/styles/_index.scss | 2 + src/legacy/ui/public/_index.scss | 3 - .../ui/public/styles/_legacy/_base.scss | 153 -------- .../ui/public/styles/_legacy/_index.scss | 7 - .../styles/_legacy/components/_config.scss | 11 - .../_legacy/components/_control_group.scss | 67 ---- .../styles/_legacy/components/_hintbox.scss | 59 --- .../styles/_legacy/components/_index.scss | 13 - .../styles/_legacy/components/_input.scss | 12 - .../styles/_legacy/components/_kui_forms.scss | 29 -- .../styles/_legacy/components/_navbar.scss | 86 ----- .../_legacy/components/_pagination.scss | 56 --- .../styles/_legacy/components/_spinner.scss | 6 - .../styles/_legacy/components/_table.scss | 46 --- .../styles/_legacy/components/_truncate.scss | 3 - .../styles/_legacy/components/_ui_select.scss | 357 ------------------ src/legacy/ui/public/styles/_mixins.scss | 2 - .../public/application/_discover.scss | 12 + .../discover/public/application/_hacks.scss | 4 - .../discover/public/application/_mixins.scss | 27 -- .../angular/doc_table/_doc_table.scss | 77 +++- .../application/angular/doc_table/index.scss | 2 - .../discover/public/application/index.scss | 13 +- .../public/paginate/_paginate.scss | 57 +++ .../kibana_legacy/public/paginate/paginate.js | 1 + src/plugins/timelion/public/_base.scss | 19 + .../timelion/public/directives/_form.scss} | 40 +- .../timelion/public/directives/_index.scss | 3 + .../directives/_saved_object_finder.scss} | 6 +- src/plugins/timelion/public/index.scss | 1 + .../public/agg_table/_agg_table.scss | 4 + .../plugins/ml/public/application/_hacks.scss | 36 -- .../server/lib/layouts/preserve_layout.css | 1 - .../reporting/server/lib/layouts/print.css | 1 - 37 files changed, 251 insertions(+), 1031 deletions(-) rename src/{legacy/ui/public/styles/_legacy/components => core/public/styles}/_ace_overrides.scss (96%) create mode 100644 src/core/public/styles/_base.scss create mode 100644 src/core/public/styles/_index.scss delete mode 100644 src/legacy/ui/public/styles/_legacy/_base.scss delete mode 100644 src/legacy/ui/public/styles/_legacy/_index.scss delete mode 100644 src/legacy/ui/public/styles/_legacy/components/_config.scss delete mode 100644 src/legacy/ui/public/styles/_legacy/components/_control_group.scss delete mode 100644 src/legacy/ui/public/styles/_legacy/components/_hintbox.scss delete mode 100644 src/legacy/ui/public/styles/_legacy/components/_index.scss delete mode 100644 src/legacy/ui/public/styles/_legacy/components/_input.scss delete mode 100644 src/legacy/ui/public/styles/_legacy/components/_kui_forms.scss delete mode 100644 src/legacy/ui/public/styles/_legacy/components/_navbar.scss delete mode 100644 src/legacy/ui/public/styles/_legacy/components/_pagination.scss delete mode 100644 src/legacy/ui/public/styles/_legacy/components/_spinner.scss delete mode 100644 src/legacy/ui/public/styles/_legacy/components/_table.scss delete mode 100644 src/legacy/ui/public/styles/_legacy/components/_truncate.scss delete mode 100644 src/legacy/ui/public/styles/_legacy/components/_ui_select.scss delete mode 100644 src/plugins/discover/public/application/_hacks.scss delete mode 100644 src/plugins/discover/public/application/_mixins.scss create mode 100644 src/plugins/kibana_legacy/public/paginate/_paginate.scss create mode 100644 src/plugins/timelion/public/_base.scss rename src/{legacy/ui/public/styles/_legacy/_mixins.scss => plugins/timelion/public/directives/_form.scss} (58%) rename src/{legacy/ui/public/styles/_legacy/components/_list_group_menu.scss => plugins/timelion/public/directives/_saved_object_finder.scss} (85%) diff --git a/src/core/public/index.scss b/src/core/public/index.scss index 87825350b4e98..c2ad2841d5a77 100644 --- a/src/core/public/index.scss +++ b/src/core/public/index.scss @@ -2,6 +2,5 @@ @import './chrome/index'; @import './overlays/index'; @import './rendering/index'; +@import './styles/index'; -// Global styles need to be migrated -@import '../../legacy/ui/public/styles/_legacy/_index'; diff --git a/src/legacy/ui/public/styles/_legacy/components/_ace_overrides.scss b/src/core/public/styles/_ace_overrides.scss similarity index 96% rename from src/legacy/ui/public/styles/_legacy/components/_ace_overrides.scss rename to src/core/public/styles/_ace_overrides.scss index 2f0bc011f6a5c..30acdbbc80975 100644 --- a/src/legacy/ui/public/styles/_legacy/components/_ace_overrides.scss +++ b/src/core/public/styles/_ace_overrides.scss @@ -1,6 +1,3 @@ -@import '@elastic/eui/src/components/call_out/variables'; -@import '@elastic/eui/src/components/call_out/mixins'; - // SASSTODO: Replace with an EUI editor // Intentionally not using the EuiCodeBlock colors here because they actually change // hue from light to dark theme. So some colors would change while others wouldn't. @@ -181,7 +178,7 @@ } &.ace_multiselect .ace_selection.ace_start { - box-shadow: 0 0 3px 0px $euiColorEmptyShade; + box-shadow: 0 0 3px 0 $euiColorEmptyShade; } .ace_marker-layer .ace_step { diff --git a/src/core/public/styles/_base.scss b/src/core/public/styles/_base.scss new file mode 100644 index 0000000000000..9b06b526fc7dd --- /dev/null +++ b/src/core/public/styles/_base.scss @@ -0,0 +1,58 @@ +@import '@elastic/eui/src/components/collapsible_nav/variables'; +// Application Layout + +// chrome-context +// TODO #64541 +// Delete this block +.chrHeaderWrapper:not(.headerWrapper) .content { + display: flex; + flex-flow: row nowrap; + width: 100%; + height: 100%; + overflow: hidden; +} + +.application, +.app-container { + > * { + position: relative; + } +} + +.application { + position: relative; + z-index: 0; + display: flex; + flex-grow: 1; + flex-shrink: 0; + flex-basis: auto; + flex-direction: column; + + > * { + flex-shrink: 0; + } +} + +// We apply brute force focus states to anything not coming from Eui +// which has focus states designed at the component level. +// You can also use "kbn-resetFocusState" to not apply the default focus +// state. This is useful when you've already hand crafted your own +// focus states in Kibana. +:focus { + &:not([class^='eui']):not(.kbn-resetFocusState) { + @include euiFocusRing; + } +} + +// A necessary hack so that the above focus policy doesn't pollute some EUI +// entrenched inputs. +.euiComboBox { + // :not() specificity needed to override the above + input:not([class^='eui']):focus { + animation: none !important; + } +} + +.euiBody--collapsibleNavIsDocked .euiBottomBar { + margin-left: $euiCollapsibleNavWidth; +} diff --git a/src/core/public/styles/_index.scss b/src/core/public/styles/_index.scss new file mode 100644 index 0000000000000..600414402c278 --- /dev/null +++ b/src/core/public/styles/_index.scss @@ -0,0 +1,2 @@ +@import './base'; +@import './ace_overrides'; diff --git a/src/legacy/ui/public/_index.scss b/src/legacy/ui/public/_index.scss index 323de2ea7d263..a441b773d4a4e 100644 --- a/src/legacy/ui/public/_index.scss +++ b/src/legacy/ui/public/_index.scss @@ -1,6 +1,3 @@ -// Legacy styles to come before all -@import './styles/_legacy/index'; - // Prefix all styles with "kbn" to avoid conflicts. // Examples // kbnChart diff --git a/src/legacy/ui/public/styles/_legacy/_base.scss b/src/legacy/ui/public/styles/_legacy/_base.scss deleted file mode 100644 index 877ae033ae584..0000000000000 --- a/src/legacy/ui/public/styles/_legacy/_base.scss +++ /dev/null @@ -1,153 +0,0 @@ -@import '@elastic/eui/src/components/collapsible_nav/variables'; - -// Forms - -// Angular form states -input.ng-invalid, -textarea.ng-invalid, -select.ng-invalid { - &.ng-dirty, - &.ng-touched { - border-color: $euiColorDanger !important; - } -} - -input[type='radio'], -input[type='checkbox'], -.radio, -.radio-inline, -.checkbox, -.checkbox-inline { - &[disabled], - fieldset[disabled] & { - cursor: default; - opacity: 0.8; - } -} - -.checkbox label { - display: flex; - align-items: center; - padding-left: 0 !important; - - input[type='checkbox'] { - float: none; - margin: 0 $euiSizeXS; - position: static; - } -} - -// Application Layout - -// chrome-context -// TODO #64541 -// Delete this block -.chrHeaderWrapper:not(.headerWrapper) .content { - display: flex; - flex-flow: row nowrap; - width: 100%; - height: 100%; - overflow: hidden; -} - -.application, -.app-container { - > * { - position: relative; - } - - > config { - z-index: 1; - } - - > navbar { - padding-bottom: $euiSizeS; - } - - > nav, - > navbar { - z-index: 2 !important; - } -} - -.application { - position: relative; - z-index: 0; - display: flex; - flex-grow: 1; - flex-shrink: 0; - flex-basis: auto; - flex-direction: column; - - > * { - flex-shrink: 0; - } -} - -[fixed-scroll] { - overflow-x: auto; - padding-bottom: 0; - - + .fixed-scroll-scroller { - position: fixed; - bottom: 0; - overflow-x: auto; - overflow-y: hidden; - } -} - -// Too overused in many places to be moved elsewhere - -.page-row { - padding: 0 $euiSize; - margin: $euiSize 0; -} - -.page-row-text { - color: $euiColorDarkShade; - font-size: $euiFontSizeS; -} - -// We apply brute force focus states to anything not coming from Eui -// which has focus states designed at the component level. -// You can also use "kbn-resetFocusState" to not apply the default focus -// state. This is useful when you've already hand crafted your own -// focus states in Kibana. -:focus { - &:not([class^='eui']):not(.kbn-resetFocusState) { - @include euiFocusRing; - } -} - -// A necessary hack so that the above focus policy doesn't pollute some EUI -// entrenched inputs. -.euiComboBox { - // :not() specificity needed to override the above - input:not([class^='eui']):focus { - animation: none !important; - } -} - -.euiBody--collapsibleNavIsDocked .euiBottomBar { - margin-left: $euiCollapsibleNavWidth; -} - -// Utility classes - -.fullWidth { - width: 100% !important; -} - -.small { - font-size: 0.9em !important; -} -.smaller { - font-size: 0.8em !important; -} -.smallest { - font-size: 0.7em !important; -} - -.text-monospace { - font-family: $euiCodeFontFamily; -} diff --git a/src/legacy/ui/public/styles/_legacy/_index.scss b/src/legacy/ui/public/styles/_legacy/_index.scss deleted file mode 100644 index a0b1a98b09b7d..0000000000000 --- a/src/legacy/ui/public/styles/_legacy/_index.scss +++ /dev/null @@ -1,7 +0,0 @@ -// // -// // KIBANA THEME -@import './base'; -@import './mixins'; - -// // Components -@import './components/index'; diff --git a/src/legacy/ui/public/styles/_legacy/components/_config.scss b/src/legacy/ui/public/styles/_legacy/components/_config.scss deleted file mode 100644 index b56826f1e7088..0000000000000 --- a/src/legacy/ui/public/styles/_legacy/components/_config.scss +++ /dev/null @@ -1,11 +0,0 @@ -// SASSTODO: Selector is so generic it's hard to find if it's actually used -.config { - @extend .navbar !optional; - @extend .navbar-default !optional; - border-bottom: 1px solid transparent; - - .container-fluid { - background-color: $euiPageBackgroundColor; - padding: $euiSizeS; - } -} diff --git a/src/legacy/ui/public/styles/_legacy/components/_control_group.scss b/src/legacy/ui/public/styles/_legacy/components/_control_group.scss deleted file mode 100644 index ce958a9aae77f..0000000000000 --- a/src/legacy/ui/public/styles/_legacy/components/_control_group.scss +++ /dev/null @@ -1,67 +0,0 @@ -.control-group { - display: flex; - flex: 0 0 auto; - flex-direction: row; - flex-wrap: wrap; - align-items: stretch; - padding: $euiSizeXS $euiSize; - - > * { - padding-right: $euiSize; - flex: 0 0 auto; - - &:last-child { - padding-right: 0; - } - } - - // horizontal group of buttons/form elements - .inline-form .input-group { - margin-bottom: 0; - display: flex; - - > * { - border-radius: 0; - } - - > :first-child { - border-bottom-left-radius: $euiBorderRadius; - border-top-left-radius: $euiBorderRadius; - } - - > :last-child { - border-bottom-right-radius: $euiBorderRadius; - border-top-right-radius: $euiBorderRadius; - } - } - - .inline-form { - @include flex-parent(0, 0, auto); - display: flex; - - > .typeahead { - @include flex-parent(); - - > .input-group { - display: flex; - flex: 1 0 auto; - - > * { - float: none; - height: auto; - width: auto; - flex: 0 0 auto; - } - - input[type="text"] { - flex: 1 1 100%; - } - } - } - } - - // the element should take up an even share of available space - > .fill { - flex: 1 1 1%; - } -} diff --git a/src/legacy/ui/public/styles/_legacy/components/_hintbox.scss b/src/legacy/ui/public/styles/_legacy/components/_hintbox.scss deleted file mode 100644 index 0c447031636ac..0000000000000 --- a/src/legacy/ui/public/styles/_legacy/components/_hintbox.scss +++ /dev/null @@ -1,59 +0,0 @@ -.hintbox { - padding: $euiSizeS $euiSizeM; - border-radius: $euiBorderRadius; - margin-bottom: $euiSizeS; - background-color: $euiColorLightShade; - line-height: $euiLineHeight; - - a { - color: $euiLinkColor !important; - - &:hover { - color: darken($euiLinkColor, 10%) !important; - } - } - - pre { - background-color: $euiColorEmptyShade; - } - - ul, ol { - padding-left: $euiSizeL; - } - - // inspired by Bootstrap alerts component - // https://github.com/twbs/bootstrap/blob/063c1b0780ea0240e4adce4c88d57fc23e099475/less/alerts.less#L27-L35 - > * { - margin: 0; - } - - > * + * { - margin-top: $euiSizeS; - } - - // https://github.com/twbs/bootstrap/blob/2aa102bfd40859d15790febed1939e0111a6fb1a/less/tables.less#L88-L106 - .table-bordered { - border: $euiBorderThin; - > thead, - > tbody, - > tfoot { - > tr { - > th, - > td { - border: $euiBorderThin; - } - } - } - > thead > tr { - > th, - > td { - border-bottom-width: 2px; - } - } - } -} - - .hintbox-label, - .hintbox-label[ng-click] { - cursor: help; - } diff --git a/src/legacy/ui/public/styles/_legacy/components/_index.scss b/src/legacy/ui/public/styles/_legacy/components/_index.scss deleted file mode 100644 index cfae0700bb71e..0000000000000 --- a/src/legacy/ui/public/styles/_legacy/components/_index.scss +++ /dev/null @@ -1,13 +0,0 @@ -@import './ace_overrides'; -@import './control_group'; -@import './hintbox'; -@import './input'; -@import './kui_forms'; -@import './list_group_menu'; -@import './navbar'; -@import './config'; -@import './pagination'; -@import './spinner'; -@import './table'; -@import './truncate'; -@import './ui_select'; diff --git a/src/legacy/ui/public/styles/_legacy/components/_input.scss b/src/legacy/ui/public/styles/_legacy/components/_input.scss deleted file mode 100644 index 13efc9646e820..0000000000000 --- a/src/legacy/ui/public/styles/_legacy/components/_input.scss +++ /dev/null @@ -1,12 +0,0 @@ -i.input-error { - position: absolute; - margin-left: -$euiSizeL; - color: $euiColorDanger; - margin-top: $euiSizeS; - z-index: 5; -} - -select { - color: $euiTextColor; - background-color: $euiColorEmptyShade; -} diff --git a/src/legacy/ui/public/styles/_legacy/components/_kui_forms.scss b/src/legacy/ui/public/styles/_legacy/components/_kui_forms.scss deleted file mode 100644 index 2e1b814d647e3..0000000000000 --- a/src/legacy/ui/public/styles/_legacy/components/_kui_forms.scss +++ /dev/null @@ -1,29 +0,0 @@ -.form-control { - @include __legacyInputStyles__bad; -} - -select.form-control { - @include __legacySelectStyles__bad; -} - -.kuiFormSection { - margin-bottom: $euiSize; -} - -.kuiFormLabel { - @include __legacyLabelStyles__bad; - display: block; - margin-bottom: 5px; -} - -.kuiInputNote { - margin: $euiSizeXS 0 $euiSizeS; -} - -.kuiInputNote--danger { - color: $euiColorDanger; -} - -.kuiInputNote--warning { - color: $euiColorWarning; -} diff --git a/src/legacy/ui/public/styles/_legacy/components/_navbar.scss b/src/legacy/ui/public/styles/_legacy/components/_navbar.scss deleted file mode 100644 index b06c655789a50..0000000000000 --- a/src/legacy/ui/public/styles/_legacy/components/_navbar.scss +++ /dev/null @@ -1,86 +0,0 @@ -navbar { - @extend .control-group; - - max-height: 340px; - margin-bottom: 0; - padding: 0 $euiSizeS $euiSizeXS; - color: $euiColorDarkShade; - background-color: $euiColorLightShade; - border: none; - z-index: $euiZLevel1; - - > * { - padding-right: $euiSizeS; - } - - .navbar-text { - margin-top: $euiSizeXS; - margin-bottom: $euiSizeXS; - } - - // the "brand" that is displayed, usually on the left of the navbar - > .name { - @include euiTextTruncate; - - align-self: center; - font-size: $euiFontSizeL; - } - - button { - color: $euiColorDarkShade; - background-color: transparent; - - &:hover, - &:focus { - color: $euiColorDarkShade; - background-color: transparent; - } - - &:active, &.active { - color: $euiColorDarkestShade; - background-color: transparent; - box-shadow: none; - - &:focus { - outline: none; - } - } - - &[disabled] { - color: $euiColorMediumShade; - background-color: transparent; - } - } - - .inline-form .input-group { - button { - color: $euiColorEmptyShade; - background-color: $euiColorDarkShade; - border: none; - } - } - - // responsive modifications - - // desktop - @include euiBreakpoint('l', 'xl') { - > .name { - // 500px is sort of arbitrary, not sure how to deal with lots of buttons - max-width: 500px; - } - } - - // tablets/phones - @include euiBreakpoint('xs', 's', 'm') { - > .fill { - flex: 1 1 map-get($euiBreakpoints, 'l'); - } - } - - // phones - @include euiBreakpoint('xs', 's') { - > .name { - max-width: 100%; - } - } -} diff --git a/src/legacy/ui/public/styles/_legacy/components/_pagination.scss b/src/legacy/ui/public/styles/_legacy/components/_pagination.scss deleted file mode 100644 index cf68f2ac8253f..0000000000000 --- a/src/legacy/ui/public/styles/_legacy/components/_pagination.scss +++ /dev/null @@ -1,56 +0,0 @@ -paginate { - display: block; - - paginate-controls { - display: flex; - align-items: center; - padding: $euiSizeXS $euiSizeXS $euiSizeS; - text-align: center; - - .pagination-other-pages { - flex: 1 0 auto; - display: flex; - justify-content: center; - } - - .pagination-other-pages-list { - flex: 0 0 auto; - display: flex; - justify-content: center; - padding: 0; - margin: 0; - list-style: none; - - > li { - flex: 0 0 auto; - user-select: none; - - a { - text-decoration: none; - background-color: $euiColorLightestShade; - margin-left: $euiSizeXS / 2; - padding: $euiSizeS $euiSizeM; - } - - a:hover { - text-decoration: underline; - } - - &.active a { - text-decoration: none !important; - font-weight: $euiFontWeightBold; - color: $euiColorDarkShade; - cursor: default; - } - } - } - - .pagination-size { - flex: 0 0 auto; - - input[type=number] { - width: 3em; - } - } - } -} diff --git a/src/legacy/ui/public/styles/_legacy/components/_spinner.scss b/src/legacy/ui/public/styles/_legacy/components/_spinner.scss deleted file mode 100644 index 7b3b1bd615ae0..0000000000000 --- a/src/legacy/ui/public/styles/_legacy/components/_spinner.scss +++ /dev/null @@ -1,6 +0,0 @@ -.spinner.ng-hide { - visibility: hidden; - display: block !important; - opacity: 0; - transition-delay: 0.25s; -} diff --git a/src/legacy/ui/public/styles/_legacy/components/_table.scss b/src/legacy/ui/public/styles/_legacy/components/_table.scss deleted file mode 100644 index d0ac9d6f79862..0000000000000 --- a/src/legacy/ui/public/styles/_legacy/components/_table.scss +++ /dev/null @@ -1,46 +0,0 @@ -@import '../../../../../../plugins/discover/public/application/mixins'; - -.table { - // Nesting - .table { - background-color: $euiColorEmptyShade; - } -} - -kbn-table, .kbn-table, tbody[kbn-rows] { - @include dscDocSourceStyle; - // sub tables should not have a leading border - .table .table { - margin-bottom: 0; - - tr:first-child > td { - border-top: none; - } - - td.field-name { - font-weight: $euiFontWeightBold; - } - } -} - -table { - th { - i.fa-sort { - color: $euiColorLightShade; - } - - button.fa-sort-asc, - button.fa-sort-down, - i.fa-sort-asc, - i.fa-sort-down { - color: $euiColorPrimary; - } - - button.fa-sort-desc, - button.fa-sort-up, - i.fa-sort-desc, - i.fa-sort-up { - color: $euiColorPrimary; - } - } -} diff --git a/src/legacy/ui/public/styles/_legacy/components/_truncate.scss b/src/legacy/ui/public/styles/_legacy/components/_truncate.scss deleted file mode 100644 index 30ba5fea2a4ea..0000000000000 --- a/src/legacy/ui/public/styles/_legacy/components/_truncate.scss +++ /dev/null @@ -1,3 +0,0 @@ -.truncate-by-height { - overflow: hidden; -} diff --git a/src/legacy/ui/public/styles/_legacy/components/_ui_select.scss b/src/legacy/ui/public/styles/_legacy/components/_ui_select.scss deleted file mode 100644 index 691ec17b5b967..0000000000000 --- a/src/legacy/ui/public/styles/_legacy/components/_ui_select.scss +++ /dev/null @@ -1,357 +0,0 @@ -/*! - * ui-select - * http://github.com/angular-ui/ui-select - * Version: 0.19.5 - 2016-10-24T23:13:59.551Z - * License: MIT - */ - -/* Style when highlighting a search. */ -.ui-select-highlight { - font-weight: bold; -} - -.ui-select-offscreen { - clip: rect(0 0 0 0) !important; - width: 1px !important; - height: 1px !important; - border: 0 !important; - margin: 0 !important; - padding: 0 !important; - overflow: hidden !important; - position: absolute !important; - outline: 0 !important; - left: 0px !important; - top: 0px !important; -} - -.ui-select-choices-row:hover { - background-color: $euiColorLightestShade; -} - -/* Select2 theme */ - -/* Mark invalid Select2 */ -.ng-dirty.ng-invalid > a.select2-choice { - border-color: $euiColorDanger; -} - -.select2-result-single { - padding-left: 0; -} - -.select2-locked > .select2-search-choice-close { - display: none; -} - -.select-locked > .ui-select-match-close { - display: none; -} - -body > .select2-container.open { - z-index: 9999; /* The z-index Select2 applies to the select2-drop */ -} - -/* Handle up direction Select2 */ -.ui-select-container[theme='select2'].direction-up .ui-select-match, -.ui-select-container.select2.direction-up .ui-select-match { - border-radius: 4px; /* FIXME hardcoded value :-/ */ - border-top-left-radius: 0; - border-top-right-radius: 0; -} -.ui-select-container[theme='select2'].direction-up .ui-select-dropdown, -.ui-select-container.select2.direction-up .ui-select-dropdown { - border-radius: 4px; /* FIXME hardcoded value :-/ */ - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; - - border-top-width: 1px; /* FIXME hardcoded value :-/ */ - border-top-style: solid; - - box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.25); - - margin-top: -4px; /* FIXME hardcoded value :-/ */ -} -.ui-select-container[theme='select2'].direction-up .ui-select-dropdown .select2-search, -.ui-select-container.select2.direction-up .ui-select-dropdown .select2-search { - margin-top: 4px; /* FIXME hardcoded value :-/ */ -} -.ui-select-container[theme='select2'].direction-up.select2-dropdown-open .ui-select-match, -.ui-select-container.select2.direction-up.select2-dropdown-open .ui-select-match { - border-bottom-color: $euiColorPrimary; -} - -.ui-select-container[theme='select2'] .ui-select-dropdown .ui-select-search-hidden, -.ui-select-container[theme='select2'] .ui-select-dropdown .ui-select-search-hidden input { - opacity: 0; - height: 0; - min-height: 0; - padding: 0; - margin: 0; - border: 0; -} - -/* Bootstrap theme */ - -/* Helper class to show styles when focus */ -.btn-default-focus { - color: $euiTextColor; - background-color: $euiColorEmptyShade; - border-color: $euiColorPrimary; - text-decoration: none; - outline: none; - box-shadow: none; -} - -.ui-select-bootstrap .ui-select-toggle { - @include __legacyInputStyles__bad; - @include __legacySelectStyles__bad; -} - -.ui-select-bootstrap .ui-select-toggle > .caret { - display: none; -} - -/* Fix Bootstrap dropdown position when inside a input-group */ -.input-group > .ui-select-bootstrap.dropdown { - /* Instead of relative */ - position: static; -} - -.input-group > .ui-select-bootstrap > input.ui-select-search.form-control { - border-radius: 4px; /* FIXME hardcoded value :-/ */ - border-top-right-radius: 0; - border-bottom-right-radius: 0; -} -.input-group > .ui-select-bootstrap > input.ui-select-search.form-control.direction-up { - border-radius: 4px !important; /* FIXME hardcoded value :-/ */ - border-top-right-radius: 0 !important; - border-bottom-right-radius: 0 !important; -} - -.ui-select-bootstrap .ui-select-search-hidden { - opacity: 0; - height: 0; - min-height: 0; - padding: 0; - margin: 0; - border: 0; -} - -.ui-select-bootstrap > .ui-select-match > .btn { - @include __legacyInputStyles__bad; - @include __legacySelectStyles__bad; - text-align: left !important; // Instead of center because of .btn - - .ui-select-placeholder { - color: $euiColorMediumShade; - } - - &:focus, - &:active { - background-color: $euiColorEmptyShade; - color: $euiTextColor; - outline: none; - } -} - -.ui-select-bootstrap > .ui-select-match > .caret { - display: none; -} - -/* See Scrollable Menu with Bootstrap 3 http://stackoverflow.com/questions/19227496 */ -.ui-select-bootstrap > .ui-select-choices, -.ui-select-bootstrap > .ui-select-no-choice { - width: 100%; - height: auto; - max-height: $euiSize * 14; - overflow-x: hidden; -} - -body > .ui-select-bootstrap.open { - z-index: $euiZContentMenu; -} - -.ui-select-multiple.ui-select-bootstrap { - height: auto; - padding: 3px 5px 2px; - border: $euiBorderThin; - background-color: $euiFormBackgroundColor; - - &.kuiInputError { - border-color: $euiColorDanger; - } -} - -.ui-select-multiple.ui-select-bootstrap input.ui-select-search { - background-color: transparent !important; /* To prevent double background when disabled */ - border: none; - outline: none; - height: 1.666666em; - margin-bottom: 3px; -} - -.ui-select-multiple.ui-select-bootstrap .ui-select-match .close { - font-size: 1.6em; - line-height: 0.75; -} - -.ui-select-multiple.ui-select-bootstrap .ui-select-match-item { - outline: 0; - margin: 0 3px 3px 0; -} - -.ui-select-multiple .ui-select-match-item { - position: relative; -} - -.ui-select-multiple .ui-select-match-item.dropping .ui-select-match-close { - pointer-events: none; -} - -.ui-select-multiple:hover .ui-select-match-item.dropping-before:before { - content: ''; - position: absolute; - top: 0; - right: 100%; - height: 100%; - margin-right: 2px; - border-left: 1px solid $euiColorPrimary; -} - -.ui-select-multiple:hover .ui-select-match-item.dropping-after:after { - content: ''; - position: absolute; - top: 0; - left: 100%; - height: 100%; - margin-left: 2px; - border-right: 1px solid $euiColorPrimary; -} - -.ui-select-bootstrap .ui-select-choices-row > span { - @include euiFontSizeS; - @include euiTextTruncate; - font-weight: inherit; - cursor: pointer; - display: block; - padding: $euiSizeXS $euiSize; - clear: both; - color: $euiTextColor; - white-space: nowrap; - - &:hover, - &:focus { - text-decoration: none; - color: $euiTextColor; - background-color: $euiFocusBackgroundColor; - } -} - -.ui-select-bootstrap .ui-select-choices-row.active > span { - color: $euiTextColor; - text-decoration: none; - outline: 0; - background-color: $euiFocusBackgroundColor; -} - -.ui-select-bootstrap .ui-select-choices-row.disabled > span, -.ui-select-bootstrap .ui-select-choices-row.active.disabled > span { - color: $euiButtonColorDisabled; - cursor: not-allowed; - background-color: transparent; -} - -/* fix hide/show angular animation */ -.ui-select-match.ng-hide-add, -.ui-select-search.ng-hide-add { - display: none !important; -} - -/* Mark invalid Bootstrap */ -.ui-select-bootstrap.ng-dirty.ng-invalid > button.btn.ui-select-match { - border-color: $euiColorDanger; -} - -/* Handle up direction Bootstrap */ -.ui-select-container[theme='bootstrap'].direction-up .ui-select-dropdown { - @include euiBottomShadowMedium; -} - -.ui-select-bootstrap .ui-select-match-text { - width: 100%; - padding-right: 1em; -} -.ui-select-bootstrap .ui-select-match-text span { - display: inline-block; - width: 100%; - overflow: hidden; -} -.ui-select-bootstrap .ui-select-toggle > a.btn { - position: absolute; - height: 10px; - right: 10px; - margin-top: -2px; -} - -/* Spinner */ -.ui-select-refreshing { - position: absolute; - right: 0; - padding: 8px 27px; - top: 1px; - display: inline-block; - font-family: 'Glyphicons Halflings'; - font-style: normal; - font-weight: normal; - line-height: 1; - -webkit-font-smoothing: antialiased; -} - -@-webkit-keyframes ui-select-spin { - 0% { - -webkit-transform: rotate(0deg); - transform: rotate(0deg); - } - 100% { - -webkit-transform: rotate(359deg); - transform: rotate(359deg); - } -} -@keyframes ui-select-spin { - 0% { - -webkit-transform: rotate(0deg); - transform: rotate(0deg); - } - 100% { - -webkit-transform: rotate(359deg); - transform: rotate(359deg); - } -} - -.ui-select-spin { - -webkit-animation: ui-select-spin 2s infinite linear; - animation: ui-select-spin 2s infinite linear; -} - -.ui-select-refreshing.ng-animate { - -webkit-animation: none 0s; -} - -// Other Custom - -/** - * 1. Fix appearance of ui-select in the Filtering UI. - */ -.btn-default .ui-select-placeholder { - color: $euiColorMediumShade; /* 1 */ -} - -.uiSelectMatch--ellipsis { - @include euiTextTruncate; -} - -.ui-select-choices-group-label { - @include euiTitle('xxxs'); - @include euiTextTruncate; - padding: $euiSizeXS; -} diff --git a/src/legacy/ui/public/styles/_mixins.scss b/src/legacy/ui/public/styles/_mixins.scss index c0dc456000dcc..e335ef88a01b5 100644 --- a/src/legacy/ui/public/styles/_mixins.scss +++ b/src/legacy/ui/public/styles/_mixins.scss @@ -105,12 +105,10 @@ @keyframes kibanaFullScreenGraphics_FadeIn { from { opacity: 0; - transform: translateY(200px), scale(.75); } to { opacity: 1; - transform: translateY(0), scale(1); } } } diff --git a/src/plugins/discover/public/application/_discover.scss b/src/plugins/discover/public/application/_discover.scss index 1aaa0a24357ed..69df2a75b8d75 100644 --- a/src/plugins/discover/public/application/_discover.scss +++ b/src/plugins/discover/public/application/_discover.scss @@ -103,3 +103,15 @@ discover-app { right: $euiSizeM; top: $euiSizeXS; } + +[fixed-scroll] { + overflow-x: auto; + padding-bottom: 0; + + + .fixed-scroll-scroller { + position: fixed; + bottom: 0; + overflow-x: auto; + overflow-y: hidden; + } +} diff --git a/src/plugins/discover/public/application/_hacks.scss b/src/plugins/discover/public/application/_hacks.scss deleted file mode 100644 index 9bbe9cd14fd91..0000000000000 --- a/src/plugins/discover/public/application/_hacks.scss +++ /dev/null @@ -1,4 +0,0 @@ -// SASSTODO: the classname is dynamically generated with ng-class -.tab-discover { - overflow: hidden; -} diff --git a/src/plugins/discover/public/application/_mixins.scss b/src/plugins/discover/public/application/_mixins.scss deleted file mode 100644 index 100f81ae92bf0..0000000000000 --- a/src/plugins/discover/public/application/_mixins.scss +++ /dev/null @@ -1,27 +0,0 @@ -/** -* Style ES document _source in table view
key:
value
-* Use alpha so this will stand out against non-white backgrounds, e.g. the highlighted -* row in the Context Log. -*/ -@mixin dscDocSourceStyle { - dl.source { - margin-bottom: 0; - line-height:2em; - word-break: break-word; - - dt, dd { - display: inline; - } - - dt { - background-color: transparentize(shade($euiColorPrimary, 20%), .9); - color: $euiTextColor; - padding: ($euiSizeXS / 2) $euiSizeXS; - margin-right: $euiSizeXS; - word-break: normal; - border-radius: $euiBorderRadius; - } - } -} - - diff --git a/src/plugins/discover/public/application/angular/doc_table/_doc_table.scss b/src/plugins/discover/public/application/angular/doc_table/_doc_table.scss index 3e30214acd2a9..7d05171622e7b 100644 --- a/src/plugins/discover/public/application/angular/doc_table/_doc_table.scss +++ b/src/plugins/discover/public/application/angular/doc_table/_doc_table.scss @@ -27,7 +27,6 @@ doc-table { } .kbnDocTable { - @include dscDocSourceStyle; font-size: $euiFontSizeXS; th { @@ -40,6 +39,35 @@ doc-table { } } +.kbn-table, +.kbnDocTable { + /** + * Style ES document _source in table view
key:
value
+ * Use alpha so this will stand out against non-white backgrounds, e.g. the highlighted + * row in the Context Log. + */ + + dl.source { + margin-bottom: 0; + line-height: 2em; + word-break: break-word; + + dt, + dd { + display: inline; + } + + dt { + background-color: transparentize(shade($euiColorPrimary, 20%), 0.9); + color: $euiTextColor; + padding: ($euiSizeXS / 2) $euiSizeXS; + margin-right: $euiSizeXS; + word-break: normal; + border-radius: $euiBorderRadius; + } + } +} + .kbnDocTable__row { td { position: relative; @@ -80,3 +108,50 @@ doc-table { text-align: center; } +.truncate-by-height { + overflow: hidden; +} + +.table { + // Nesting + .table { + background-color: $euiColorEmptyShade; + } +} + +.kbn-table { + // sub tables should not have a leading border + .table .table { + margin-bottom: 0; + + tr:first-child > td { + border-top: none; + } + + td.field-name { + font-weight: $euiFontWeightBold; + } + } +} + +table { + th { + i.fa-sort { + color: $euiColorLightShade; + } + + button.fa-sort-asc, + button.fa-sort-down, + i.fa-sort-asc, + i.fa-sort-down { + color: $euiColorPrimary; + } + + button.fa-sort-desc, + button.fa-sort-up, + i.fa-sort-desc, + i.fa-sort-up { + color: $euiColorPrimary; + } + } +} diff --git a/src/plugins/discover/public/application/angular/doc_table/index.scss b/src/plugins/discover/public/application/angular/doc_table/index.scss index 4e6cb83c5fe5a..3663d807851c4 100644 --- a/src/plugins/discover/public/application/angular/doc_table/index.scss +++ b/src/plugins/discover/public/application/angular/doc_table/index.scss @@ -1,4 +1,2 @@ -@import '../../mixins'; - @import 'doc_table'; @import 'components/index'; diff --git a/src/plugins/discover/public/application/index.scss b/src/plugins/discover/public/application/index.scss index aaec7ab387e96..5aa353828274c 100644 --- a/src/plugins/discover/public/application/index.scss +++ b/src/plugins/discover/public/application/index.scss @@ -1,13 +1,2 @@ -// Discover plugin styles -@import 'mixins'; -@import 'discover'; -@import 'hacks'; - -// Prefix all styles with "dsc" to avoid conflicts. -// Examples -// dscTable -// dscTable__footer -// monChart__legend--small -// monChart__legend-isLoading - @import 'angular/index'; +@import 'discover'; diff --git a/src/plugins/kibana_legacy/public/paginate/_paginate.scss b/src/plugins/kibana_legacy/public/paginate/_paginate.scss new file mode 100644 index 0000000000000..e9c1acaf9ee0d --- /dev/null +++ b/src/plugins/kibana_legacy/public/paginate/_paginate.scss @@ -0,0 +1,57 @@ +paginate { + display: block; + + paginate-controls { + display: flex; + align-items: center; + padding: $euiSizeXS $euiSizeXS $euiSizeS; + text-align: center; + + .pagination-other-pages { + flex: 1 0 auto; + display: flex; + justify-content: center; + } + + .pagination-other-pages-list { + flex: 0 0 auto; + display: flex; + justify-content: center; + padding: 0; + margin: 0; + list-style: none; + + > li { + flex: 0 0 auto; + user-select: none; + + a { + text-decoration: none; + background-color: $euiColorLightestShade; + margin-left: $euiSizeXS / 2; + padding: $euiSizeS $euiSizeM; + } + + a:hover { + text-decoration: underline; + } + + &.active a { + text-decoration: none !important; + font-weight: $euiFontWeightBold; + color: $euiColorDarkShade; + cursor: default; + } + } + } + + .pagination-size { + flex: 0 0 auto; + + input[type=number] { + width: 3em; + } + } + } +} + diff --git a/src/plugins/kibana_legacy/public/paginate/paginate.js b/src/plugins/kibana_legacy/public/paginate/paginate.js index ea93a969d08c7..f424c33ba7b02 100644 --- a/src/plugins/kibana_legacy/public/paginate/paginate.js +++ b/src/plugins/kibana_legacy/public/paginate/paginate.js @@ -19,6 +19,7 @@ import _ from 'lodash'; import { i18n } from '@kbn/i18n'; +import './_paginate.scss'; import paginateControlsTemplate from './paginate_controls.html'; export function PaginateDirectiveProvider($parse, $compile) { diff --git a/src/plugins/timelion/public/_base.scss b/src/plugins/timelion/public/_base.scss new file mode 100644 index 0000000000000..616ac9b3486e7 --- /dev/null +++ b/src/plugins/timelion/public/_base.scss @@ -0,0 +1,19 @@ +// Angular form states +.ng-invalid { + &.ng-dirty, + &.ng-touched { + border-color: $euiColorDanger; + } +} + +input[type='radio'], +input[type='checkbox'], +.radio, +.checkbox { + &[disabled], + fieldset[disabled] & { + cursor: default; + opacity: .8; + } +} + diff --git a/src/legacy/ui/public/styles/_legacy/_mixins.scss b/src/plugins/timelion/public/directives/_form.scss similarity index 58% rename from src/legacy/ui/public/styles/_legacy/_mixins.scss rename to src/plugins/timelion/public/directives/_form.scss index 2834f60555070..3fcf70700a864 100644 --- a/src/legacy/ui/public/styles/_legacy/_mixins.scss +++ b/src/plugins/timelion/public/directives/_form.scss @@ -1,23 +1,19 @@ -// These mixins are temporary helpers to consolidate styles of elements that -// are not yet converted to use EUI. - -// DO NOT CONTINUE TO USE THESE MIXINS - -@mixin __legacyInputStyles__bad { - &:not([type='range']) { - appearance: none; - } +.form-control { + @include euiFontSizeS; display: block; width: 100%; height: $euiFormControlCompressedHeight; padding: $euiSizeXS $euiSizeM; - @include euiFontSizeS; border: $euiBorderThin; background-color: $euiFormBackgroundColor; color: $euiTextColor; border-radius: $euiBorderRadius; cursor: pointer; + &:not([type='range']) { + appearance: none; + } + &:focus { border-color: $euiColorPrimary; outline: none; @@ -25,30 +21,16 @@ } } -@mixin __legacySelectStyles__bad { +// sass-lint:disable-block no-qualifying-elements +select.form-control { // Makes the select arrow similar to EUI's arrowDown icon - background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='#{hexToRGB($euiTextColor)}' d='M13.0688508,5.15725038 L8.38423975,9.76827428 C8.17054415,9.97861308 7.82999214,9.97914095 7.61576025,9.76827428 L2.93114915,5.15725038 C2.7181359,4.94758321 2.37277319,4.94758321 2.15975994,5.15725038 C1.94674669,5.36691756 1.94674669,5.70685522 2.15975994,5.9165224 L6.84437104,10.5275463 C7.48517424,11.1582836 8.51644979,11.1566851 9.15562896,10.5275463 L13.8402401,5.9165224 C14.0532533,5.70685522 14.0532533,5.36691756 13.8402401,5.15725038 C13.6272268,4.94758321 13.2818641,4.94758321 13.0688508,5.15725038 Z'/%3E%3C/svg%3E"); + background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"%3E%3Cpath fill="#{hexToRGB($euiTextColor)}" d="M13.0688508,5.15725038 L8.38423975,9.76827428 C8.17054415,9.97861308 7.82999214,9.97914095 7.61576025,9.76827428 L2.93114915,5.15725038 C2.7181359,4.94758321 2.37277319,4.94758321 2.15975994,5.15725038 C1.94674669,5.36691756 1.94674669,5.70685522 2.15975994,5.9165224 L6.84437104,10.5275463 C7.48517424,11.1582836 8.51644979,11.1566851 9.15562896,10.5275463 L13.8402401,5.9165224 C14.0532533,5.70685522 14.0532533,5.36691756 13.8402401,5.15725038 C13.6272268,4.94758321 13.2818641,4.94758321 13.0688508,5.15725038 Z"/%3E%3C/svg%3E'); background-size: $euiSize; background-repeat: no-repeat; background-position: calc(100% - #{$euiSizeS}); padding-right: $euiSizeXL; - - &::-ms-expand { - display: none; - } - - &:focus::-ms-value { - color: $euiTextColor; - background: transparent; - } } -@mixin __legacyLabelStyles__bad { - font-size: $euiFontSizeXS; - font-weight: $euiFontWeightSemiBold; - color: $euiTextColor; - - &[for] { - cursor: pointer; - } +.fullWidth { + width: 100%; } diff --git a/src/plugins/timelion/public/directives/_index.scss b/src/plugins/timelion/public/directives/_index.scss index cd46a1a0a369e..a407c1dfabdeb 100644 --- a/src/plugins/timelion/public/directives/_index.scss +++ b/src/plugins/timelion/public/directives/_index.scss @@ -3,3 +3,6 @@ @import './timelion_expression_suggestions/index'; @import './timelion_help/index'; @import './timelion_interval/index'; +@import './saved_object_finder'; +@import './form'; + diff --git a/src/legacy/ui/public/styles/_legacy/components/_list_group_menu.scss b/src/plugins/timelion/public/directives/_saved_object_finder.scss similarity index 85% rename from src/legacy/ui/public/styles/_legacy/components/_list_group_menu.scss rename to src/plugins/timelion/public/directives/_saved_object_finder.scss index 3bac75cb19d9d..b97dace5e9e00 100644 --- a/src/legacy/ui/public/styles/_legacy/components/_list_group_menu.scss +++ b/src/plugins/timelion/public/directives/_saved_object_finder.scss @@ -1,7 +1,7 @@ .list-group-menu { &.select-mode a { - outline: none; - color: tintOrShade($euiColorPrimary, 10%, 10%); + outline: none; + color: tintOrShade($euiColorPrimary, 10%, 10%); } .list-group-menu-item { @@ -12,9 +12,11 @@ font-weight: bold; background-color: $euiColorLightShade; } + &:hover { background-color: tintOrShade($euiColorPrimary, 90%, 90%); } + li { list-style: none; color: tintOrShade($euiColorPrimary, 10%, 10%); diff --git a/src/plugins/timelion/public/index.scss b/src/plugins/timelion/public/index.scss index cf2a7859a505d..6bf7133287c51 100644 --- a/src/plugins/timelion/public/index.scss +++ b/src/plugins/timelion/public/index.scss @@ -8,4 +8,5 @@ // timChart__legend-isLoading @import './app'; +@import './base'; @import './directives/index'; diff --git a/src/plugins/vis_type_table/public/agg_table/_agg_table.scss b/src/plugins/vis_type_table/public/agg_table/_agg_table.scss index 0fffb21eab0fb..4bbc4eb034f8d 100644 --- a/src/plugins/vis_type_table/public/agg_table/_agg_table.scss +++ b/src/plugins/vis_type_table/public/agg_table/_agg_table.scss @@ -36,3 +36,7 @@ kbn-agg-table-group { padding: 0; } } + +.small { + font-size: 0.9em !important; +} diff --git a/x-pack/plugins/ml/public/application/_hacks.scss b/x-pack/plugins/ml/public/application/_hacks.scss index 39740360d8a84..63fec4e74b796 100644 --- a/x-pack/plugins/ml/public/application/_hacks.scss +++ b/x-pack/plugins/ml/public/application/_hacks.scss @@ -18,42 +18,6 @@ cursor: not-allowed; } -// ML bootstrap-select hacks that sit on top of Kibana hacks that often fight with KUI -// Should go away when EUI is fully adopted -.ui-select-match { - .btn-default[disabled], - .btn-default[disabled]:hover, - .btn-default[disabled]:focus { - background-color: $euiColorLightShade; - border-color: $euiColorLightShade; - opacity: 1; - - .ui-select-placeholder { - color: $euiColorDarkShade; - } - } - - .btn { - border: 1px solid $euiColorLightShade; - background-color: $euiColorEmptyShade; - color: $euiColorDarkestShade; - } - } - -.ui-select-container input[type="search"]::placeholder { - color: $euiColorDarkShade; -} - -.ui-select-container input[type="search"]:focus { - box-shadow: none; -} - -.ui-select-multiple.ui-select-bootstrap input.ui-select-search { - font-size: $euiFontSizeS; - padding: 5px 10px; // Matches current padding hacks from other parts of Kibana -} - - // SASSTODO: Remove all the floats .clear, .clearfix { clear: both; diff --git a/x-pack/plugins/reporting/server/lib/layouts/preserve_layout.css b/x-pack/plugins/reporting/server/lib/layouts/preserve_layout.css index 0ea9f3079de82..12ac5b27c7a4a 100644 --- a/x-pack/plugins/reporting/server/lib/layouts/preserve_layout.css +++ b/x-pack/plugins/reporting/server/lib/layouts/preserve_layout.css @@ -37,7 +37,6 @@ filter-bar, discover-app .dscTimechart, discover-app .dscSidebar__container, discover-app .kbnCollapsibleSidebar__collapseButton, -discover-app navbar[name=discover-search], discover-app .discover-table-footer { display: none; } diff --git a/x-pack/plugins/reporting/server/lib/layouts/print.css b/x-pack/plugins/reporting/server/lib/layouts/print.css index 4f1e3f4e5abd0..9b07e3c923138 100644 --- a/x-pack/plugins/reporting/server/lib/layouts/print.css +++ b/x-pack/plugins/reporting/server/lib/layouts/print.css @@ -36,7 +36,6 @@ filter-bar, discover-app .dscTimechart, discover-app .dscSidebar__container, discover-app .kbnCollapsibleSidebar__collapseButton, -discover-app navbar[name="discover-search"], discover-app .discover-table-footer { display: none; } From b29e8ee9c746dd2eff95d950ae4dbca564b11441 Mon Sep 17 00:00:00 2001 From: Pierre Gayvallet Date: Mon, 20 Jul 2020 10:55:44 +0200 Subject: [PATCH 50/59] migrate retryCallCluster for new ES client (#71412) * adapt retryCallCluster for new ES client * review comments * retry on 408 ResponseError * use error name instead of instanceof base check * use error name instead of instanceof base check bis * use mockImplementationOnce chaining Co-authored-by: restrry --- src/core/server/elasticsearch/client/index.ts | 1 + .../client/retry_call_cluster.test.ts | 283 ++++++++++++++++++ .../client/retry_call_cluster.ts | 103 +++++++ .../legacy/retry_call_cluster.ts | 4 +- 4 files changed, 389 insertions(+), 2 deletions(-) create mode 100644 src/core/server/elasticsearch/client/retry_call_cluster.test.ts create mode 100644 src/core/server/elasticsearch/client/retry_call_cluster.ts diff --git a/src/core/server/elasticsearch/client/index.ts b/src/core/server/elasticsearch/client/index.ts index 18e84482024ca..b8125de2ee498 100644 --- a/src/core/server/elasticsearch/client/index.ts +++ b/src/core/server/elasticsearch/client/index.ts @@ -22,3 +22,4 @@ export { IScopedClusterClient, ScopedClusterClient } from './scoped_cluster_clie export { ElasticsearchClientConfig } from './client_config'; export { IClusterClient, ICustomClusterClient, ClusterClient } from './cluster_client'; export { configureClient } from './configure_client'; +export { retryCallCluster, migrationRetryCallCluster } from './retry_call_cluster'; diff --git a/src/core/server/elasticsearch/client/retry_call_cluster.test.ts b/src/core/server/elasticsearch/client/retry_call_cluster.test.ts new file mode 100644 index 0000000000000..a7177c0b29047 --- /dev/null +++ b/src/core/server/elasticsearch/client/retry_call_cluster.test.ts @@ -0,0 +1,283 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { errors } from '@elastic/elasticsearch'; +import { elasticsearchClientMock } from './mocks'; +import { loggingSystemMock } from '../../logging/logging_system.mock'; +import { retryCallCluster, migrationRetryCallCluster } from './retry_call_cluster'; + +const dummyBody = { foo: 'bar' }; +const createErrorReturn = (err: any) => elasticsearchClientMock.createClientError(err); + +describe('retryCallCluster', () => { + let client: ReturnType; + + beforeEach(() => { + client = elasticsearchClientMock.createElasticSearchClient(); + }); + + it('returns response from ES API call in case of success', async () => { + const successReturn = elasticsearchClientMock.createClientResponse({ ...dummyBody }); + + client.asyncSearch.get.mockReturnValue(successReturn); + + const result = await retryCallCluster(() => client.asyncSearch.get()); + expect(result.body).toEqual(dummyBody); + }); + + it('retries ES API calls that rejects with `NoLivingConnectionsError`', async () => { + const successReturn = elasticsearchClientMock.createClientResponse({ ...dummyBody }); + + client.asyncSearch.get + .mockImplementationOnce(() => + createErrorReturn(new errors.NoLivingConnectionsError('no living connections', {} as any)) + ) + .mockImplementationOnce(() => successReturn); + + const result = await retryCallCluster(() => client.asyncSearch.get()); + expect(result.body).toEqual(dummyBody); + }); + + it('rejects when ES API calls reject with other errors', async () => { + client.ping + .mockImplementationOnce(() => createErrorReturn(new Error('unknown error'))) + .mockImplementationOnce(() => elasticsearchClientMock.createClientResponse({ ...dummyBody })); + + await expect(retryCallCluster(() => client.ping())).rejects.toMatchInlineSnapshot( + `[Error: unknown error]` + ); + }); + + it('stops retrying when ES API calls reject with other errors', async () => { + client.ping + .mockImplementationOnce(() => + createErrorReturn(new errors.NoLivingConnectionsError('no living connections', {} as any)) + ) + .mockImplementationOnce(() => + createErrorReturn(new errors.NoLivingConnectionsError('no living connections', {} as any)) + ) + .mockImplementationOnce(() => createErrorReturn(new Error('unknown error'))) + .mockImplementationOnce(() => elasticsearchClientMock.createClientResponse({ ...dummyBody })); + + await expect(retryCallCluster(() => client.ping())).rejects.toMatchInlineSnapshot( + `[Error: unknown error]` + ); + }); +}); + +describe('migrationRetryCallCluster', () => { + let client: ReturnType; + let logger: ReturnType; + + beforeEach(() => { + client = elasticsearchClientMock.createElasticSearchClient(); + logger = loggingSystemMock.createLogger(); + }); + + const mockClientPingWithErrorBeforeSuccess = (error: any) => { + client.ping + .mockImplementationOnce(() => createErrorReturn(error)) + .mockImplementationOnce(() => createErrorReturn(error)) + .mockImplementationOnce(() => elasticsearchClientMock.createClientResponse({ ...dummyBody })); + }; + + it('retries ES API calls that rejects with `NoLivingConnectionsError`', async () => { + mockClientPingWithErrorBeforeSuccess( + new errors.NoLivingConnectionsError('no living connections', {} as any) + ); + + const result = await migrationRetryCallCluster(() => client.ping(), logger, 1); + expect(result.body).toEqual(dummyBody); + }); + + it('retries ES API calls that rejects with `ConnectionError`', async () => { + mockClientPingWithErrorBeforeSuccess(new errors.ConnectionError('connection error', {} as any)); + + const result = await migrationRetryCallCluster(() => client.ping(), logger, 1); + expect(result.body).toEqual(dummyBody); + }); + + it('retries ES API calls that rejects with `TimeoutError`', async () => { + mockClientPingWithErrorBeforeSuccess(new errors.TimeoutError('timeout error', {} as any)); + + const result = await migrationRetryCallCluster(() => client.ping(), logger, 1); + expect(result.body).toEqual(dummyBody); + }); + + it('retries ES API calls that rejects with 503 `ResponseError`', async () => { + mockClientPingWithErrorBeforeSuccess( + new errors.ResponseError({ + statusCode: 503, + } as any) + ); + + const result = await migrationRetryCallCluster(() => client.ping(), logger, 1); + expect(result.body).toEqual(dummyBody); + }); + + it('retries ES API calls that rejects 401 `ResponseError`', async () => { + mockClientPingWithErrorBeforeSuccess( + new errors.ResponseError({ + statusCode: 401, + } as any) + ); + + const result = await migrationRetryCallCluster(() => client.ping(), logger, 1); + expect(result.body).toEqual(dummyBody); + }); + + it('retries ES API calls that rejects with 403 `ResponseError`', async () => { + mockClientPingWithErrorBeforeSuccess( + new errors.ResponseError({ + statusCode: 403, + } as any) + ); + + const result = await migrationRetryCallCluster(() => client.ping(), logger, 1); + expect(result.body).toEqual(dummyBody); + }); + + it('retries ES API calls that rejects with 408 `ResponseError`', async () => { + mockClientPingWithErrorBeforeSuccess( + new errors.ResponseError({ + statusCode: 408, + } as any) + ); + + const result = await migrationRetryCallCluster(() => client.ping(), logger, 1); + expect(result.body).toEqual(dummyBody); + }); + + it('retries ES API calls that rejects with 410 `ResponseError`', async () => { + mockClientPingWithErrorBeforeSuccess( + new errors.ResponseError({ + statusCode: 410, + } as any) + ); + + const result = await migrationRetryCallCluster(() => client.ping(), logger, 1); + expect(result.body).toEqual(dummyBody); + }); + + it('retries ES API calls that rejects with `snapshot_in_progress_exception` `ResponseError`', async () => { + mockClientPingWithErrorBeforeSuccess( + new errors.ResponseError({ + statusCode: 500, + body: { + error: { + type: 'snapshot_in_progress_exception', + }, + }, + } as any) + ); + + const result = await migrationRetryCallCluster(() => client.ping(), logger, 1); + expect(result.body).toEqual(dummyBody); + }); + + it('logs only once for each unique error message', async () => { + client.ping + .mockImplementationOnce(() => + createErrorReturn( + new errors.ResponseError({ + statusCode: 503, + } as any) + ) + ) + .mockImplementationOnce(() => + createErrorReturn(new errors.ConnectionError('connection error', {} as any)) + ) + .mockImplementationOnce(() => + createErrorReturn( + new errors.ResponseError({ + statusCode: 503, + } as any) + ) + ) + .mockImplementationOnce(() => + createErrorReturn(new errors.ConnectionError('connection error', {} as any)) + ) + .mockImplementationOnce(() => + createErrorReturn( + new errors.ResponseError({ + statusCode: 500, + body: { + error: { + type: 'snapshot_in_progress_exception', + }, + }, + } as any) + ) + ) + .mockImplementationOnce(() => elasticsearchClientMock.createClientResponse({ ...dummyBody })); + + await migrationRetryCallCluster(() => client.ping(), logger, 1); + + expect(loggingSystemMock.collect(logger).warn).toMatchInlineSnapshot(` + Array [ + Array [ + "Unable to connect to Elasticsearch. Error: Response Error", + ], + Array [ + "Unable to connect to Elasticsearch. Error: connection error", + ], + Array [ + "Unable to connect to Elasticsearch. Error: snapshot_in_progress_exception", + ], + ] + `); + }); + + it('rejects when ES API calls reject with other errors', async () => { + client.ping + .mockImplementationOnce(() => + createErrorReturn( + new errors.ResponseError({ + statusCode: 418, + body: { + error: { + type: `I'm a teapot`, + }, + }, + } as any) + ) + ) + .mockImplementationOnce(() => elasticsearchClientMock.createClientResponse({ ...dummyBody })); + + await expect( + migrationRetryCallCluster(() => client.ping(), logger, 1) + ).rejects.toMatchInlineSnapshot(`[ResponseError: I'm a teapot]`); + }); + + it('stops retrying when ES API calls reject with other errors', async () => { + client.ping + .mockImplementationOnce(() => + createErrorReturn(new errors.TimeoutError('timeout error', {} as any)) + ) + .mockImplementationOnce(() => + createErrorReturn(new errors.TimeoutError('timeout error', {} as any)) + ) + .mockImplementationOnce(() => createErrorReturn(new Error('unknown error'))) + .mockImplementationOnce(() => elasticsearchClientMock.createClientResponse({ ...dummyBody })); + + await expect( + migrationRetryCallCluster(() => client.ping(), logger, 1) + ).rejects.toMatchInlineSnapshot(`[Error: unknown error]`); + }); +}); diff --git a/src/core/server/elasticsearch/client/retry_call_cluster.ts b/src/core/server/elasticsearch/client/retry_call_cluster.ts new file mode 100644 index 0000000000000..1ad039e512215 --- /dev/null +++ b/src/core/server/elasticsearch/client/retry_call_cluster.ts @@ -0,0 +1,103 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { defer, throwError, iif, timer } from 'rxjs'; +import { concatMap, retryWhen } from 'rxjs/operators'; +import { Logger } from '../../logging'; + +const retryResponseStatuses = [ + 503, // ServiceUnavailable + 401, // AuthorizationException + 403, // AuthenticationException + 408, // RequestTimeout + 410, // Gone +]; + +/** + * Retries the provided Elasticsearch API call when a `NoLivingConnectionsError` error is + * encountered. The API call will be retried once a second, indefinitely, until + * a successful response or a different error is received. + * + * @example + * ```ts + * const response = await retryCallCluster(() => client.ping()); + * ``` + * + * @internal + */ +export const retryCallCluster = >(apiCaller: () => T): T => { + return defer(() => apiCaller()) + .pipe( + retryWhen((errors) => + errors.pipe( + concatMap((error) => + iif(() => error.name === 'NoLivingConnectionsError', timer(1000), throwError(error)) + ) + ) + ) + ) + .toPromise() as T; +}; + +/** + * Retries the provided Elasticsearch API call when an error such as + * `AuthenticationException` `NoConnections`, `ConnectionFault`, + * `ServiceUnavailable` or `RequestTimeout` are encountered. The API call will + * be retried once a second, indefinitely, until a successful response or a + * different error is received. + * + * @example + * ```ts + * const response = await migrationRetryCallCluster(() => client.ping(), logger); + * ``` + * + * @internal + */ +export const migrationRetryCallCluster = >( + apiCaller: () => T, + log: Logger, + delay: number = 2500 +): T => { + const previousErrors: string[] = []; + return defer(() => apiCaller()) + .pipe( + retryWhen((errors) => + errors.pipe( + concatMap((error) => { + if (!previousErrors.includes(error.message)) { + log.warn(`Unable to connect to Elasticsearch. Error: ${error.message}`); + previousErrors.push(error.message); + } + return iif( + () => + error.name === 'NoLivingConnectionsError' || + error.name === 'ConnectionError' || + error.name === 'TimeoutError' || + (error.name === 'ResponseError' && + retryResponseStatuses.includes(error.statusCode)) || + error?.body?.error?.type === 'snapshot_in_progress_exception', + timer(delay), + throwError(error) + ); + }) + ) + ) + ) + .toPromise() as T; +}; diff --git a/src/core/server/elasticsearch/legacy/retry_call_cluster.ts b/src/core/server/elasticsearch/legacy/retry_call_cluster.ts index 475a76d406017..1b05cb2bf13cd 100644 --- a/src/core/server/elasticsearch/legacy/retry_call_cluster.ts +++ b/src/core/server/elasticsearch/legacy/retry_call_cluster.ts @@ -53,7 +53,7 @@ export function migrationsRetryCallCluster( .pipe( retryWhen((error$) => error$.pipe( - concatMap((error, i) => { + concatMap((error) => { if (!previousErrors.includes(error.message)) { log.warn(`Unable to connect to Elasticsearch. Error: ${error.message}`); previousErrors.push(error.message); @@ -100,7 +100,7 @@ export function retryCallCluster(apiCaller: LegacyAPICaller) { .pipe( retryWhen((errors) => errors.pipe( - concatMap((error, i) => + concatMap((error) => iif( () => error instanceof legacyElasticsearch.errors.NoConnections, timer(1000), From ade93f0780c3a7fabb836c00021b7cc32a8a6b4d Mon Sep 17 00:00:00 2001 From: Tim Roes Date: Mon, 20 Jul 2020 11:40:39 +0200 Subject: [PATCH 51/59] Disable indexing of unnecessary Saved Object fields (#70409) * Disable indexing of unnecessary SO fields * Add doc_values * Add no doc_values to discover saved object Co-authored-by: Elastic Machine --- .../server/saved_objects/dashboard.ts | 24 ++++++++++--------- .../discover/server/saved_objects/search.ts | 8 +++---- .../server/saved_objects/visualization.ts | 10 ++++---- x-pack/plugins/lens/server/saved_objects.ts | 1 + 4 files changed, 24 insertions(+), 19 deletions(-) diff --git a/src/plugins/dashboard/server/saved_objects/dashboard.ts b/src/plugins/dashboard/server/saved_objects/dashboard.ts index 14d2c822a421e..850b2470dd475 100644 --- a/src/plugins/dashboard/server/saved_objects/dashboard.ts +++ b/src/plugins/dashboard/server/saved_objects/dashboard.ts @@ -44,21 +44,23 @@ export const dashboardSavedObjectType: SavedObjectsType = { mappings: { properties: { description: { type: 'text' }, - hits: { type: 'integer' }, - kibanaSavedObjectMeta: { properties: { searchSourceJSON: { type: 'text' } } }, - optionsJSON: { type: 'text' }, - panelsJSON: { type: 'text' }, + hits: { type: 'integer', index: false, doc_values: false }, + kibanaSavedObjectMeta: { + properties: { searchSourceJSON: { type: 'text', index: false, doc_values: false } }, + }, + optionsJSON: { type: 'text', index: false, doc_values: false }, + panelsJSON: { type: 'text', index: false, doc_values: false }, refreshInterval: { properties: { - display: { type: 'keyword' }, - pause: { type: 'boolean' }, - section: { type: 'integer' }, - value: { type: 'integer' }, + display: { type: 'keyword', index: false, doc_values: false }, + pause: { type: 'boolean', index: false, doc_values: false }, + section: { type: 'integer', index: false, doc_values: false }, + value: { type: 'integer', index: false, doc_values: false }, }, }, - timeFrom: { type: 'keyword' }, - timeRestore: { type: 'boolean' }, - timeTo: { type: 'keyword' }, + timeFrom: { type: 'keyword', index: false, doc_values: false }, + timeRestore: { type: 'boolean', index: false, doc_values: false }, + timeTo: { type: 'keyword', index: false, doc_values: false }, title: { type: 'text' }, version: { type: 'integer' }, }, diff --git a/src/plugins/discover/server/saved_objects/search.ts b/src/plugins/discover/server/saved_objects/search.ts index 2348d89c4f4dd..c13550e543ab6 100644 --- a/src/plugins/discover/server/saved_objects/search.ts +++ b/src/plugins/discover/server/saved_objects/search.ts @@ -43,15 +43,15 @@ export const searchSavedObjectType: SavedObjectsType = { }, mappings: { properties: { - columns: { type: 'keyword', index: false }, + columns: { type: 'keyword', index: false, doc_values: false }, description: { type: 'text' }, - hits: { type: 'integer', index: false }, + hits: { type: 'integer', index: false, doc_values: false }, kibanaSavedObjectMeta: { properties: { - searchSourceJSON: { type: 'text', index: false }, + searchSourceJSON: { type: 'text', index: false, doc_values: false }, }, }, - sort: { type: 'keyword', index: false }, + sort: { type: 'keyword', index: false, doc_values: false }, title: { type: 'text' }, version: { type: 'integer' }, }, diff --git a/src/plugins/visualizations/server/saved_objects/visualization.ts b/src/plugins/visualizations/server/saved_objects/visualization.ts index c4756de0a8386..ad7618a8640ba 100644 --- a/src/plugins/visualizations/server/saved_objects/visualization.ts +++ b/src/plugins/visualizations/server/saved_objects/visualization.ts @@ -44,12 +44,14 @@ export const visualizationSavedObjectType: SavedObjectsType = { mappings: { properties: { description: { type: 'text' }, - kibanaSavedObjectMeta: { properties: { searchSourceJSON: { type: 'text' } } }, - savedSearchRefName: { type: 'keyword' }, + kibanaSavedObjectMeta: { + properties: { searchSourceJSON: { type: 'text', index: false, doc_values: false } }, + }, + savedSearchRefName: { type: 'keyword', index: false, doc_values: false }, title: { type: 'text' }, - uiStateJSON: { type: 'text' }, + uiStateJSON: { type: 'text', index: false, doc_values: false }, version: { type: 'integer' }, - visState: { type: 'text' }, + visState: { type: 'text', index: false, doc_values: false }, }, }, migrations: visualizationSavedObjectTypeMigrations, diff --git a/x-pack/plugins/lens/server/saved_objects.ts b/x-pack/plugins/lens/server/saved_objects.ts index a16cc3dab7967..82ee490bb22af 100644 --- a/x-pack/plugins/lens/server/saved_objects.ts +++ b/x-pack/plugins/lens/server/saved_objects.ts @@ -40,6 +40,7 @@ export function setupSavedObjects(core: CoreSetup) { }, expression: { index: false, + doc_values: false, type: 'keyword', }, }, From 3442451aacb0d5e469019c470d5cf494276eabae Mon Sep 17 00:00:00 2001 From: Christos Nasikas Date: Mon, 20 Jul 2020 13:04:42 +0300 Subject: [PATCH 52/59] [Security Solution][Case] IBM Resilient content fixes (#72271) --- .../public/common/lib/connectors/resilient/index.tsx | 2 +- .../common/lib/connectors/resilient/translations.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/x-pack/plugins/security_solution/public/common/lib/connectors/resilient/index.tsx b/x-pack/plugins/security_solution/public/common/lib/connectors/resilient/index.tsx index d3daf195582a8..ba4879e87a1f6 100644 --- a/x-pack/plugins/security_solution/public/common/lib/connectors/resilient/index.tsx +++ b/x-pack/plugins/security_solution/public/common/lib/connectors/resilient/index.tsx @@ -30,7 +30,7 @@ const validateConnector = (action: ResilientActionConnector): ValidationResult = }; if (!action.config.orgId) { - errors.orgId = [...errors.orgId, i18n.RESILIENT_PROJECT_KEY_LABEL]; + errors.orgId = [...errors.orgId, i18n.RESILIENT_PROJECT_KEY_REQUIRED]; } if (!action.secrets.apiKeyId) { diff --git a/x-pack/plugins/security_solution/public/common/lib/connectors/resilient/translations.ts b/x-pack/plugins/security_solution/public/common/lib/connectors/resilient/translations.ts index f8aec2eea3d4b..2ff97ad354095 100644 --- a/x-pack/plugins/security_solution/public/common/lib/connectors/resilient/translations.ts +++ b/x-pack/plugins/security_solution/public/common/lib/connectors/resilient/translations.ts @@ -11,7 +11,7 @@ export * from '../translations'; export const RESILIENT_DESC = i18n.translate( 'xpack.securitySolution.case.connectors.resilient.selectMessageText', { - defaultMessage: 'Push or update SIEM case data to a new issue in resilient', + defaultMessage: 'Push or update Security case data to a new issue in Resilient', } ); @@ -25,28 +25,28 @@ export const RESILIENT_TITLE = i18n.translate( export const RESILIENT_PROJECT_KEY_LABEL = i18n.translate( 'xpack.securitySolution.case.connectors.resilient.orgId', { - defaultMessage: 'Organization Id', + defaultMessage: 'Organization ID', } ); export const RESILIENT_PROJECT_KEY_REQUIRED = i18n.translate( 'xpack.securitySolution.case.connectors.resilient.requiredOrgIdTextField', { - defaultMessage: 'Organization Id', + defaultMessage: 'Organization ID is required', } ); export const RESILIENT_API_KEY_ID_LABEL = i18n.translate( 'xpack.securitySolution.case.connectors.resilient.apiKeyId', { - defaultMessage: 'API key id', + defaultMessage: 'API key ID', } ); export const RESILIENT_API_KEY_ID_REQUIRED = i18n.translate( 'xpack.securitySolution.case.connectors.resilient.requiredApiKeyIdTextField', { - defaultMessage: 'API key id is required', + defaultMessage: 'API key ID is required', } ); From 4acdf278dc75d67041bbdbb8154df06301ba2f04 Mon Sep 17 00:00:00 2001 From: Dima Arnautov Date: Mon, 20 Jul 2020 12:25:13 +0200 Subject: [PATCH 53/59] [ML] fix charts container width init (#72389) --- .../explorer/actions/load_explorer_data.ts | 2 ++ .../explorer_charts_container_service.d.ts | 1 + .../explorer_charts_container_service.js | 10 +++++++--- .../explorer_charts_container_service.test.js | 14 ++++---------- .../ml/public/application/explorer/legacy_utils.ts | 13 ------------- 5 files changed, 14 insertions(+), 26 deletions(-) delete mode 100644 x-pack/plugins/ml/public/application/explorer/legacy_utils.ts diff --git a/x-pack/plugins/ml/public/application/explorer/actions/load_explorer_data.ts b/x-pack/plugins/ml/public/application/explorer/actions/load_explorer_data.ts index 3fcb032bd3ce1..9e53820fc00c5 100644 --- a/x-pack/plugins/ml/public/application/explorer/actions/load_explorer_data.ts +++ b/x-pack/plugins/ml/public/application/explorer/actions/load_explorer_data.ts @@ -200,6 +200,7 @@ const loadExplorerDataProvider = (anomalyTimelineService: AnomalyTimelineService if (selectedCells !== undefined && Array.isArray(anomalyChartRecords)) { memoizedAnomalyDataChange( lastRefresh, + swimlaneContainerWidth, anomalyChartRecords, timerange.earliestMs, timerange.latestMs, @@ -208,6 +209,7 @@ const loadExplorerDataProvider = (anomalyTimelineService: AnomalyTimelineService } else { memoizedAnomalyDataChange( lastRefresh, + swimlaneContainerWidth, [], timerange.earliestMs, timerange.latestMs, diff --git a/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container_service.d.ts b/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container_service.d.ts index 962072b974867..008f47d5b42ac 100644 --- a/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container_service.d.ts +++ b/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container_service.d.ts @@ -14,6 +14,7 @@ export declare interface ExplorerChartsData { export declare const getDefaultChartsData: () => ExplorerChartsData; export declare const anomalyDataChange: ( + chartsContainerWidth: number, anomalyRecords: any[], earliestMs: number, latestMs: number, diff --git a/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container_service.js b/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container_service.js index 898e29a303881..1b83a4ed30560 100644 --- a/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container_service.js +++ b/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container_service.js @@ -24,7 +24,6 @@ import { } from '../../../../common/util/job_utils'; import { mlResultsService } from '../../services/results_service'; import { mlJobService } from '../../services/job_service'; -import { getChartContainerWidth } from '../legacy_utils'; import { explorerService } from '../explorer_dashboard_service'; import { CHART_TYPE } from '../explorer_constants'; @@ -48,7 +47,13 @@ const MAX_CHARTS_PER_ROW = 4; // callback(getDefaultChartsData()); -export const anomalyDataChange = function (anomalyRecords, earliestMs, latestMs, severity = 0) { +export const anomalyDataChange = function ( + chartsContainerWidth, + anomalyRecords, + earliestMs, + latestMs, + severity = 0 +) { const data = getDefaultChartsData(); const filteredRecords = anomalyRecords.filter((record) => { @@ -56,7 +61,6 @@ export const anomalyDataChange = function (anomalyRecords, earliestMs, latestMs, }); const allSeriesRecords = processRecordsForDisplay(filteredRecords); // Calculate the number of charts per row, depending on the width available, to a max of 4. - const chartsContainerWidth = getChartContainerWidth(); let chartsPerRow = Math.min( Math.max(Math.floor(chartsContainerWidth / 550), 1), MAX_CHARTS_PER_ROW diff --git a/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container_service.test.js b/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container_service.test.js index 6a9fd19180a4e..433aa65cc5dd4 100644 --- a/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container_service.test.js +++ b/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container_service.test.js @@ -88,12 +88,6 @@ jest.mock('../../util/string_utils', () => ({ }, })); -jest.mock('../legacy_utils', () => ({ - getChartContainerWidth() { - return 1140; - }, -})); - jest.mock('../explorer_dashboard_service', () => ({ explorerService: { setCharts: jest.fn(), @@ -109,7 +103,7 @@ describe('explorerChartsContainerService', () => { }); test('call anomalyChangeListener with empty series config', (done) => { - anomalyDataChange([], 1486656000000, 1486670399999); + anomalyDataChange(1140, [], 1486656000000, 1486670399999); setImmediate(() => { expect(explorerService.setCharts.mock.calls.length).toBe(1); @@ -122,7 +116,7 @@ describe('explorerChartsContainerService', () => { }); test('call anomalyChangeListener with actual series config', (done) => { - anomalyDataChange(mockAnomalyChartRecords, 1486656000000, 1486670399999); + anomalyDataChange(1140, mockAnomalyChartRecords, 1486656000000, 1486670399999); setImmediate(() => { expect(explorerService.setCharts.mock.calls.length).toBe(2); @@ -138,7 +132,7 @@ describe('explorerChartsContainerService', () => { return d; }); - anomalyDataChange(mockAnomalyChartRecordsClone, 1486656000000, 1486670399999); + anomalyDataChange(1140, mockAnomalyChartRecordsClone, 1486656000000, 1486670399999); setImmediate(() => { expect(explorerService.setCharts.mock.calls.length).toBe(2); @@ -161,7 +155,7 @@ describe('explorerChartsContainerService', () => { mockAnomalyChartRecordsClone[1].partition_field_value = 'AAL.'; expect(() => { - anomalyDataChange(mockAnomalyChartRecordsClone, 1486656000000, 1486670399999); + anomalyDataChange(1140, mockAnomalyChartRecordsClone, 1486656000000, 1486670399999); }).not.toThrow(); setImmediate(() => { diff --git a/x-pack/plugins/ml/public/application/explorer/legacy_utils.ts b/x-pack/plugins/ml/public/application/explorer/legacy_utils.ts deleted file mode 100644 index b85b0401c45ca..0000000000000 --- a/x-pack/plugins/ml/public/application/explorer/legacy_utils.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -// This file includes utils which should eventuelly become obsolete once Anomaly Explorer -// is fully migrated to React. Their purpose is to retain functionality while we migrate step by step. - -export function getChartContainerWidth() { - const chartContainer = document.querySelector('.explorer-charts'); - return Math.floor((chartContainer && chartContainer.clientWidth) || 0); -} From 7976e2bda4c395adc5c9587d95e498d482a92eb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=AA=20Marcondes?= <55978943+cauemarcondes@users.noreply.github.com> Date: Mon, 20 Jul 2020 11:39:26 +0100 Subject: [PATCH 54/59] [APM] Testing error rate API and restructuring folders (#72257) * adding error rate and restructuring tests * removing console log * removing console log * adding error rate and restructuring tests * fixing TS error * removing unnecessary files * removing trial tests --- .../apm_api_integration/basic/tests/index.ts | 36 +++++++++----- .../tests/{ => service_maps}/service_maps.ts | 2 +- .../services/{transactions => }/agent_name.ts | 2 +- .../basic/tests/{ => services}/annotations.ts | 2 +- .../{transactions => }/transaction_types.ts | 2 +- .../{ => settings}/agent_configuration.ts | 6 +-- .../basic/tests/{ => settings}/custom_link.ts | 4 +- .../top_traces.expectation.json | 0 .../basic/tests/traces/top_traces.ts | 2 +- .../tests/transaction_groups/error_rate.ts | 47 +++++++++++++++++++ .../expectation/error_rate.json | 42 +++++++++++++++++ .../expectation}/top_transaction_groups.json | 0 .../expectation}/transaction_charts.json | 0 .../top_transaction_groups.ts | 4 +- .../transaction_charts.ts | 4 +- .../apm_api_integration/trial/tests/index.ts | 12 +++-- .../tests/{ => service_maps}/service_maps.ts | 2 +- .../trial/tests/{ => services}/annotations.ts | 2 +- .../tests/{ => services}/rum_services.ts | 2 +- 19 files changed, 138 insertions(+), 33 deletions(-) rename x-pack/test/apm_api_integration/basic/tests/{ => service_maps}/service_maps.ts (93%) rename x-pack/test/apm_api_integration/basic/tests/services/{transactions => }/agent_name.ts (94%) rename x-pack/test/apm_api_integration/basic/tests/{ => services}/annotations.ts (95%) rename x-pack/test/apm_api_integration/basic/tests/services/{transactions => }/transaction_types.ts (94%) rename x-pack/test/apm_api_integration/basic/tests/{ => settings}/agent_configuration.ts (98%) rename x-pack/test/apm_api_integration/basic/tests/{ => settings}/custom_link.ts (96%) rename x-pack/test/apm_api_integration/basic/tests/traces/{ => expectation}/top_traces.expectation.json (100%) create mode 100644 x-pack/test/apm_api_integration/basic/tests/transaction_groups/error_rate.ts create mode 100644 x-pack/test/apm_api_integration/basic/tests/transaction_groups/expectation/error_rate.json rename x-pack/test/apm_api_integration/basic/tests/{services/transactions/expectations => transaction_groups/expectation}/top_transaction_groups.json (100%) rename x-pack/test/apm_api_integration/basic/tests/{services/transactions/expectations => transaction_groups/expectation}/transaction_charts.json (100%) rename x-pack/test/apm_api_integration/basic/tests/{services/transactions => transaction_groups}/top_transaction_groups.ts (93%) rename x-pack/test/apm_api_integration/basic/tests/{services/transactions => transaction_groups}/transaction_charts.ts (91%) rename x-pack/test/apm_api_integration/trial/tests/{ => service_maps}/service_maps.ts (99%) rename x-pack/test/apm_api_integration/trial/tests/{ => services}/annotations.ts (99%) rename x-pack/test/apm_api_integration/trial/tests/{ => services}/rum_services.ts (95%) diff --git a/x-pack/test/apm_api_integration/basic/tests/index.ts b/x-pack/test/apm_api_integration/basic/tests/index.ts index 3658208e38d00..873aa478ad080 100644 --- a/x-pack/test/apm_api_integration/basic/tests/index.ts +++ b/x-pack/test/apm_api_integration/basic/tests/index.ts @@ -9,22 +9,32 @@ export default function apmApiIntegrationTests({ loadTestFile }: FtrProviderCont describe('APM specs (basic)', function () { this.tags('ciGroup1'); - loadTestFile(require.resolve('./annotations')); loadTestFile(require.resolve('./feature_controls')); - loadTestFile(require.resolve('./agent_configuration')); - loadTestFile(require.resolve('./custom_link')); - loadTestFile(require.resolve('./service_maps')); - // traces - loadTestFile(require.resolve('./traces/top_traces')); + describe('Service Maps', function () { + loadTestFile(require.resolve('./service_maps/service_maps')); + }); - // services - loadTestFile(require.resolve('./services/top_services')); + describe('Services', function () { + loadTestFile(require.resolve('./services/annotations')); + loadTestFile(require.resolve('./services/top_services')); + loadTestFile(require.resolve('./services/agent_name')); + loadTestFile(require.resolve('./services/transaction_types')); + }); - // services/transaction - loadTestFile(require.resolve('./services/transactions/top_transaction_groups')); - loadTestFile(require.resolve('./services/transactions/transaction_charts')); - loadTestFile(require.resolve('./services/transactions/agent_name')); - loadTestFile(require.resolve('./services/transactions/transaction_types')); + describe('Settings', function () { + loadTestFile(require.resolve('./settings/custom_link')); + loadTestFile(require.resolve('./settings/agent_configuration')); + }); + + describe('Traces', function () { + loadTestFile(require.resolve('./traces/top_traces')); + }); + + describe('Transaction Group', function () { + loadTestFile(require.resolve('./transaction_groups/top_transaction_groups')); + loadTestFile(require.resolve('./transaction_groups/transaction_charts')); + loadTestFile(require.resolve('./transaction_groups/error_rate')); + }); }); } diff --git a/x-pack/test/apm_api_integration/basic/tests/service_maps.ts b/x-pack/test/apm_api_integration/basic/tests/service_maps/service_maps.ts similarity index 93% rename from x-pack/test/apm_api_integration/basic/tests/service_maps.ts rename to x-pack/test/apm_api_integration/basic/tests/service_maps/service_maps.ts index 45972aaf529af..b0e503eb7d1eb 100644 --- a/x-pack/test/apm_api_integration/basic/tests/service_maps.ts +++ b/x-pack/test/apm_api_integration/basic/tests/service_maps/service_maps.ts @@ -5,7 +5,7 @@ */ import expect from '@kbn/expect'; -import { FtrProviderContext } from '../../common/ftr_provider_context'; +import { FtrProviderContext } from '../../../common/ftr_provider_context'; export default function serviceMapsApiTests({ getService }: FtrProviderContext) { const supertest = getService('supertest'); diff --git a/x-pack/test/apm_api_integration/basic/tests/services/transactions/agent_name.ts b/x-pack/test/apm_api_integration/basic/tests/services/agent_name.ts similarity index 94% rename from x-pack/test/apm_api_integration/basic/tests/services/transactions/agent_name.ts rename to x-pack/test/apm_api_integration/basic/tests/services/agent_name.ts index a9aeaf813aa5c..5be5e43b359f5 100644 --- a/x-pack/test/apm_api_integration/basic/tests/services/transactions/agent_name.ts +++ b/x-pack/test/apm_api_integration/basic/tests/services/agent_name.ts @@ -5,7 +5,7 @@ */ import expect from '@kbn/expect'; -import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; +import { FtrProviderContext } from '../../../../common/ftr_provider_context'; export default function ApiTest({ getService }: FtrProviderContext) { const supertest = getService('supertest'); diff --git a/x-pack/test/apm_api_integration/basic/tests/annotations.ts b/x-pack/test/apm_api_integration/basic/tests/services/annotations.ts similarity index 95% rename from x-pack/test/apm_api_integration/basic/tests/annotations.ts rename to x-pack/test/apm_api_integration/basic/tests/services/annotations.ts index e0659fe195f93..3136dcef2e985 100644 --- a/x-pack/test/apm_api_integration/basic/tests/annotations.ts +++ b/x-pack/test/apm_api_integration/basic/tests/services/annotations.ts @@ -6,7 +6,7 @@ import expect from '@kbn/expect'; import { JsonObject } from 'src/plugins/kibana_utils/common'; -import { FtrProviderContext } from '../../common/ftr_provider_context'; +import { FtrProviderContext } from '../../../common/ftr_provider_context'; export default function annotationApiTests({ getService }: FtrProviderContext) { const supertestWrite = getService('supertestAsApmAnnotationsWriteUser'); diff --git a/x-pack/test/apm_api_integration/basic/tests/services/transactions/transaction_types.ts b/x-pack/test/apm_api_integration/basic/tests/services/transaction_types.ts similarity index 94% rename from x-pack/test/apm_api_integration/basic/tests/services/transactions/transaction_types.ts rename to x-pack/test/apm_api_integration/basic/tests/services/transaction_types.ts index 56844dfcedda1..3e8f320ad6b24 100644 --- a/x-pack/test/apm_api_integration/basic/tests/services/transactions/transaction_types.ts +++ b/x-pack/test/apm_api_integration/basic/tests/services/transaction_types.ts @@ -5,7 +5,7 @@ */ import expect from '@kbn/expect'; -import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; +import { FtrProviderContext } from '../../../../common/ftr_provider_context'; export default function ApiTest({ getService }: FtrProviderContext) { const supertest = getService('supertest'); diff --git a/x-pack/test/apm_api_integration/basic/tests/agent_configuration.ts b/x-pack/test/apm_api_integration/basic/tests/settings/agent_configuration.ts similarity index 98% rename from x-pack/test/apm_api_integration/basic/tests/agent_configuration.ts rename to x-pack/test/apm_api_integration/basic/tests/settings/agent_configuration.ts index 1c8097760bc04..283540201b9b5 100644 --- a/x-pack/test/apm_api_integration/basic/tests/agent_configuration.ts +++ b/x-pack/test/apm_api_integration/basic/tests/settings/agent_configuration.ts @@ -6,9 +6,9 @@ import expect from '@kbn/expect'; import { omit, orderBy } from 'lodash'; -import { AgentConfigurationIntake } from '../../../../plugins/apm/common/agent_configuration/configuration_types'; -import { AgentConfigSearchParams } from '../../../../plugins/apm/server/routes/settings/agent_configuration'; -import { FtrProviderContext } from '../../common/ftr_provider_context'; +import { AgentConfigurationIntake } from '../../../../../plugins/apm/common/agent_configuration/configuration_types'; +import { AgentConfigSearchParams } from '../../../../../plugins/apm/server/routes/settings/agent_configuration'; +import { FtrProviderContext } from '../../../common/ftr_provider_context'; export default function agentConfigurationTests({ getService }: FtrProviderContext) { const supertestRead = getService('supertestAsApmReadUser'); diff --git a/x-pack/test/apm_api_integration/basic/tests/custom_link.ts b/x-pack/test/apm_api_integration/basic/tests/settings/custom_link.ts similarity index 96% rename from x-pack/test/apm_api_integration/basic/tests/custom_link.ts rename to x-pack/test/apm_api_integration/basic/tests/settings/custom_link.ts index ec93d2b3a3b41..9465708db2fba 100644 --- a/x-pack/test/apm_api_integration/basic/tests/custom_link.ts +++ b/x-pack/test/apm_api_integration/basic/tests/settings/custom_link.ts @@ -5,8 +5,8 @@ */ import URL from 'url'; import expect from '@kbn/expect'; -import { CustomLink } from '../../../../plugins/apm/common/custom_link/custom_link_types'; -import { FtrProviderContext } from '../../common/ftr_provider_context'; +import { CustomLink } from '../../../../../plugins/apm/common/custom_link/custom_link_types'; +import { FtrProviderContext } from '../../../common/ftr_provider_context'; export default function customLinksTests({ getService }: FtrProviderContext) { const supertestRead = getService('supertestAsApmReadUser'); diff --git a/x-pack/test/apm_api_integration/basic/tests/traces/top_traces.expectation.json b/x-pack/test/apm_api_integration/basic/tests/traces/expectation/top_traces.expectation.json similarity index 100% rename from x-pack/test/apm_api_integration/basic/tests/traces/top_traces.expectation.json rename to x-pack/test/apm_api_integration/basic/tests/traces/expectation/top_traces.expectation.json diff --git a/x-pack/test/apm_api_integration/basic/tests/traces/top_traces.ts b/x-pack/test/apm_api_integration/basic/tests/traces/top_traces.ts index aef208b6fc06b..e96cb20a68fda 100644 --- a/x-pack/test/apm_api_integration/basic/tests/traces/top_traces.ts +++ b/x-pack/test/apm_api_integration/basic/tests/traces/top_traces.ts @@ -5,7 +5,7 @@ */ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../../common/ftr_provider_context'; -import expectTopTraces from './top_traces.expectation.json'; +import expectTopTraces from './expectation/top_traces.expectation.json'; export default function ApiTest({ getService }: FtrProviderContext) { const supertest = getService('supertest'); diff --git a/x-pack/test/apm_api_integration/basic/tests/transaction_groups/error_rate.ts b/x-pack/test/apm_api_integration/basic/tests/transaction_groups/error_rate.ts new file mode 100644 index 0000000000000..2c22cbbcce780 --- /dev/null +++ b/x-pack/test/apm_api_integration/basic/tests/transaction_groups/error_rate.ts @@ -0,0 +1,47 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../../common/ftr_provider_context'; +import expectedErrorRate from './expectation/error_rate.json'; + +export default function ApiTest({ getService }: FtrProviderContext) { + const supertest = getService('supertest'); + const esArchiver = getService('esArchiver'); + + // url parameters + const start = encodeURIComponent('2020-06-29T06:45:00.000Z'); + const end = encodeURIComponent('2020-06-29T06:49:00.000Z'); + const uiFilters = encodeURIComponent(JSON.stringify({})); + + describe('Error rate', () => { + describe('when data is not loaded', () => { + it('handles the empty state', async () => { + const response = await supertest.get( + `/api/apm/services/opbeans-node/transaction_groups/error_rate?start=${start}&end=${end}&uiFilters=${uiFilters}` + ); + expect(response.status).to.be(200); + expect(response.body).to.eql({ + noHits: true, + erroneousTransactionsRate: [], + average: null, + }); + }); + }); + describe('when data is loaded', () => { + before(() => esArchiver.load('8.0.0')); + after(() => esArchiver.unload('8.0.0')); + + it('returns the transaction error rate', async () => { + const response = await supertest.get( + `/api/apm/services/opbeans-node/transaction_groups/error_rate?start=${start}&end=${end}&uiFilters=${uiFilters}` + ); + + expect(response.status).to.be(200); + expect(response.body).to.eql(expectedErrorRate); + }); + }); + }); +} diff --git a/x-pack/test/apm_api_integration/basic/tests/transaction_groups/expectation/error_rate.json b/x-pack/test/apm_api_integration/basic/tests/transaction_groups/expectation/error_rate.json new file mode 100644 index 0000000000000..9ff45ebdbb21b --- /dev/null +++ b/x-pack/test/apm_api_integration/basic/tests/transaction_groups/expectation/error_rate.json @@ -0,0 +1,42 @@ +{ + "noHits":false, + "erroneousTransactionsRate":[ + { + "x":1593413100000, + "y":null + }, + { + "x":1593413130000, + "y":null + }, + { + "x":1593413160000, + "y":null + }, + { + "x":1593413190000, + "y":null + }, + { + "x":1593413220000, + "y":null + }, + { + "x":1593413250000, + "y":0 + }, + { + "x":1593413280000, + "y":0.14102564102564102 + }, + { + "x":1593413310000, + "y":0.14634146341463414 + }, + { + "x":1593413340000, + "y":null + } + ], + "average":0.09578903481342504 +} \ No newline at end of file diff --git a/x-pack/test/apm_api_integration/basic/tests/services/transactions/expectations/top_transaction_groups.json b/x-pack/test/apm_api_integration/basic/tests/transaction_groups/expectation/top_transaction_groups.json similarity index 100% rename from x-pack/test/apm_api_integration/basic/tests/services/transactions/expectations/top_transaction_groups.json rename to x-pack/test/apm_api_integration/basic/tests/transaction_groups/expectation/top_transaction_groups.json diff --git a/x-pack/test/apm_api_integration/basic/tests/services/transactions/expectations/transaction_charts.json b/x-pack/test/apm_api_integration/basic/tests/transaction_groups/expectation/transaction_charts.json similarity index 100% rename from x-pack/test/apm_api_integration/basic/tests/services/transactions/expectations/transaction_charts.json rename to x-pack/test/apm_api_integration/basic/tests/transaction_groups/expectation/transaction_charts.json diff --git a/x-pack/test/apm_api_integration/basic/tests/services/transactions/top_transaction_groups.ts b/x-pack/test/apm_api_integration/basic/tests/transaction_groups/top_transaction_groups.ts similarity index 93% rename from x-pack/test/apm_api_integration/basic/tests/services/transactions/top_transaction_groups.ts rename to x-pack/test/apm_api_integration/basic/tests/transaction_groups/top_transaction_groups.ts index bf8d3f6a56e6a..43b2ad5414c7a 100644 --- a/x-pack/test/apm_api_integration/basic/tests/services/transactions/top_transaction_groups.ts +++ b/x-pack/test/apm_api_integration/basic/tests/transaction_groups/top_transaction_groups.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ import expect from '@kbn/expect'; -import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; -import expectedTransactionGroups from './expectations/top_transaction_groups.json'; +import { FtrProviderContext } from '../../../../common/ftr_provider_context'; +import expectedTransactionGroups from './expectation/top_transaction_groups.json'; export default function ApiTest({ getService }: FtrProviderContext) { const supertest = getService('supertest'); diff --git a/x-pack/test/apm_api_integration/basic/tests/services/transactions/transaction_charts.ts b/x-pack/test/apm_api_integration/basic/tests/transaction_groups/transaction_charts.ts similarity index 91% rename from x-pack/test/apm_api_integration/basic/tests/services/transactions/transaction_charts.ts rename to x-pack/test/apm_api_integration/basic/tests/transaction_groups/transaction_charts.ts index 7178498863787..68a7499a2389c 100644 --- a/x-pack/test/apm_api_integration/basic/tests/services/transactions/transaction_charts.ts +++ b/x-pack/test/apm_api_integration/basic/tests/transaction_groups/transaction_charts.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ import expect from '@kbn/expect'; -import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; -import expectedTransactionCharts from './expectations/transaction_charts.json'; +import { FtrProviderContext } from '../../../../common/ftr_provider_context'; +import expectedTransactionCharts from './expectation/transaction_charts.json'; export default function ApiTest({ getService }: FtrProviderContext) { const supertest = getService('supertest'); diff --git a/x-pack/test/apm_api_integration/trial/tests/index.ts b/x-pack/test/apm_api_integration/trial/tests/index.ts index 37328badcb794..fb942f755a063 100644 --- a/x-pack/test/apm_api_integration/trial/tests/index.ts +++ b/x-pack/test/apm_api_integration/trial/tests/index.ts @@ -9,8 +9,14 @@ import { FtrProviderContext } from '../../../api_integration/ftr_provider_contex export default function observabilityApiIntegrationTests({ loadTestFile }: FtrProviderContext) { describe('APM specs (trial)', function () { this.tags('ciGroup1'); - loadTestFile(require.resolve('./annotations')); - loadTestFile(require.resolve('./service_maps')); - loadTestFile(require.resolve('./rum_services')); + + describe('Services', function () { + loadTestFile(require.resolve('./services/annotations')); + loadTestFile(require.resolve('./services/rum_services.ts')); + }); + + describe('Service Maps', function () { + loadTestFile(require.resolve('./service_maps/service_maps')); + }); }); } diff --git a/x-pack/test/apm_api_integration/trial/tests/service_maps.ts b/x-pack/test/apm_api_integration/trial/tests/service_maps/service_maps.ts similarity index 99% rename from x-pack/test/apm_api_integration/trial/tests/service_maps.ts rename to x-pack/test/apm_api_integration/trial/tests/service_maps/service_maps.ts index 0b370f6a30a8b..4002e8cff5bad 100644 --- a/x-pack/test/apm_api_integration/trial/tests/service_maps.ts +++ b/x-pack/test/apm_api_integration/trial/tests/service_maps/service_maps.ts @@ -6,7 +6,7 @@ import querystring from 'querystring'; import expect from '@kbn/expect'; -import { FtrProviderContext } from '../../common/ftr_provider_context'; +import { FtrProviderContext } from '../../../common/ftr_provider_context'; export default function serviceMapsApiTests({ getService }: FtrProviderContext) { const supertest = getService('supertest'); diff --git a/x-pack/test/apm_api_integration/trial/tests/annotations.ts b/x-pack/test/apm_api_integration/trial/tests/services/annotations.ts similarity index 99% rename from x-pack/test/apm_api_integration/trial/tests/annotations.ts rename to x-pack/test/apm_api_integration/trial/tests/services/annotations.ts index 662879c495230..c2ddc10c5f1d2 100644 --- a/x-pack/test/apm_api_integration/trial/tests/annotations.ts +++ b/x-pack/test/apm_api_integration/trial/tests/services/annotations.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; import { merge, cloneDeep, isPlainObject } from 'lodash'; import { JsonObject } from 'src/plugins/kibana_utils/common'; -import { FtrProviderContext } from '../../common/ftr_provider_context'; +import { FtrProviderContext } from '../../../common/ftr_provider_context'; const DEFAULT_INDEX_NAME = 'observability-annotations'; diff --git a/x-pack/test/apm_api_integration/trial/tests/rum_services.ts b/x-pack/test/apm_api_integration/trial/tests/services/rum_services.ts similarity index 95% rename from x-pack/test/apm_api_integration/trial/tests/rum_services.ts rename to x-pack/test/apm_api_integration/trial/tests/services/rum_services.ts index 5505387de54a7..78171a65a11fd 100644 --- a/x-pack/test/apm_api_integration/trial/tests/rum_services.ts +++ b/x-pack/test/apm_api_integration/trial/tests/services/rum_services.ts @@ -5,7 +5,7 @@ */ import expect from '@kbn/expect'; -import { FtrProviderContext } from '../../common/ftr_provider_context'; +import { FtrProviderContext } from '../../../common/ftr_provider_context'; export default function rumServicesApiTests({ getService }: FtrProviderContext) { const supertest = getService('supertest'); From b1edce8050cc209053d094f1788b7de657123ae2 Mon Sep 17 00:00:00 2001 From: Dima Arnautov Date: Mon, 20 Jul 2020 12:50:09 +0200 Subject: [PATCH 55/59] [ML] improve annotation flyout performance (#72299) --- .../annotations/annotation_flyout/index.tsx | 270 ++++++++++-------- 1 file changed, 148 insertions(+), 122 deletions(-) diff --git a/x-pack/plugins/ml/public/application/components/annotations/annotation_flyout/index.tsx b/x-pack/plugins/ml/public/application/components/annotations/annotation_flyout/index.tsx index 2196f3d6cc6d2..84abe3ed8a821 100644 --- a/x-pack/plugins/ml/public/application/components/annotations/annotation_flyout/index.tsx +++ b/x-pack/plugins/ml/public/application/components/annotations/annotation_flyout/index.tsx @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { Component, Fragment, FC, ReactNode } from 'react'; +import React, { Component, FC, ReactNode, useCallback } from 'react'; import useObservable from 'react-use/lib/useObservable'; import * as Rx from 'rxjs'; import { cloneDeep } from 'lodash'; @@ -28,6 +28,7 @@ import { import { CommonProps } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; +import { distinctUntilChanged } from 'rxjs/operators'; import { ANNOTATION_MAX_LENGTH_CHARS, ANNOTATION_EVENT_USER, @@ -60,7 +61,6 @@ interface Entity { } interface Props { - annotation: AnnotationState; chartDetails: { entityData: { entities: Entity[] }; functionLabel: string; @@ -70,25 +70,39 @@ interface Props { } interface State { + annotationState: AnnotationState | null; isDeleteModalVisible: boolean; applyAnnotationToSeries: boolean; } -class AnnotationFlyoutUI extends Component { +export class AnnotationFlyoutUI extends Component { public state: State = { isDeleteModalVisible: false, applyAnnotationToSeries: true, + annotationState: null, }; public annotationSub: Rx.Subscription | null = null; + componentDidMount() { + this.annotationSub = annotation$.subscribe((v) => { + this.setState({ + annotationState: v, + }); + }); + } + + componentWillUnmount() { + this.annotationSub!.unsubscribe(); + } + public annotationTextChangeHandler = (e: React.ChangeEvent) => { - if (this.props.annotation === null) { + if (this.state.annotationState === null) { return; } annotation$.next({ - ...this.props.annotation, + ...this.state.annotationState, annotation: e.target.value, }); }; @@ -102,21 +116,21 @@ class AnnotationFlyoutUI extends Component { }; public deleteHandler = async () => { - const { annotation } = this.props; + const { annotationState } = this.state; const toastNotifications = getToastNotifications(); - if (annotation === null || annotation._id === undefined) { + if (annotationState === null || annotationState._id === undefined) { return; } try { - await ml.annotations.deleteAnnotation(annotation._id); + await ml.annotations.deleteAnnotation(annotationState._id); toastNotifications.addSuccess( i18n.translate( 'xpack.ml.timeSeriesExplorer.timeSeriesChart.deletedAnnotationNotificationMessage', { defaultMessage: 'Deleted annotation for job with ID {jobId}.', - values: { jobId: annotation.job_id }, + values: { jobId: annotationState.job_id }, } ) ); @@ -127,7 +141,7 @@ class AnnotationFlyoutUI extends Component { { defaultMessage: 'An error occurred deleting the annotation for job with ID {jobId}: {error}', - values: { jobId: annotation.job_id, error: JSON.stringify(err) }, + values: { jobId: annotationState.job_id, error: JSON.stringify(err) }, } ) ); @@ -145,13 +159,13 @@ class AnnotationFlyoutUI extends Component { public validateAnnotationText = () => { // Validates the entered text, returning an array of error messages // for display in the form. An empty array is returned if the text is valid. - const { annotation } = this.props; + const { annotationState } = this.state; const errors: string[] = []; - if (annotation === null) { + if (annotationState === null) { return errors; } - if (annotation.annotation.trim().length === 0) { + if (annotationState.annotation.trim().length === 0) { errors.push( i18n.translate('xpack.ml.timeSeriesExplorer.annotationFlyout.noAnnotationTextError', { defaultMessage: 'Enter annotation text', @@ -159,7 +173,7 @@ class AnnotationFlyoutUI extends Component { ); } - const textLength = annotation.annotation.length; + const textLength = annotationState.annotation.length; if (textLength > ANNOTATION_MAX_LENGTH_CHARS) { const charsOver = textLength - ANNOTATION_MAX_LENGTH_CHARS; errors.push( @@ -178,7 +192,8 @@ class AnnotationFlyoutUI extends Component { }; public saveOrUpdateAnnotation = () => { - const { annotation: originalAnnotation, chartDetails, detectorIndex } = this.props; + const { annotationState: originalAnnotation } = this.state; + const { chartDetails, detectorIndex } = this.props; if (originalAnnotation === null) { return; } @@ -262,14 +277,12 @@ class AnnotationFlyoutUI extends Component { }; public render(): ReactNode { - const { annotation, detectors, detectorIndex } = this.props; - const { isDeleteModalVisible } = this.state; + const { detectors, detectorIndex } = this.props; + const { annotationState, isDeleteModalVisible } = this.state; - if (annotation === null) { - return null; - } + if (!annotationState) return null; - const isExistingAnnotation = typeof annotation._id !== 'undefined'; + const isExistingAnnotation = typeof annotationState._id !== 'undefined'; // Check the length of the text is within the max length limit, // and warn if the length is approaching the limit. @@ -279,14 +292,16 @@ class AnnotationFlyoutUI extends Component { let helpText = null; if ( isInvalid === false && - annotation.annotation.length > ANNOTATION_MAX_LENGTH_CHARS * lengthRatioToShowWarning + annotationState.annotation.length > ANNOTATION_MAX_LENGTH_CHARS * lengthRatioToShowWarning ) { helpText = i18n.translate( 'xpack.ml.timeSeriesExplorer.annotationFlyout.approachingMaxLengthWarning', { defaultMessage: '{charsRemaining, number} {charsRemaining, plural, one {character} other {characters}} remaining', - values: { charsRemaining: ANNOTATION_MAX_LENGTH_CHARS - annotation.annotation.length }, + values: { + charsRemaining: ANNOTATION_MAX_LENGTH_CHARS - annotationState.annotation.length, + }, } ); } @@ -295,127 +310,138 @@ class AnnotationFlyoutUI extends Component { detector && 'detector_description' in detector ? detector.detector_description : ''; return ( - - - - -

- {isExistingAnnotation ? ( - - ) : ( - - )} -

-
-
- - + + + + + } + fullWidth + helpText={helpText} + isInvalid={isInvalid} + error={validationErrors} + > + - - + + } - fullWidth - helpText={helpText} - isInvalid={isInvalid} - error={validationErrors} - > - - - - + this.setState({ + applyAnnotationToSeries: !this.state.applyAnnotationToSeries, + }) + } + /> + + + + + + + + + + + {isExistingAnnotation && ( + - } - checked={this.state.applyAnnotationToSeries} - onChange={() => - this.setState({ - applyAnnotationToSeries: !this.state.applyAnnotationToSeries, - }) - } - /> - - - - - - + + )} + + + + {isExistingAnnotation ? ( + ) : ( + - - - - {isExistingAnnotation && ( - - - )} - - - - {isExistingAnnotation ? ( - - ) : ( - - )} - - - - -
+ + + + -
+ ); } } export const AnnotationFlyout: FC = (props) => { - const annotationProp = useObservable(annotation$); + const annotationProp = useObservable( + annotation$.pipe( + distinctUntilChanged((prev, curr) => { + // prevent re-rendering + return prev !== null && curr !== null; + }) + ) + ); - if (annotationProp === undefined) { + const cancelEditingHandler = useCallback(() => { + annotation$.next(null); + }, []); + + if (annotationProp === undefined || annotationProp === null) { return null; } - return ; + const isExistingAnnotation = typeof annotationProp._id !== 'undefined'; + + return ( + + + +

+ {isExistingAnnotation ? ( + + ) : ( + + )} +

+
+
+ +
+ ); }; From 9504c9453b83e85ccc2d0e5d8cd8009faee57463 Mon Sep 17 00:00:00 2001 From: James Gowdy Date: Mon, 20 Jul 2020 13:47:18 +0100 Subject: [PATCH 56/59] [ML] Adding missing index pattern name to new job wizards (#72400) --- .../public/application/jobs/new_job/pages/new_job/page.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/new_job/page.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/new_job/page.tsx index 48b044e5371de..8e223b69b00e8 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/new_job/page.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/new_job/page.tsx @@ -210,6 +210,12 @@ export const Page: FC = ({ existingJobsAndGroups, jobType }) => { : {jobCreatorTitle} + + From bf89b3cdd21cff32675b35db945a89f8a4d7247d Mon Sep 17 00:00:00 2001 From: Nicolas Chaulet Date: Mon, 20 Jul 2020 08:53:09 -0400 Subject: [PATCH 57/59] [Ingest Manager] Do not bumb config revision during config creation (#72270) --- .../server/routes/agent_config/handlers.ts | 1 + .../ingest_manager/server/services/agent_config.ts | 10 ++++++---- .../ingest_manager/server/services/package_config.ts | 6 ++++-- x-pack/plugins/ingest_manager/server/services/setup.ts | 4 +++- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/x-pack/plugins/ingest_manager/server/routes/agent_config/handlers.ts b/x-pack/plugins/ingest_manager/server/routes/agent_config/handlers.ts index 718aca89ea4fd..4e4653ec023ce 100644 --- a/x-pack/plugins/ingest_manager/server/routes/agent_config/handlers.ts +++ b/x-pack/plugins/ingest_manager/server/routes/agent_config/handlers.ts @@ -135,6 +135,7 @@ export const createAgentConfigHandler: RequestHandler< newSysPackageConfig.namespace = agentConfig.namespace; await packageConfigService.create(soClient, callCluster, newSysPackageConfig, { user, + bumpConfigRevision: false, }); } diff --git a/x-pack/plugins/ingest_manager/server/services/agent_config.ts b/x-pack/plugins/ingest_manager/server/services/agent_config.ts index c068b594318c1..0a9adc1f1c593 100644 --- a/x-pack/plugins/ingest_manager/server/services/agent_config.ts +++ b/x-pack/plugins/ingest_manager/server/services/agent_config.ts @@ -41,7 +41,8 @@ class AgentConfigService { soClient: SavedObjectsClientContract, id: string, agentConfig: Partial, - user?: AuthenticatedUser + user?: AuthenticatedUser, + options: { bumpRevision: boolean } = { bumpRevision: true } ): Promise { const oldAgentConfig = await this.get(soClient, id, false); @@ -60,7 +61,7 @@ class AgentConfigService { await soClient.update(SAVED_OBJECT_TYPE, id, { ...agentConfig, - revision: oldAgentConfig.revision + 1, + ...(options.bumpRevision ? { revision: oldAgentConfig.revision + 1 } : {}), updated_at: new Date().toISOString(), updated_by: user ? user.username : 'system', }); @@ -265,7 +266,7 @@ class AgentConfigService { soClient: SavedObjectsClientContract, id: string, packageConfigIds: string[], - options?: { user?: AuthenticatedUser } + options: { user?: AuthenticatedUser; bumpRevision: boolean } = { bumpRevision: true } ): Promise { const oldAgentConfig = await this.get(soClient, id, false); @@ -281,7 +282,8 @@ class AgentConfigService { [...((oldAgentConfig.package_configs || []) as string[])].concat(packageConfigIds) ), }, - options?.user + options?.user, + { bumpRevision: options.bumpRevision } ); } diff --git a/x-pack/plugins/ingest_manager/server/services/package_config.ts b/x-pack/plugins/ingest_manager/server/services/package_config.ts index e8ca09a83c2b6..c2d465cf7c73f 100644 --- a/x-pack/plugins/ingest_manager/server/services/package_config.ts +++ b/x-pack/plugins/ingest_manager/server/services/package_config.ts @@ -42,7 +42,7 @@ class PackageConfigService { soClient: SavedObjectsClientContract, callCluster: CallESAsCurrentUser, packageConfig: NewPackageConfig, - options?: { id?: string; user?: AuthenticatedUser } + options?: { id?: string; user?: AuthenticatedUser; bumpConfigRevision?: boolean } ): Promise { // Check that its agent config does not have a package config with the same name const parentAgentConfig = await agentConfigService.get(soClient, packageConfig.config_id); @@ -104,6 +104,7 @@ class PackageConfigService { // Assign it to the given agent config await agentConfigService.assignPackageConfigs(soClient, packageConfig.config_id, [newSo.id], { user: options?.user, + bumpRevision: options?.bumpConfigRevision ?? true, }); return { @@ -117,7 +118,7 @@ class PackageConfigService { soClient: SavedObjectsClientContract, packageConfigs: NewPackageConfig[], configId: string, - options?: { user?: AuthenticatedUser } + options?: { user?: AuthenticatedUser; bumpConfigRevision?: boolean } ): Promise { const isoDate = new Date().toISOString(); const { saved_objects: newSos } = await soClient.bulkCreate( @@ -142,6 +143,7 @@ class PackageConfigService { newSos.map((newSo) => newSo.id), { user: options?.user, + bumpRevision: options?.bumpConfigRevision ?? true, } ); diff --git a/x-pack/plugins/ingest_manager/server/services/setup.ts b/x-pack/plugins/ingest_manager/server/services/setup.ts index 627abc158143d..c91cae98e17d2 100644 --- a/x-pack/plugins/ingest_manager/server/services/setup.ts +++ b/x-pack/plugins/ingest_manager/server/services/setup.ts @@ -218,5 +218,7 @@ async function addPackageToConfig( config.namespace ); - await packageConfigService.create(soClient, callCluster, newPackageConfig); + await packageConfigService.create(soClient, callCluster, newPackageConfig, { + bumpConfigRevision: false, + }); } From f331cc8b641dc6bc4ce2ae82e404f88f0451d768 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Fern=C3=A1ndez=20Haro?= Date: Mon, 20 Jul 2020 13:54:36 +0100 Subject: [PATCH 58/59] [Ingest Manager] Set `_meta` in the index.mappings (#72026) Co-authored-by: Elastic Machine --- .../__snapshots__/template.test.ts.snap | 21 +++++++++++++++++++ .../epm/elasticsearch/template/template.ts | 18 +++++++++------- 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/x-pack/plugins/ingest_manager/server/services/epm/elasticsearch/template/__snapshots__/template.test.ts.snap b/x-pack/plugins/ingest_manager/server/services/epm/elasticsearch/template/__snapshots__/template.test.ts.snap index 219c2de675359..0333fb024a717 100644 --- a/x-pack/plugins/ingest_manager/server/services/epm/elasticsearch/template/__snapshots__/template.test.ts.snap +++ b/x-pack/plugins/ingest_manager/server/services/epm/elasticsearch/template/__snapshots__/template.test.ts.snap @@ -87,6 +87,13 @@ exports[`tests loading base.yml: base.yml 1`] = ` "validarray": { "type": "integer" } + }, + "_meta": { + "package": { + "name": "nginx" + }, + "managed_by": "ingest-manager", + "managed": true } }, "aliases": {} @@ -190,6 +197,13 @@ exports[`tests loading coredns.logs.yml: coredns.logs.yml 1`] = ` } } } + }, + "_meta": { + "package": { + "name": "coredns" + }, + "managed_by": "ingest-manager", + "managed": true } }, "aliases": {} @@ -1677,6 +1691,13 @@ exports[`tests loading system.yml: system.yml 1`] = ` } } } + }, + "_meta": { + "package": { + "name": "system" + }, + "managed_by": "ingest-manager", + "managed": true } }, "aliases": {} diff --git a/x-pack/plugins/ingest_manager/server/services/epm/elasticsearch/template/template.ts b/x-pack/plugins/ingest_manager/server/services/epm/elasticsearch/template/template.ts index 876573f2270ea..a739806d5868b 100644 --- a/x-pack/plugins/ingest_manager/server/services/epm/elasticsearch/template/template.ts +++ b/x-pack/plugins/ingest_manager/server/services/epm/elasticsearch/template/template.ts @@ -249,6 +249,15 @@ function getBaseTemplate( packageName: string, composedOfTemplates: string[] ): IndexTemplate { + // Meta information to identify Ingest Manager's managed templates and indices + const _meta = { + package: { + name: packageName, + }, + managed_by: 'ingest-manager', + managed: true, + }; + return { // This takes precedence over all index templates installed by ES by default (logs-*-* and metrics-*-*) // if this number is lower than the ES value (which is 100) this template will never be applied when a data stream @@ -304,19 +313,14 @@ function getBaseTemplate( date_detection: false, // All the properties we know from the fields.yml file properties: mappings.properties, + _meta, }, // To be filled with the aliases that we need aliases: {}, }, data_stream: {}, composed_of: composedOfTemplates, - _meta: { - package: { - name: packageName, - }, - managed_by: 'ingest-manager', - managed: true, - }, + _meta, }; } From 6cf796a4fb2a00165b8bf1a33047dd3688fc3e43 Mon Sep 17 00:00:00 2001 From: Robert Austin Date: Mon, 20 Jul 2020 09:38:30 -0400 Subject: [PATCH 59/59] [Resolver] Selector performance (#72380) * Memoize various selectors * Improve performance of the selectors that calculate the `aria-flowto` attribute. * more tests. --- .../common/endpoint/types.ts | 1 - .../models/indexed_process_tree/index.ts | 53 ++--- .../isometric_taxi_layout.ts | 11 +- .../public/resolver/store/camera/selectors.ts | 65 +++--- .../resolver/store/data/selectors.test.ts | 90 ++++++++ .../public/resolver/store/data/selectors.ts | 208 +++++++++++------- .../resolver/store/mocks/endpoint_event.ts | 37 ++++ .../resolver/store/mocks/resolver_tree.ts | 87 ++++++++ .../public/resolver/store/selectors.test.ts | 117 +--------- .../public/resolver/store/selectors.ts | 35 +-- .../panels/panel_content_related_detail.tsx | 3 +- 11 files changed, 427 insertions(+), 280 deletions(-) create mode 100644 x-pack/plugins/security_solution/public/resolver/store/mocks/endpoint_event.ts create mode 100644 x-pack/plugins/security_solution/public/resolver/store/mocks/resolver_tree.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/types.ts b/x-pack/plugins/security_solution/common/endpoint/types.ts index b477207b1c5a3..5e7e4d22f8c3c 100644 --- a/x-pack/plugins/security_solution/common/endpoint/types.ts +++ b/x-pack/plugins/security_solution/common/endpoint/types.ts @@ -482,7 +482,6 @@ export interface LegacyEndpointEvent { type: string; version: string; }; - process?: object; rule?: object; user?: object; event?: { diff --git a/x-pack/plugins/security_solution/public/resolver/models/indexed_process_tree/index.ts b/x-pack/plugins/security_solution/public/resolver/models/indexed_process_tree/index.ts index 35a32d91d8a02..628d0267754f2 100644 --- a/x-pack/plugins/security_solution/public/resolver/models/indexed_process_tree/index.ts +++ b/x-pack/plugins/security_solution/public/resolver/models/indexed_process_tree/index.ts @@ -4,6 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ +/* eslint-disable no-shadow */ + import { uniquePidForProcess, uniqueParentPidForProcess, orderByTime } from '../process_event'; import { IndexedProcessTree } from '../../types'; import { ResolverEvent } from '../../../../common/endpoint/types'; @@ -24,16 +26,15 @@ export function factory( const uniqueProcessPid = uniquePidForProcess(process); idToValue.set(uniqueProcessPid, process); - const uniqueParentPid = uniqueParentPidForProcess(process); - // if its defined and not '' - if (uniqueParentPid) { - let siblings = idToChildren.get(uniqueParentPid); - if (!siblings) { - siblings = []; - idToChildren.set(uniqueParentPid, siblings); - } - siblings.push(process); + // NB: If the value was null or undefined, use `undefined` + const uniqueParentPid: string | undefined = uniqueParentPidForProcess(process) ?? undefined; + + let childrenWithTheSameParent = idToChildren.get(uniqueParentPid); + if (!childrenWithTheSameParent) { + childrenWithTheSameParent = []; + idToChildren.set(uniqueParentPid, childrenWithTheSameParent); } + childrenWithTheSameParent.push(process); } // sort the children of each node @@ -50,9 +51,8 @@ export function factory( /** * Returns an array with any children `ProcessEvent`s of the passed in `process` */ -export function children(tree: IndexedProcessTree, process: ResolverEvent): ResolverEvent[] { - const id = uniquePidForProcess(process); - const currentProcessSiblings = tree.idToChildren.get(id); +export function children(tree: IndexedProcessTree, parentID: string | undefined): ResolverEvent[] { + const currentProcessSiblings = tree.idToChildren.get(parentID); return currentProcessSiblings === undefined ? [] : currentProcessSiblings; } @@ -78,31 +78,6 @@ export function parent( } } -/** - * Returns the following sibling - */ -export function nextSibling( - tree: IndexedProcessTree, - sibling: ResolverEvent -): ResolverEvent | undefined { - const parentNode = parent(tree, sibling); - if (parentNode) { - // The siblings of `sibling` are the children of its parent. - const siblings = children(tree, parentNode); - - // Find the sibling - const index = siblings.indexOf(sibling); - - // if the sibling wasn't found, or if it was the last element in the array, return undefined - if (index === -1 || index === siblings.length - 1) { - return undefined; - } - - // return the next sibling - return siblings[index + 1]; - } -} - /** * Number of processes in the tree */ @@ -133,6 +108,8 @@ export function root(tree: IndexedProcessTree) { export function* levelOrder(tree: IndexedProcessTree) { const rootNode = root(tree); if (rootNode !== null) { - yield* baseLevelOrder(rootNode, children.bind(null, tree)); + yield* baseLevelOrder(rootNode, (parentNode: ResolverEvent): ResolverEvent[] => + children(tree, uniquePidForProcess(parentNode)) + ); } } diff --git a/x-pack/plugins/security_solution/public/resolver/models/indexed_process_tree/isometric_taxi_layout.ts b/x-pack/plugins/security_solution/public/resolver/models/indexed_process_tree/isometric_taxi_layout.ts index 6058a40037ad2..11c888d1462f8 100644 --- a/x-pack/plugins/security_solution/public/resolver/models/indexed_process_tree/isometric_taxi_layout.ts +++ b/x-pack/plugins/security_solution/public/resolver/models/indexed_process_tree/isometric_taxi_layout.ts @@ -19,6 +19,7 @@ import * as event from '../../../../common/endpoint/models/event'; import { ResolverEvent } from '../../../../common/endpoint/types'; import * as model from './index'; import { getFriendlyElapsedTime as elapsedTime } from '../../lib/date'; +import { uniquePidForProcess } from '../process_event'; /** * Graph the process tree @@ -146,10 +147,12 @@ function widthsOfProcessSubtrees(indexedProcessTree: IndexedProcessTree): Proces return widths; } - const processesInReverseLevelOrder = [...model.levelOrder(indexedProcessTree)].reverse(); + const processesInReverseLevelOrder: ResolverEvent[] = [ + ...model.levelOrder(indexedProcessTree), + ].reverse(); for (const process of processesInReverseLevelOrder) { - const children = model.children(indexedProcessTree, process); + const children = model.children(indexedProcessTree, uniquePidForProcess(process)); const sumOfWidthOfChildren = function sumOfWidthOfChildren() { return children.reduce(function sum(currentValue, child) { @@ -226,7 +229,7 @@ function processEdgeLineSegments( metadata: edgeLineMetadata, }; - const siblings = model.children(indexedProcessTree, parent); + const siblings = model.children(indexedProcessTree, uniquePidForProcess(parent)); const isFirstChild = process === siblings[0]; if (metadata.isOnlyChild) { @@ -420,7 +423,7 @@ function* levelOrderWithWidths( parentWidth, }; - const siblings = model.children(tree, parent); + const siblings = model.children(tree, uniquePidForProcess(parent)); if (siblings.length === 1) { metadata.isOnlyChild = true; metadata.lastChildWidth = width; diff --git a/x-pack/plugins/security_solution/public/resolver/store/camera/selectors.ts b/x-pack/plugins/security_solution/public/resolver/store/camera/selectors.ts index 86d934bd95663..baa049ba42f92 100644 --- a/x-pack/plugins/security_solution/public/resolver/store/camera/selectors.ts +++ b/x-pack/plugins/security_solution/public/resolver/store/camera/selectors.ts @@ -164,7 +164,8 @@ export const scale: (state: CameraState) => (time: number) => Vector2 = createSe scalingConstants.maximum ); - return (time) => { + // memoizing this so the vector returned will be the same object reference if called with the same `time`. + return defaultMemoize((time) => { /** * If the animation has completed, return the `scaleNotCountingAnimation`, as * the animation always completes with the scale set back at starting value. @@ -247,12 +248,13 @@ export const scale: (state: CameraState) => (time: number) => Vector2 = createSe */ return [lerpedScale, lerpedScale]; } - }; + }); } else { /** * The scale should be the same in both axes. + * Memoizing this so the vector returned will be the same object reference every time. */ - return () => [scaleNotCountingAnimation, scaleNotCountingAnimation]; + return defaultMemoize(() => [scaleNotCountingAnimation, scaleNotCountingAnimation]); } /** @@ -277,22 +279,26 @@ export const clippingPlanes: ( ) => (time: number) => ClippingPlanes = createSelector( (state) => state.rasterSize, scale, - (rasterSize, scaleAtTime) => (time: number) => { - const [scaleX, scaleY] = scaleAtTime(time); - const renderWidth = rasterSize[0]; - const renderHeight = rasterSize[1]; - const clippingPlaneRight = renderWidth / 2 / scaleX; - const clippingPlaneTop = renderHeight / 2 / scaleY; - - return { - renderWidth, - renderHeight, - clippingPlaneRight, - clippingPlaneTop, - clippingPlaneLeft: -clippingPlaneRight, - clippingPlaneBottom: -clippingPlaneTop, - }; - } + (rasterSize, scaleAtTime) => + /** + * memoizing this for object reference equality. + */ + defaultMemoize((time: number) => { + const [scaleX, scaleY] = scaleAtTime(time); + const renderWidth = rasterSize[0]; + const renderHeight = rasterSize[1]; + const clippingPlaneRight = renderWidth / 2 / scaleX; + const clippingPlaneTop = renderHeight / 2 / scaleY; + + return { + renderWidth, + renderHeight, + clippingPlaneRight, + clippingPlaneTop, + clippingPlaneLeft: -clippingPlaneRight, + clippingPlaneBottom: -clippingPlaneTop, + }; + }) ); /** @@ -323,7 +329,10 @@ export const translation: (state: CameraState) => (time: number) => Vector2 = cr scale, (state) => state.animation, (panning, translationNotCountingCurrentPanning, scaleAtTime, animation) => { - return (time: number) => { + /** + * Memoizing this for object reference equality. + */ + return defaultMemoize((time: number) => { const [scaleX, scaleY] = scaleAtTime(time); if (animation !== undefined && animationIsActive(animation, time)) { return vector2.lerp( @@ -343,7 +352,7 @@ export const translation: (state: CameraState) => (time: number) => Vector2 = cr } else { return translationNotCountingCurrentPanning; } - }; + }); } ); @@ -357,7 +366,10 @@ export const inverseProjectionMatrix: ( clippingPlanes, translation, (clippingPlanesAtTime, translationAtTime) => { - return (time: number) => { + /** + * Memoizing this for object reference equality (and reduced memory churn.) + */ + return defaultMemoize((time: number) => { const { renderWidth, renderHeight, @@ -404,7 +416,7 @@ export const inverseProjectionMatrix: ( translateForCamera, multiply(scaleToClippingPlaneDimensions, multiply(invertY, screenToNDC)) ); - }; + }); } ); @@ -415,7 +427,8 @@ export const viewableBoundingBox: (state: CameraState) => (time: number) => AABB clippingPlanes, inverseProjectionMatrix, (clippingPlanesAtTime, matrixAtTime) => { - return (time: number) => { + // memoizing this so the AABB returned will be the same object reference if called with the same `time`. + return defaultMemoize((time: number) => { const { renderWidth, renderHeight } = clippingPlanesAtTime(time); const matrix = matrixAtTime(time); const bottomLeftCorner: Vector2 = [0, renderHeight]; @@ -424,7 +437,7 @@ export const viewableBoundingBox: (state: CameraState) => (time: number) => AABB minimum: vector2.applyMatrix3(bottomLeftCorner, matrix), maximum: vector2.applyMatrix3(topRightCorner, matrix), }; - }; + }); } ); @@ -436,6 +449,8 @@ export const projectionMatrix: (state: CameraState) => (time: number) => Matrix3 clippingPlanes, translation, (clippingPlanesAtTime, translationAtTime) => { + // memoizing this so the matrix returned will be the same object reference if called with the same `time`. + // this should also save on some memory allocation return defaultMemoize((time: number) => { const { renderWidth, diff --git a/x-pack/plugins/security_solution/public/resolver/store/data/selectors.test.ts b/x-pack/plugins/security_solution/public/resolver/store/data/selectors.test.ts index cf23596db6134..683f8f1a5f84a 100644 --- a/x-pack/plugins/security_solution/public/resolver/store/data/selectors.test.ts +++ b/x-pack/plugins/security_solution/public/resolver/store/data/selectors.test.ts @@ -9,6 +9,13 @@ import { DataState } from '../../types'; import { dataReducer } from './reducer'; import { DataAction } from './action'; import { createStore } from 'redux'; +import { + mockTreeWithNoAncestorsAnd2Children, + mockTreeWith2AncestorsAndNoChildren, +} from '../mocks/resolver_tree'; +import { uniquePidForProcess } from '../../models/process_event'; +import { EndpointEvent } from '../../../../common/endpoint/types'; + describe('data state', () => { let actions: DataAction[] = []; @@ -263,4 +270,87 @@ describe('data state', () => { }); }); }); + describe('with a tree with no descendants and 2 ancestors', () => { + const originID = 'c'; + const firstAncestorID = 'b'; + const secondAncestorID = 'a'; + beforeEach(() => { + actions.push({ + type: 'serverReturnedResolverData', + payload: { + result: mockTreeWith2AncestorsAndNoChildren({ + originID, + firstAncestorID, + secondAncestorID, + }), + // this value doesn't matter + databaseDocumentID: '', + }, + }); + }); + it('should have no flowto candidate for the origin', () => { + expect(selectors.ariaFlowtoCandidate(state())(originID)).toBe(null); + }); + it('should have no flowto candidate for the first ancestor', () => { + expect(selectors.ariaFlowtoCandidate(state())(firstAncestorID)).toBe(null); + }); + it('should have no flowto candidate for the second ancestor ancestor', () => { + expect(selectors.ariaFlowtoCandidate(state())(secondAncestorID)).toBe(null); + }); + }); + describe('with a tree with 2 children and no ancestors', () => { + const originID = 'c'; + const firstChildID = 'd'; + const secondChildID = 'e'; + beforeEach(() => { + actions.push({ + type: 'serverReturnedResolverData', + payload: { + result: mockTreeWithNoAncestorsAnd2Children({ originID, firstChildID, secondChildID }), + // this value doesn't matter + databaseDocumentID: '', + }, + }); + }); + it('should have no flowto candidate for the origin', () => { + expect(selectors.ariaFlowtoCandidate(state())(originID)).toBe(null); + }); + it('should use the second child as the flowto candidate for the first child', () => { + expect(selectors.ariaFlowtoCandidate(state())(firstChildID)).toBe(secondChildID); + }); + it('should have no flowto candidate for the second child', () => { + expect(selectors.ariaFlowtoCandidate(state())(secondChildID)).toBe(null); + }); + }); + describe('with a tree where the root process has no parent info at all', () => { + const originID = 'c'; + const firstChildID = 'd'; + const secondChildID = 'e'; + beforeEach(() => { + const tree = mockTreeWithNoAncestorsAnd2Children({ originID, firstChildID, secondChildID }); + for (const event of tree.lifecycle) { + // delete the process.parent key, if present + // cast as `EndpointEvent` because `ResolverEvent` can also be `LegacyEndpointEvent` which has no `process` field + delete (event as EndpointEvent).process?.parent; + } + + actions.push({ + type: 'serverReturnedResolverData', + payload: { + result: tree, + // this value doesn't matter + databaseDocumentID: '', + }, + }); + }); + it('should be able to calculate the aria flowto candidates for all processes nodes', () => { + const graphables = selectors.graphableProcesses(state()); + expect(graphables.length).toBe(3); + for (const event of graphables) { + expect(() => { + selectors.ariaFlowtoCandidate(state())(uniquePidForProcess(event)); + }).not.toThrow(); + } + }); + }); }); diff --git a/x-pack/plugins/security_solution/public/resolver/store/data/selectors.ts b/x-pack/plugins/security_solution/public/resolver/store/data/selectors.ts index dc17fc70ef8af..109b3abddcc77 100644 --- a/x-pack/plugins/security_solution/public/resolver/store/data/selectors.ts +++ b/x-pack/plugins/security_solution/public/resolver/store/data/selectors.ts @@ -19,9 +19,9 @@ import { isGraphableProcess, isTerminatedProcess, uniquePidForProcess, + uniqueParentPidForProcess, } from '../../models/process_event'; import * as indexedProcessTreeModel from '../../models/indexed_process_tree'; -import { isEqual } from '../../models/aabb'; import { ResolverEvent, @@ -62,7 +62,7 @@ export function hasError(state: DataState): boolean { * The last ResolverTree we received, if any. It may be stale (it might not be for the same databaseDocumentID that * we're currently interested in. */ -const resolverTree = (state: DataState): ResolverTree | undefined => { +const resolverTreeResponse = (state: DataState): ResolverTree | undefined => { if (state.lastResponse && state.lastResponse.successful) { return state.lastResponse.result; } else { @@ -73,7 +73,9 @@ const resolverTree = (state: DataState): ResolverTree | undefined => { /** * Process events that will be displayed as terminated. */ -export const terminatedProcesses = createSelector(resolverTree, function (tree?: ResolverTree) { +export const terminatedProcesses = createSelector(resolverTreeResponse, function ( + tree?: ResolverTree +) { if (!tree) { return new Set(); } @@ -90,7 +92,7 @@ export const terminatedProcesses = createSelector(resolverTree, function (tree?: /** * Process events that will be graphed. */ -export const graphableProcesses = createSelector(resolverTree, function (tree?) { +export const graphableProcesses = createSelector(resolverTreeResponse, function (tree?) { if (tree) { return resolverTreeModel.lifecycleEvents(tree).filter(isGraphableProcess); } else { @@ -101,7 +103,7 @@ export const graphableProcesses = createSelector(resolverTree, function (tree?) /** * The 'indexed process tree' contains the tree data, indexed in helpful ways. Used for O(1) access to stuff during graph layout. */ -export const indexedProcessTree = createSelector(graphableProcesses, function indexedTree( +export const tree = createSelector(graphableProcesses, function indexedTree( /* eslint-disable no-shadow */ graphableProcesses /* eslint-enable no-shadow */ @@ -114,13 +116,16 @@ export const indexedProcessTree = createSelector(graphableProcesses, function in */ export const relatedEventsStats: ( state: DataState -) => Map | null = createSelector(resolverTree, (tree?: ResolverTree) => { - if (tree) { - return resolverTreeModel.relatedEventsStats(tree); - } else { - return null; +) => Map | null = createSelector( + resolverTreeResponse, + (resolverTree?: ResolverTree) => { + if (resolverTree) { + return resolverTreeModel.relatedEventsStats(resolverTree); + } else { + return null; + } } -}); +); /** * returns a map of entity_ids to related event data. @@ -133,7 +138,9 @@ export function relatedEventsByEntityId(data: DataState): Map (entityID: string) => (ecsCategory: string) => ResolverEvent[] = createSelector( relatedEventsByEntityId, function provideGettersByCategory( /* eslint-disable no-shadow */ @@ -173,16 +180,16 @@ export function relatedEventsReady(data: DataState): Map { * `true` if there were more children than we got in the last request. */ export function hasMoreChildren(state: DataState): boolean { - const tree = resolverTree(state); - return tree ? resolverTreeModel.hasMoreChildren(tree) : false; + const resolverTree = resolverTreeResponse(state); + return resolverTree ? resolverTreeModel.hasMoreChildren(resolverTree) : false; } /** * `true` if there were more ancestors than we got in the last request. */ export function hasMoreAncestors(state: DataState): boolean { - const tree = resolverTree(state); - return tree ? resolverTreeModel.hasMoreAncestors(tree) : false; + const resolverTree = resolverTreeResponse(state); + return resolverTree ? resolverTreeModel.hasMoreAncestors(resolverTree) : false; } interface RelatedInfoFunctions { @@ -248,7 +255,7 @@ export const relatedEventInfoByEntityId: ( }); }; - const matchingEventsForCategory = defaultMemoize(unmemoizedMatchingEventsForCategory); + const matchingEventsForCategory = unmemoizedMatchingEventsForCategory; /** * The number of events that occurred before the API limit was reached. @@ -313,16 +320,13 @@ export function databaseDocumentIDToFetch(state: DataState): string | null { } } -export const layout = createSelector( - indexedProcessTree, - function processNodePositionsAndEdgeLineSegments( - /* eslint-disable no-shadow */ - indexedProcessTree - /* eslint-enable no-shadow */ - ) { - return isometricTaxiLayout(indexedProcessTree); - } -); +export const layout = createSelector(tree, function processNodePositionsAndEdgeLineSegments( + /* eslint-disable no-shadow */ + indexedProcessTree + /* eslint-enable no-shadow */ +) { + return isometricTaxiLayout(indexedProcessTree); +}); /** * Given a nodeID (aka entity_id) get the indexed process event. @@ -332,8 +336,9 @@ export const layout = createSelector( export const processEventForID: ( state: DataState ) => (nodeID: string) => ResolverEvent | null = createSelector( - indexedProcessTree, - (tree) => (nodeID: string) => indexedProcessTreeModel.processEvent(tree, nodeID) + tree, + (indexedProcessTree) => (nodeID: string) => + indexedProcessTreeModel.processEvent(indexedProcessTree, nodeID) ); /** @@ -349,30 +354,66 @@ export const ariaLevel: (state: DataState) => (nodeID: string) => number | null ); /** - * Returns the following sibling if there is one, or `null`. + * Returns the following sibling if there is one, or `null` if there isn't. + * For root nodes, other root nodes are treated as siblings. + * This is used to calculate the `aria-flowto` attribute. */ -export const followingSibling: ( +export const ariaFlowtoCandidate: ( state: DataState ) => (nodeID: string) => string | null = createSelector( - indexedProcessTree, + tree, processEventForID, - (tree, eventGetter) => { - return (nodeID: string) => { - const event = eventGetter(nodeID); + (indexedProcessTree, eventGetter) => { + // A map of preceding sibling IDs to following sibling IDs or `null`, if there is no following sibling + const memo: Map = new Map(); - // event not found - if (event === null) { - return null; + return function memoizedGetter(/** the unique ID of a node. **/ nodeID: string): string | null { + // Previous calculations are memoized. Check for a value in the memo. + const existingValue = memo.get(nodeID); + + /** + * `undefined` means the key wasn't in the map. + * Note: the value may be null, meaning that we checked and there is no following sibling. + * If there is a value in the map, return it. + */ + if (existingValue !== undefined) { + return existingValue; } - const nextSibling = indexedProcessTreeModel.nextSibling(tree, event); - // next sibling not found - if (nextSibling === undefined) { - return null; + /** + * Getting the following sibling of a node has an `O(n)` time complexity where `n` is the number of children the parent of the node has. + * For this reason, we calculate the following siblings of the node and all of its siblings at once and cache them. + */ + const nodeEvent: ResolverEvent | null = eventGetter(nodeID); + + if (!nodeEvent) { + // this should never happen. + throw new Error('could not find child event in process tree.'); + } + + // nodes with the same parent ID + const children = indexedProcessTreeModel.children( + indexedProcessTree, + uniqueParentPidForProcess(nodeEvent) + ); + + let previousChild: ResolverEvent | null = null; + // Loop over all nodes that have the same parent ID (even if the parent ID is undefined or points to a node that isn't in the tree.) + for (const child of children) { + if (previousChild !== null) { + // Set the `child` as the following sibling of `previousChild`. + memo.set(uniquePidForProcess(previousChild), uniquePidForProcess(child)); + } + // Set the child as the previous child. + previousChild = child; + } + + if (previousChild) { + // if there is a previous child, it has no following sibling. + memo.set(uniquePidForProcess(previousChild), null); } - // return the node ID - return uniquePidForProcess(nextSibling); + return memoizedGetter(nodeID); }; } ); @@ -385,7 +426,7 @@ const spatiallyIndexedLayout: (state: DataState) => rbush = creat edgeLineSegments, /* eslint-enable no-shadow */ }) { - const tree: rbush = new rbush(); + const spatialIndex: rbush = new rbush(); const processesToIndex: IndexedProcessNode[] = []; const edgeLineSegmentsToIndex: IndexedEdgeLineSegment[] = []; @@ -421,50 +462,49 @@ const spatiallyIndexedLayout: (state: DataState) => rbush = creat }; edgeLineSegmentsToIndex.push(indexedLineSegment); } - tree.load([...processesToIndex, ...edgeLineSegmentsToIndex]); - return tree; + spatialIndex.load([...processesToIndex, ...edgeLineSegmentsToIndex]); + return spatialIndex; } ); +/** + * Returns nodes and edge lines that could be visible in the `query`. + */ export const nodesAndEdgelines: ( state: DataState -) => (query: AABB) => VisibleEntites = createSelector(spatiallyIndexedLayout, function (tree) { - // memoize the results of this call to avoid unnecessarily rerunning - let lastBoundingBox: AABB | null = null; - let currentlyVisible: VisibleEntites = { - processNodePositions: new Map(), - connectingEdgeLineSegments: [], - }; - return (boundingBox: AABB) => { - if (lastBoundingBox !== null && isEqual(lastBoundingBox, boundingBox)) { - return currentlyVisible; - } else { - const { - minimum: [minX, minY], - maximum: [maxX, maxY], - } = boundingBox; - const entities = tree.search({ - minX, - minY, - maxX, - maxY, - }); - const visibleProcessNodePositions = new Map( - entities - .filter((entity): entity is IndexedProcessNode => entity.type === 'processNode') - .map((node) => [node.entity, node.position]) - ); - const connectingEdgeLineSegments = entities - .filter((entity): entity is IndexedEdgeLineSegment => entity.type === 'edgeLine') - .map((node) => node.entity); - currentlyVisible = { - processNodePositions: visibleProcessNodePositions, - connectingEdgeLineSegments, - }; - lastBoundingBox = boundingBox; - return currentlyVisible; - } - }; +) => ( + /** + * An axis aligned bounding box (in world corrdinates) to search in. Any entities that might collide with this box will be returned. + */ + query: AABB +) => VisibleEntites = createSelector(spatiallyIndexedLayout, function (spatialIndex) { + /** + * Memoized for performance and object reference equality. + */ + return defaultMemoize((boundingBox: AABB) => { + const { + minimum: [minX, minY], + maximum: [maxX, maxY], + } = boundingBox; + const entities = spatialIndex.search({ + minX, + minY, + maxX, + maxY, + }); + const visibleProcessNodePositions = new Map( + entities + .filter((entity): entity is IndexedProcessNode => entity.type === 'processNode') + .map((node) => [node.entity, node.position]) + ); + const connectingEdgeLineSegments = entities + .filter((entity): entity is IndexedEdgeLineSegment => entity.type === 'edgeLine') + .map((node) => node.entity); + return { + processNodePositions: visibleProcessNodePositions, + connectingEdgeLineSegments, + }; + }); }); /** diff --git a/x-pack/plugins/security_solution/public/resolver/store/mocks/endpoint_event.ts b/x-pack/plugins/security_solution/public/resolver/store/mocks/endpoint_event.ts new file mode 100644 index 0000000000000..b58ea73e1fdc7 --- /dev/null +++ b/x-pack/plugins/security_solution/public/resolver/store/mocks/endpoint_event.ts @@ -0,0 +1,37 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { EndpointEvent } from '../../../../common/endpoint/types'; + +/** + * Simple mock endpoint event that works for tree layouts. + */ +export function mockEndpointEvent({ + entityID, + name, + parentEntityId, + timestamp, +}: { + entityID: string; + name: string; + parentEntityId: string | undefined; + timestamp: number; +}): EndpointEvent { + return { + '@timestamp': timestamp, + event: { + type: 'start', + category: 'process', + }, + process: { + entity_id: entityID, + name, + parent: { + entity_id: parentEntityId, + }, + }, + } as EndpointEvent; +} diff --git a/x-pack/plugins/security_solution/public/resolver/store/mocks/resolver_tree.ts b/x-pack/plugins/security_solution/public/resolver/store/mocks/resolver_tree.ts new file mode 100644 index 0000000000000..862cf47f73947 --- /dev/null +++ b/x-pack/plugins/security_solution/public/resolver/store/mocks/resolver_tree.ts @@ -0,0 +1,87 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { mockEndpointEvent } from './endpoint_event'; +import { ResolverTree, ResolverEvent } from '../../../../common/endpoint/types'; + +export function mockTreeWith2AncestorsAndNoChildren({ + originID, + firstAncestorID, + secondAncestorID, +}: { + secondAncestorID: string; + firstAncestorID: string; + originID: string; +}): ResolverTree { + const secondAncestor: ResolverEvent = mockEndpointEvent({ + entityID: secondAncestorID, + name: 'a', + parentEntityId: 'none', + timestamp: 0, + }); + const firstAncestor: ResolverEvent = mockEndpointEvent({ + entityID: firstAncestorID, + name: 'b', + parentEntityId: secondAncestorID, + timestamp: 1, + }); + const originEvent: ResolverEvent = mockEndpointEvent({ + entityID: originID, + name: 'c', + parentEntityId: firstAncestorID, + timestamp: 2, + }); + return ({ + entityID: originID, + children: { + childNodes: [], + }, + ancestry: { + ancestors: [{ lifecycle: [secondAncestor] }, { lifecycle: [firstAncestor] }], + }, + lifecycle: [originEvent], + } as unknown) as ResolverTree; +} + +export function mockTreeWithNoAncestorsAnd2Children({ + originID, + firstChildID, + secondChildID, +}: { + originID: string; + firstChildID: string; + secondChildID: string; +}): ResolverTree { + const origin: ResolverEvent = mockEndpointEvent({ + entityID: originID, + name: 'c', + parentEntityId: 'none', + timestamp: 0, + }); + const firstChild: ResolverEvent = mockEndpointEvent({ + entityID: firstChildID, + name: 'd', + parentEntityId: originID, + timestamp: 1, + }); + const secondChild: ResolverEvent = mockEndpointEvent({ + entityID: secondChildID, + name: 'e', + parentEntityId: originID, + timestamp: 2, + }); + + return ({ + entityID: originID, + children: { + childNodes: [{ lifecycle: [firstChild] }, { lifecycle: [secondChild] }], + }, + ancestry: { + ancestors: [], + }, + lifecycle: [origin], + } as unknown) as ResolverTree; +} diff --git a/x-pack/plugins/security_solution/public/resolver/store/selectors.test.ts b/x-pack/plugins/security_solution/public/resolver/store/selectors.test.ts index ba4a5a169c549..df365a078b27f 100644 --- a/x-pack/plugins/security_solution/public/resolver/store/selectors.test.ts +++ b/x-pack/plugins/security_solution/public/resolver/store/selectors.test.ts @@ -9,7 +9,10 @@ import { createStore } from 'redux'; import { ResolverAction } from './actions'; import { resolverReducer } from './reducer'; import * as selectors from './selectors'; -import { EndpointEvent, ResolverEvent, ResolverTree } from '../../../common/endpoint/types'; +import { + mockTreeWith2AncestorsAndNoChildren, + mockTreeWithNoAncestorsAnd2Children, +} from './mocks/resolver_tree'; describe('resolver selectors', () => { const actions: ResolverAction[] = []; @@ -33,7 +36,7 @@ describe('resolver selectors', () => { actions.push({ type: 'serverReturnedResolverData', payload: { - result: treeWith2AncestorsAndNoChildren({ + result: mockTreeWith2AncestorsAndNoChildren({ originID, firstAncestorID, secondAncestorID, @@ -71,7 +74,7 @@ describe('resolver selectors', () => { actions.push({ type: 'serverReturnedResolverData', payload: { - result: treeWithNoAncestorsAnd2Children({ originID, firstChildID, secondChildID }), + result: mockTreeWithNoAncestorsAnd2Children({ originID, firstChildID, secondChildID }), // this value doesn't matter databaseDocumentID: '', }, @@ -149,111 +152,3 @@ describe('resolver selectors', () => { }); }); }); -/** - * Simple mock endpoint event that works for tree layouts. - */ -function mockEndpointEvent({ - entityID, - name, - parentEntityId, - timestamp, -}: { - entityID: string; - name: string; - parentEntityId: string; - timestamp: number; -}): EndpointEvent { - return { - '@timestamp': timestamp, - event: { - type: 'start', - category: 'process', - }, - process: { - entity_id: entityID, - name, - parent: { - entity_id: parentEntityId, - }, - }, - } as EndpointEvent; -} - -function treeWith2AncestorsAndNoChildren({ - originID, - firstAncestorID, - secondAncestorID, -}: { - secondAncestorID: string; - firstAncestorID: string; - originID: string; -}): ResolverTree { - const secondAncestor: ResolverEvent = mockEndpointEvent({ - entityID: secondAncestorID, - name: 'a', - parentEntityId: 'none', - timestamp: 0, - }); - const firstAncestor: ResolverEvent = mockEndpointEvent({ - entityID: firstAncestorID, - name: 'b', - parentEntityId: secondAncestorID, - timestamp: 1, - }); - const originEvent: ResolverEvent = mockEndpointEvent({ - entityID: originID, - name: 'c', - parentEntityId: firstAncestorID, - timestamp: 2, - }); - return ({ - entityID: originID, - children: { - childNodes: [], - }, - ancestry: { - ancestors: [{ lifecycle: [secondAncestor] }, { lifecycle: [firstAncestor] }], - }, - lifecycle: [originEvent], - } as unknown) as ResolverTree; -} - -function treeWithNoAncestorsAnd2Children({ - originID, - firstChildID, - secondChildID, -}: { - originID: string; - firstChildID: string; - secondChildID: string; -}): ResolverTree { - const origin: ResolverEvent = mockEndpointEvent({ - entityID: originID, - name: 'c', - parentEntityId: 'none', - timestamp: 0, - }); - const firstChild: ResolverEvent = mockEndpointEvent({ - entityID: firstChildID, - name: 'd', - parentEntityId: originID, - timestamp: 1, - }); - const secondChild: ResolverEvent = mockEndpointEvent({ - entityID: secondChildID, - name: 'e', - parentEntityId: originID, - timestamp: 2, - }); - - return ({ - entityID: originID, - children: { - childNodes: [{ lifecycle: [firstChild] }, { lifecycle: [secondChild] }], - }, - ancestry: { - ancestors: [], - }, - lifecycle: [origin], - } as unknown) as ResolverTree; -} diff --git a/x-pack/plugins/security_solution/public/resolver/store/selectors.ts b/x-pack/plugins/security_solution/public/resolver/store/selectors.ts index ff2179dc3a2ae..040e2920ce554 100644 --- a/x-pack/plugins/security_solution/public/resolver/store/selectors.ts +++ b/x-pack/plugins/security_solution/public/resolver/store/selectors.ts @@ -212,17 +212,6 @@ export const graphableProcesses = composeSelectors( dataSelectors.graphableProcesses ); -/** - * Calls the `secondSelector` with the result of the `selector`. Use this when re-exporting a - * concern-specific selector. `selector` should return the concern-specific state. - */ -function composeSelectors( - selector: (state: OuterState) => InnerState, - secondSelector: (state: InnerState) => ReturnValue -): (state: OuterState) => ReturnValue { - return (state) => secondSelector(selector(state)); -} - const boundingBox = composeSelectors(cameraStateSelector, cameraSelectors.viewableBoundingBox); const nodesAndEdgelines = composeSelectors(dataStateSelector, dataSelectors.nodesAndEdgelines); @@ -246,6 +235,7 @@ export const visibleNodesAndEdgeLines = createSelector(nodesAndEdgelines, boundi boundingBox /* eslint-enable no-shadow */ ) { + // `boundingBox` and `nodesAndEdgelines` are each memoized. return (time: number) => nodesAndEdgelines(boundingBox(time)); }); @@ -261,14 +251,14 @@ export const ariaLevel: ( /** * Takes a nodeID (aka entity_id) and returns the node ID of the node that aria should 'flowto' or null - * If the node has a following sibling that is currently visible, that will be returned, otherwise null. + * If the node has a flowto candidate that is currently visible, that will be returned, otherwise null. */ export const ariaFlowtoNodeID: ( state: ResolverState ) => (time: number) => (nodeID: string) => string | null = createSelector( visibleNodesAndEdgeLines, - composeSelectors(dataStateSelector, dataSelectors.followingSibling), - (visibleNodesAndEdgeLinesAtTime, followingSibling) => { + composeSelectors(dataStateSelector, dataSelectors.ariaFlowtoCandidate), + (visibleNodesAndEdgeLinesAtTime, ariaFlowtoCandidate) => { return defaultMemoize((time: number) => { // get the visible nodes at `time` const { processNodePositions } = visibleNodesAndEdgeLinesAtTime(time); @@ -280,10 +270,23 @@ export const ariaFlowtoNodeID: ( // return the ID of `nodeID`'s following sibling, if it is visible return (nodeID: string): string | null => { - const sibling: string | null = followingSibling(nodeID); + const flowtoNode: string | null = ariaFlowtoCandidate(nodeID); - return sibling === null || nodesVisibleAtTime.has(sibling) === false ? null : sibling; + return flowtoNode === null || nodesVisibleAtTime.has(flowtoNode) === false + ? null + : flowtoNode; }; }); } ); + +/** + * Calls the `secondSelector` with the result of the `selector`. Use this when re-exporting a + * concern-specific selector. `selector` should return the concern-specific state. + */ +function composeSelectors( + selector: (state: OuterState) => InnerState, + secondSelector: (state: InnerState) => ReturnValue +): (state: OuterState) => ReturnValue { + return (state) => secondSelector(selector(state)); +} diff --git a/x-pack/plugins/security_solution/public/resolver/view/panels/panel_content_related_detail.tsx b/x-pack/plugins/security_solution/public/resolver/view/panels/panel_content_related_detail.tsx index 4544381d94955..10e57a09b5da4 100644 --- a/x-pack/plugins/security_solution/public/resolver/view/panels/panel_content_related_detail.tsx +++ b/x-pack/plugins/security_solution/public/resolver/view/panels/panel_content_related_detail.tsx @@ -169,7 +169,9 @@ export const RelatedEventDetail = memo(function RelatedEventDetail({ process, ...relevantData } = relatedEventToShowDetailsFor as ResolverEvent & { + // Type this with various unknown keys so that ts will let us delete those keys ecs: unknown; + process: unknown; }; let displayDate = ''; const sectionData: Array<{ @@ -371,4 +373,3 @@ export const RelatedEventDetail = memo(function RelatedEventDetail({ ); }); -RelatedEventDetail.displayName = 'RelatedEventDetail';