Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Lens] Dynamic thresholds #107205

Closed
wants to merge 30 commits into from
Closed

Conversation

dej611
Copy link
Contributor

@dej611 dej611 commented Jul 29, 2021

Summary

Fixes #87551

threshold_demo

New Layer UI

Screenshot 2021-08-04 at 16 24 13 Screenshot 2021-08-04 at 16 25 07 Screenshot 2021-08-04 at 16 25 16 Screenshot 2021-08-04 at 16 24 41

Threshold as new layer type

Screenshot 2021-08-04 at 16 24 21

Thresholds can be line or area

Screenshot 2021-08-04 at 16 24 48 Screenshot 2021-08-04 at 16 43 42

Tasks:

  • New layer type: Threshold
    • Add layerType prop to visualization layer
    • Enable only for numeric values
      • check tooltip content for calculation operations
    • Icon for threshold layer
    • Layer title UI refactoring
      • Move delete button on the top right of the layer together with the chart switcher
      • Handle Threshold title
    • Handle the logic for Delete/Reset layer based only on Data Layers
    • Add layer button refactoring
      • Keep current logic if there's only 1 layer type
      • Show type popup if more layers are available
        • Add validation logic to the popup (date histogram, available data dimensions, ...)
    • Show only available axis as dimensions (left, right, horizontal)
      • Show/hide dimensions based on data layers
      • On creation pick the first available dimension and create a static dimension there (75% of max data)
      • When removing data dimensions keep the threshold dimension marking it as invalid
        • Keep it also if it's the only available dimension.
      • If the user removes all possible threshold axis, delete the threshold layer
    • Drag and drop field should default to "Median of X"
    • Dragging a text field to a vis with a threshold sometimes adds the field as "break down by" to the threshold panel instead of the chart panel
    • Duplicate dimension on threshold layer does not work properly
  • Static value operation
  • Filter threshold layer on suggestions
    • Restore threshold layer on XY suggestions
    • Make sure the threshold layer is wiped when switching to a chart that does not support thresholds
  • Threshold dimension editor
    • Add static value tab
      • Only available on threshold layers
    • Validate empty threshold value
    • => Formula transition
      • Carry the static value in Formula
      • When going back to "Static value" show a callout about losing Formula's state.
        • The Threshold value should contain the Formula's output as static value while showing the callout. Editing the input should wipe the Formula's state.
    • => Quick functions
      • Do not go back to static value when selecting a function
      • When going back to "Static value" restore the computed static value rather than the fallback value
    • Color default should be assigned
    • Support threshold area
      • Make threshold area stop after next threshold with the same direction. Different directions overlap is ok.
      • Area fill should have opacity < 1. Area border should have 100% opacity.
  • layerType migrations
    • Lens
    • Embeddables

Checklist

Delete any items that are not applicable to this PR.

Risk Matrix

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

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

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

Risk Probability Severity Mitigation/Notes
Visualization info in Lens Saved Object High High Migrations have been created for both Lens and Embeddables (for Dashboard, etc...) with unit tests

@mbondyra
Copy link
Contributor

mbondyra commented Aug 4, 2021

@elasticmachine merge upstream

@dej611
Copy link
Contributor Author

dej611 commented Aug 5, 2021

@elasticmachine merge upstream

options={[
{
id: `${idPrefix}solid`,
label: 'Solid',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be i18n-ed?

@@ -22,7 +23,7 @@ export function getSuggestions({
// We only render metric charts for single-row queries. We require a single, numeric column.
if (
table.isMultiRow ||
keptLayerIds.length > 1 ||
keptLayerIds.length !== 1 ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious - why is this change here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point.
I made this change as a fix before introducing the better fix upstream here and forgot to restore it back

const usedSeriesTypes = uniq(state.layers.map((layer) => layer.seriesType));
return {
...state,
layers: [
...state.layers,
newLayerState(
usedSeriesTypes.length === 1 ? usedSeriesTypes[0] : state.preferredSeriesType,
layerId
layerId,
layerType as LayerType
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is layerType typed as string and then here asserted here to LayerType? Cannot you just define type in types.ts file?

return state?.layers.find(({ layerId: id }) => id === layerId)?.layerType;
},

getLayerTypes(state, frame) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not a fan of this name given that we have getLayerType that returns only type... I am thinking getLayerTypesParams or getLayerTypesGroups? Not ideal either :(

@kibanamachine
Copy link
Contributor

kibanamachine commented Aug 5, 2021

💔 Build Failed

Failed CI Steps


Test Failures

Jest Tests.x-pack/plugins/lens/public/editor_frame_service/editor_frame.editor_frame initialization should not render something before all datasources are initialized

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches


Stack Trace

TypeError: Cannot read property 'map' of undefined
    at flatMap (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/x-pack/plugins/lens/public/editor_frame_service/editor_frame/suggestion_helpers.ts:131:35)
    at Array.flatMap (<anonymous>)
    at getSuggestions (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/x-pack/plugins/lens/public/editor_frame_service/editor_frame/suggestion_helpers.ts:130:6)
    at /var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/x-pack/plugins/lens/public/editor_frame_service/editor_frame/suggestion_panel.tsx:205:11
    at mountMemo (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:16833:19)
    at Object.useMemo (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:17152:16)
    at useMemo (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react/cjs/react.development.js:1643:21)
    at SuggestionPanel (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/x-pack/plugins/lens/public/editor_frame_service/editor_frame/suggestion_panel.tsx:201:70)
    at renderWithHooks (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:16260:18)
    at mountIndeterminateComponent (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:18794:13)
    at beginWork$1 (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:20162:16)
    at HTMLUnknownElement.callCallback (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:336:14)
    at HTMLUnknownElement.callTheUserObjectsOperation (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/living/generated/EventListener.js:26:30)
    at innerInvokeEventListeners (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:318:25)
    at invokeEventListeners (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:274:3)
    at HTMLUnknownElementImpl._dispatch (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:221:9)
    at HTMLUnknownElementImpl.dispatchEvent (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:94:17)
    at HTMLUnknownElement.dispatchEvent (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js:231:34)
    at Object.invokeGuardedCallbackDev (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:385:16)
    at invokeGuardedCallback (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:440:31)
    at beginWork$$1 (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:25780:7)
    at performUnitOfWork (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:24698:12)
    at workLoopSync (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:24671:22)
    at performSyncWorkOnRoot (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:24270:11)
    at /var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:12199:24
    at unstable_runWithPriority (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/scheduler/cjs/scheduler.development.js:697:12)
    at runWithPriority$2 (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:12149:10)
    at flushSyncCallbackQueueImpl (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:12194:7)
    at flushSyncCallbackQueue (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:12182:3)
    at batchedUpdates$1 (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:24392:7)
    at Object.notify (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-redux/lib/utils/Subscription.js:25:7)
    at Subscription.notifyNestedSubs (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-redux/lib/utils/Subscription.js:98:20)
    at Subscription.handleChangeWrapper (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-redux/lib/utils/Subscription.js:103:12)
    at next (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/@reduxjs/toolkit/node_modules/redux/lib/redux.js:227:7)
    at next (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/x-pack/plugins/lens/public/state_management/time_range_middleware.ts:24:5)
    at next (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/x-pack/plugins/lens/public/state_management/optimizing_middleware.ts:20:5)
    at /var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/x-pack/plugins/lens/public/state_management/init_middleware/index.ts:31:5
    at next (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/redux-thunk/lib/index.js:14:16)
    at Object.<anonymous> (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/@reduxjs/toolkit/src/immutableStateInvariantMiddleware.ts:257:32)
    at /var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-mock/build/index.js:444:39
    at Object.<anonymous> (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-mock/build/index.js:452:13)
    at Object.dispatch (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-mock/build/index.js:103:19)
    at Object.<anonymous> (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/x-pack/plugins/lens/public/editor_frame_service/editor_frame/editor_frame.test.tsx:162:17)
    at _callCircusTest (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:212:5)
    at _runTest (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:149:3)
    at _runTestsForDescribeBlock (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:63:9)
    at _runTestsForDescribeBlock (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:57:9)
    at _runTestsForDescribeBlock (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:57:9)
    at run (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:25:3)
    at runAndTransformResultsToJestFormat (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:176:21)
    at jestAdapter (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:109:19)
    at runTestInternal (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-runner/build/runTest.js:380:16)
    at runTest (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-runner/build/runTest.js:472:34)
    at Object.worker (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-runner/build/testWorker.js:133:12)

Jest Tests.x-pack/plugins/lens/public/editor_frame_service/editor_frame.editor_frame initialization should initialize visualization state and render config panel

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches


Stack Trace

TypeError: Cannot read property 'map' of undefined
    at flatMap (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/x-pack/plugins/lens/public/editor_frame_service/editor_frame/suggestion_helpers.ts:131:35)
    at Array.flatMap (<anonymous>)
    at getSuggestions (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/x-pack/plugins/lens/public/editor_frame_service/editor_frame/suggestion_helpers.ts:130:6)
    at /var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/x-pack/plugins/lens/public/editor_frame_service/editor_frame/suggestion_panel.tsx:205:11
    at mountMemo (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:16833:19)
    at Object.useMemo (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:17152:16)
    at useMemo (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react/cjs/react.development.js:1643:21)
    at SuggestionPanel (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/x-pack/plugins/lens/public/editor_frame_service/editor_frame/suggestion_panel.tsx:201:70)
    at renderWithHooks (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:16260:18)
    at mountIndeterminateComponent (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:18794:13)
    at beginWork$1 (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:20162:16)
    at HTMLUnknownElement.callCallback (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:336:14)
    at HTMLUnknownElement.callTheUserObjectsOperation (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/living/generated/EventListener.js:26:30)
    at innerInvokeEventListeners (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:318:25)
    at invokeEventListeners (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:274:3)
    at HTMLUnknownElementImpl._dispatch (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:221:9)
    at HTMLUnknownElementImpl.dispatchEvent (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:94:17)
    at HTMLUnknownElement.dispatchEvent (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js:231:34)
    at Object.invokeGuardedCallbackDev (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:385:16)
    at invokeGuardedCallback (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:440:31)
    at beginWork$$1 (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:25780:7)
    at performUnitOfWork (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:24698:12)
    at workLoopSync (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:24671:22)
    at performSyncWorkOnRoot (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:24270:11)
    at scheduleUpdateOnFiber (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:23698:7)
    at updateContainer (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:27103:3)
    at /var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:27528:7
    at unbatchedUpdates (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:24433:12)
    at legacyRenderSubtreeIntoContainer (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:27527:5)
    at Object.render (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:27608:10)
    at fn (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/enzyme-adapter-react-16/src/ReactSixteenAdapter.js:488:26)
    at /var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/enzyme-adapter-react-16/src/ReactSixteenAdapter.js:405:37
    at batchedUpdates$1 (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:24386:12)
    at Object.act (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom-test-utils.development.js:1092:14)
    at wrapAct (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/enzyme-adapter-react-16/src/ReactSixteenAdapter.js:405:13)
    at Object.render (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/enzyme-adapter-react-16/src/ReactSixteenAdapter.js:474:16)
    at new ReactWrapper (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/enzyme/src/ReactWrapper.js:115:16)
    at mount (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/enzyme/src/mount.js:10:10)
    at mountWithIntl (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/@kbn/test/target_node/jest/utils/enzyme_helpers.js:95:28)
    at /var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/x-pack/plugins/lens/public/mocks.tsx:480:16
    at batchedUpdates$1 (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:24386:12)
    at act (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom-test-utils.development.js:1092:14)
    at mountWithProvider (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/x-pack/plugins/lens/public/mocks.tsx:479:9)
    at Object.<anonymous> (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/x-pack/plugins/lens/public/editor_frame_service/editor_frame/editor_frame.test.tsx:196:13)
    at Promise.then.completed (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/utils.js:276:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/utils.js:216:10)
    at _callCircusTest (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:212:40)
    at _runTest (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:149:3)
    at _runTestsForDescribeBlock (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:63:9)
    at _runTestsForDescribeBlock (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:57:9)
    at _runTestsForDescribeBlock (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:57:9)
    at run (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:25:3)
    at runAndTransformResultsToJestFormat (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:176:21)
    at jestAdapter (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:109:19)
    at runTestInternal (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-runner/build/runTest.js:380:16)
    at runTest (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-runner/build/runTest.js:472:34)
    at Object.worker (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-runner/build/testWorker.js:133:12)

Jest Tests.x-pack/plugins/lens/public/editor_frame_service/editor_frame.editor_frame initialization should render the resulting expression using the expression renderer

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches


Stack Trace

TypeError: Cannot read property 'map' of undefined
    at flatMap (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/x-pack/plugins/lens/public/editor_frame_service/editor_frame/suggestion_helpers.ts:131:35)
    at Array.flatMap (<anonymous>)
    at getSuggestions (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/x-pack/plugins/lens/public/editor_frame_service/editor_frame/suggestion_helpers.ts:130:6)
    at /var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/x-pack/plugins/lens/public/editor_frame_service/editor_frame/suggestion_panel.tsx:205:11
    at mountMemo (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:16833:19)
    at Object.useMemo (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:17152:16)
    at useMemo (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react/cjs/react.development.js:1643:21)
    at SuggestionPanel (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/x-pack/plugins/lens/public/editor_frame_service/editor_frame/suggestion_panel.tsx:201:70)
    at renderWithHooks (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:16260:18)
    at mountIndeterminateComponent (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:18794:13)
    at beginWork$1 (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:20162:16)
    at HTMLUnknownElement.callCallback (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:336:14)
    at HTMLUnknownElement.callTheUserObjectsOperation (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/living/generated/EventListener.js:26:30)
    at innerInvokeEventListeners (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:318:25)
    at invokeEventListeners (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:274:3)
    at HTMLUnknownElementImpl._dispatch (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:221:9)
    at HTMLUnknownElementImpl.dispatchEvent (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:94:17)
    at HTMLUnknownElement.dispatchEvent (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js:231:34)
    at Object.invokeGuardedCallbackDev (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:385:16)
    at invokeGuardedCallback (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:440:31)
    at beginWork$$1 (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:25780:7)
    at performUnitOfWork (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:24698:12)
    at workLoopSync (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:24671:22)
    at performSyncWorkOnRoot (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:24270:11)
    at scheduleUpdateOnFiber (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:23698:7)
    at updateContainer (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:27103:3)
    at /var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:27528:7
    at unbatchedUpdates (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:24433:12)
    at legacyRenderSubtreeIntoContainer (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:27527:5)
    at Object.render (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:27608:10)
    at fn (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/enzyme-adapter-react-16/src/ReactSixteenAdapter.js:488:26)
    at /var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/enzyme-adapter-react-16/src/ReactSixteenAdapter.js:405:37
    at batchedUpdates$1 (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:24386:12)
    at Object.act (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom-test-utils.development.js:1092:14)
    at wrapAct (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/enzyme-adapter-react-16/src/ReactSixteenAdapter.js:405:13)
    at Object.render (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/enzyme-adapter-react-16/src/ReactSixteenAdapter.js:474:16)
    at new ReactWrapper (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/enzyme/src/ReactWrapper.js:115:16)
    at mount (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/enzyme/src/mount.js:10:10)
    at mountWithIntl (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/@kbn/test/target_node/jest/utils/enzyme_helpers.js:95:28)
    at /var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/x-pack/plugins/lens/public/mocks.tsx:480:16
    at batchedUpdates$1 (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom.development.js:24386:12)
    at act (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/react-dom/cjs/react-dom-test-utils.development.js:1092:14)
    at mountWithProvider (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/x-pack/plugins/lens/public/mocks.tsx:479:9)
    at Object.<anonymous> (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/x-pack/plugins/lens/public/editor_frame_service/editor_frame/editor_frame.test.tsx:228:15)
    at Promise.then.completed (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/utils.js:276:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/utils.js:216:10)
    at _callCircusTest (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:212:40)
    at _runTest (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:149:3)
    at _runTestsForDescribeBlock (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:63:9)
    at _runTestsForDescribeBlock (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:57:9)
    at _runTestsForDescribeBlock (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:57:9)
    at run (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:25:3)
    at runAndTransformResultsToJestFormat (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:176:21)
    at jestAdapter (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:109:19)
    at runTestInternal (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-runner/build/runTest.js:380:16)
    at runTest (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-runner/build/runTest.js:472:34)
    at Object.worker (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-runner/build/testWorker.js:133:12)

and 81 more failures, only showing the first 3.

Metrics [docs]

‼️ ERROR: metrics for c763191 were not reported

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@dej611 dej611 mentioned this pull request Aug 5, 2021
8 tasks
@mbondyra mbondyra mentioned this pull request Aug 12, 2021
42 tasks
@dej611 dej611 closed this Aug 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Lens] Support dynamic thresholds based on a query
3 participants