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

[Ingest Manager] Move parseAndVerify* functions to validation.ts #82845

Merged
merged 1 commit into from
Nov 6, 2020

Conversation

jfsiii
Copy link
Contributor

@jfsiii jfsiii commented Nov 6, 2020

Summary

Basic cut-and-paste of parseAndVerify* functions from archive/index.ts to archive/validation.ts.

Should be easier to mock now, replace later, etc.

@jfsiii jfsiii requested a review from a team November 6, 2020 15:09
@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Nov 6, 2020
@jfsiii jfsiii self-assigned this Nov 6, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/ingest-management (Team:Ingest Management)

@jfsiii jfsiii added release_note:skip Skip the PR/issue when compiling release notes v7.11.0 v8.0.0 labels Nov 6, 2020
@jfsiii jfsiii requested review from skh and neptunian November 6, 2020 15:10
@kibanamachine
Copy link
Contributor

💛 Build succeeded, but was flaky


Test Failures

Chrome X-Pack UI Functional Tests.x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/details·ts.Actions and Triggers app Alert Details Alert Instances renders the active alert instances

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has failed 21 times on tracked branches: https://github.com/elastic/kibana/issues/57426

[00:00:00]       │
[00:00:00]         └-: Actions and Triggers app
[00:00:00]           └-> "before all" hook
[00:04:09]           └-: Alert Details
[00:04:09]             └-> "before all" hook
[00:05:29]             └-: Alert Instances
[00:05:29]               └-> "before all" hook
[00:05:29]               └-> "before all" hook
[00:05:29]                 │ debg navigating to triggersActions url: http://localhost:61141/app/management/insightsAndAlerting/triggersActions
[00:05:29]                 │ debg navigate to: http://localhost:61141/app/management/insightsAndAlerting/triggersActions
[00:05:29]                 │ debg browser[INFO] http://localhost:61141/app/management/insightsAndAlerting/triggersActions?_t=1604679841316 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:05:29]                 │
[00:05:29]                 │ debg browser[INFO] http://localhost:61141/bootstrap.js 42:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:05:29]                 │ debg ... sleep(700) start
[00:05:30]                 │ debg ... sleep(700) end
[00:05:30]                 │ debg returned from get, calling refresh
[00:05:31]                 │ERROR browser[SEVERE] http://localhost:61141/37906/bundles/core/core.entry.js 12:192226 TypeError: Failed to fetch
[00:05:31]                 │          at _callee3$ (http://localhost:61141/37906/bundles/core/core.entry.js:6:43940)
[00:05:31]                 │          at l (http://localhost:61141/37906/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js:321:1751401)
[00:05:31]                 │          at Generator._invoke (http://localhost:61141/37906/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js:321:1751154)
[00:05:31]                 │          at Generator.forEach.e.<computed> [as throw] (http://localhost:61141/37906/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js:321:1751758)
[00:05:31]                 │          at fetch_asyncGeneratorStep (http://localhost:61141/37906/bundles/core/core.entry.js:6:38998)
[00:05:31]                 │          at _throw (http://localhost:61141/37906/bundles/core/core.entry.js:6:39406)
[00:05:31]                 │ debg browser[INFO] http://localhost:61141/app/management/insightsAndAlerting/triggersActions?_t=1604679841316 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:05:31]                 │
[00:05:31]                 │ debg browser[INFO] http://localhost:61141/bootstrap.js 42:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:05:31]                 │ debg currentUrl = http://localhost:61141/app/management/insightsAndAlerting/triggersActions
[00:05:31]                 │          appUrl = http://localhost:61141/app/management/insightsAndAlerting/triggersActions
[00:05:31]                 │ debg TestSubjects.find(kibanaChrome)
[00:05:31]                 │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:05:31]                 │ debg ... sleep(501) start
[00:05:32]                 │ debg ... sleep(501) end
[00:05:32]                 │ debg in navigateTo url = http://localhost:61141/app/management/insightsAndAlerting/triggersActions/alerts
[00:05:32]                 │ debg --- retry.try error: URL changed, waiting for it to settle
[00:05:32]                 │ debg ... sleep(501) start
[00:05:33]                 │ debg ... sleep(501) end
[00:05:33]                 │ debg in navigateTo url = http://localhost:61141/app/management/insightsAndAlerting/triggersActions/alerts
[00:05:33]                 │ debg TestSubjects.exists(statusPageContainer)
[00:05:33]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="statusPageContainer"]') with timeout=2500
[00:05:35]                 │ debg --- retry.tryForTime error: [data-test-subj="statusPageContainer"] is not displayed
[00:05:36]                 │ debg creating action slack-1ceade10-4800-40c8-9ea9-59ce4c43f7e1-0
[00:05:36]                 │ debg creating action slack-1ceade10-4800-40c8-9ea9-59ce4c43f7e1-1
[00:05:36]                 │ debg created action a16dfa6f-1e32-4275-8a59-18da2d3f0146
[00:05:36]                 │ debg created action 4a6679e3-41e6-40ce-b38f-2f2821986c0a
[00:05:36]                 │ debg creating alert test-alert-1ceade10-4800-40c8-9ea9-59ce4c43f7e1
[00:05:39]                 │ debg created alert c5fe92b3-66dc-4a69-ba80-372979f77b3c
[00:05:39]                 │ debg isGlobalLoadingIndicatorVisible
[00:05:39]                 │ debg TestSubjects.exists(globalLoadingIndicator)
[00:05:39]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="globalLoadingIndicator"]') with timeout=1500
[00:05:41]                 │ debg browser[INFO] http://localhost:61141/app/management/insightsAndAlerting/triggersActions/alerts 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:05:41]                 │
[00:05:41]                 │ debg browser[INFO] http://localhost:61141/bootstrap.js 42:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:05:41]                 │ debg --- retry.tryForTime error: [data-test-subj="globalLoadingIndicator"] is not displayed
[00:05:41]                 │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:05:41]                 │ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:05:41]                 │ debg TestSubjects.exists(alertsList)
[00:05:41]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="alertsList"]') with timeout=120000
[00:05:41]                 │ debg TestSubjects.find(alertSearchField)
[00:05:41]                 │ debg Find.findByCssSelector('[data-test-subj="alertSearchField"]') with timeout=10000
[00:05:42]                 │ debg Find.findByCssSelector('.euiBasicTable[data-test-subj="alertsList"]:not(.euiBasicTable-loading)') with timeout=10000
[00:05:43]                 │ debg Find.clickDisplayedByCssSelector('[data-test-subj="alertsList"] [title="test-alert-1ceade10-4800-40c8-9ea9-59ce4c43f7e1"]') with timeout=10000
[00:05:43]                 │ debg Find.displayedByCssSelector([data-test-subj="alertsList"] [title="test-alert-1ceade10-4800-40c8-9ea9-59ce4c43f7e1"])
[00:05:43]                 │ debg Find.findByCssSelector('[data-test-subj="alertsList"] [title="test-alert-1ceade10-4800-40c8-9ea9-59ce4c43f7e1"]') with timeout=10000
[00:05:43]                 │ debg Wait for element become visible: [data-test-subj="alertsList"] [title="test-alert-1ceade10-4800-40c8-9ea9-59ce4c43f7e1"] with timeout=10000
[00:05:43]                 │ debg getting alert c5fe92b3-66dc-4a69-ba80-372979f77b3c state
[00:05:43]               └-> renders the active alert instances
[00:05:43]                 └-> "before each" hook: global before each
[00:05:43]                 │ debg TestSubjects.exists(alertInstancesList)
[00:05:43]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="alertInstancesList"]') with timeout=120000
[00:05:44]                 │ proc [kibana]   log   [16:24:16.786] [error][plugins][taskManager] Task actions:.slack "828e2890-204c-11eb-a42e-97851243d02b" failed: Error: error validating action params: [level]: definition for this key is missing
[00:05:44]                 │ proc [kibana]   log   [16:24:16.788] [error][plugins][taskManager] Task actions:.slack "8328bae0-204c-11eb-a42e-97851243d02b" failed: Error: error validating action params: [level]: definition for this key is missing
[00:05:44]                 │ proc [kibana]   log   [16:24:16.789] [error][plugins][taskManager] Task actions:.slack "828dda70-204c-11eb-a42e-97851243d02b" failed: Error: error validating action params: [level]: definition for this key is missing
[00:05:44]                 │ proc [kibana]   log   [16:24:16.790] [error][plugins][taskManager] Task actions:.slack "832893d0-204c-11eb-a42e-97851243d02b" failed: Error: error validating action params: [level]: definition for this key is missing
[00:05:44]                 │ proc [kibana]   log   [16:24:16.817] [error][plugins][taskManager] Task actions:.slack "828e0180-204c-11eb-a42e-97851243d02b" failed: Error: error validating action params: [level]: definition for this key is missing
[00:05:44]                 │ proc [kibana]   log   [16:24:16.819] [error][plugins][taskManager] Task actions:.slack "8328e1f0-204c-11eb-a42e-97851243d02b" failed: Error: error validating action params: [level]: definition for this key is missing
[00:05:45]                 │ debg browser[INFO] http://localhost:61141/app/management/insightsAndAlerting/triggersActions/alert/c5fe92b3-66dc-4a69-ba80-372979f77b3c 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:05:45]                 │
[00:05:45]                 │ debg browser[INFO] http://localhost:61141/bootstrap.js 42:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:05:45]                 │ debg getting alert c5fe92b3-66dc-4a69-ba80-372979f77b3c state
[00:05:45]                 │ debg API RESULT: us-central: Fri Nov 06 2020 16:24:13 GMT+0000, us-east: Fri Nov 06 2020 16:24:13 GMT+0000, us-west: Fri Nov 06 2020 16:24:13 GMT+0000
[00:05:45]                 │ debg Find.findByCssSelector('.euiBasicTable[data-test-subj="alertInstancesList"]:not(.euiBasicTable-loading)') with timeout=10000
[00:05:45]                 │ info Taking screenshot "/dev/shm/workspace/parallel/14/kibana/x-pack/test/functional/screenshots/failure/Actions and Triggers app Alert Details Alert Instances renders the active alert instances.png"
[00:05:45]                 │ info Current URL is: http://localhost:61141/app/management/insightsAndAlerting/triggersActions/alert/c5fe92b3-66dc-4a69-ba80-372979f77b3c
[00:05:45]                 │ info Saving page source to: /dev/shm/workspace/parallel/14/kibana/x-pack/test/functional/failure_debug/html/Actions and Triggers app Alert Details Alert Instances renders the active alert instances.html
[00:05:46]                 └- ✖ fail: Actions and Triggers app Alert Details Alert Instances renders the active alert instances
[00:05:46]                 │       Error: expected [ { instance: 'us-central',
[00:05:46]                 │     status: 'Active (Default)',
[00:05:46]                 │     start: '6 Nov 2020 @ 16:24:13' },
[00:05:46]                 │   { instance: 'us-east',
[00:05:46]                 │     status: 'Active',
[00:05:46]                 │     start: '6 Nov 2020 @ 16:24:13' },
[00:05:46]                 │   { instance: 'us-west',
[00:05:46]                 │     status: 'Active (Default)',
[00:05:46]                 │     start: '6 Nov 2020 @ 16:24:13' } ] to sort of equal [ { instance: 'us-central',
[00:05:46]                 │     status: 'Active (Default)',
[00:05:46]                 │     start: '6 Nov 2020 @ 16:24:13' },
[00:05:46]                 │   { instance: 'us-east',
[00:05:46]                 │     status: 'Active (Default)',
[00:05:46]                 │     start: '6 Nov 2020 @ 16:24:13' },
[00:05:46]                 │   { instance: 'us-west',
[00:05:46]                 │     status: 'Active (Default)',
[00:05:46]                 │     start: '6 Nov 2020 @ 16:24:13' } ]
[00:05:46]                 │       + expected - actual
[00:05:46]                 │ 
[00:05:46]                 │          }
[00:05:46]                 │          {
[00:05:46]                 │            "instance": "us-east"
[00:05:46]                 │            "start": "6 Nov 2020 @ 16:24:13"
[00:05:46]                 │       -    "status": "Active"
[00:05:46]                 │       +    "status": "Active (Default)"
[00:05:46]                 │          }
[00:05:46]                 │          {
[00:05:46]                 │            "instance": "us-west"
[00:05:46]                 │            "start": "6 Nov 2020 @ 16:24:13"
[00:05:46]                 │       
[00:05:46]                 │       at Assertion.assert (/dev/shm/workspace/parallel/14/kibana/packages/kbn-expect/expect.js:100:11)
[00:05:46]                 │       at Assertion.eql (/dev/shm/workspace/parallel/14/kibana/packages/kbn-expect/expect.js:244:8)
[00:05:46]                 │       at Context.it (test/functional_with_es_ssl/apps/triggers_actions_ui/details.ts:392:80)
[00:05:46]                 │       at process._tickCallback (internal/process/next_tick.js:68:7)
[00:05:46]                 │ 
[00:05:46]                 │ 

Stack Trace

{ Error: expected [ { instance: 'us-central',
    status: 'Active (Default)',
    start: '6 Nov 2020 @ 16:24:13' },
  { instance: 'us-east',
    status: 'Active',
    start: '6 Nov 2020 @ 16:24:13' },
  { instance: 'us-west',
    status: 'Active (Default)',
    start: '6 Nov 2020 @ 16:24:13' } ] to sort of equal [ { instance: 'us-central',
    status: 'Active (Default)',
    start: '6 Nov 2020 @ 16:24:13' },
  { instance: 'us-east',
    status: 'Active (Default)',
    start: '6 Nov 2020 @ 16:24:13' },
  { instance: 'us-west',
    status: 'Active (Default)',
    start: '6 Nov 2020 @ 16:24:13' } ]
    at Assertion.assert (/dev/shm/workspace/parallel/14/kibana/packages/kbn-expect/expect.js:100:11)
    at Assertion.eql (/dev/shm/workspace/parallel/14/kibana/packages/kbn-expect/expect.js:244:8)
    at Context.it (test/functional_with_es_ssl/apps/triggers_actions_ui/details.ts:392:80)
    at process._tickCallback (internal/process/next_tick.js:68:7)
  actual:
   '[\n  {\n    "instance": "us-central"\n    "start": "6 Nov 2020 @ 16:24:13"\n    "status": "Active (Default)"\n  }\n  {\n    "instance": "us-east"\n    "start": "6 Nov 2020 @ 16:24:13"\n    "status": "Active"\n  }\n  {\n    "instance": "us-west"\n    "start": "6 Nov 2020 @ 16:24:13"\n    "status": "Active (Default)"\n  }\n]',
  expected:
   '[\n  {\n    "instance": "us-central"\n    "start": "6 Nov 2020 @ 16:24:13"\n    "status": "Active (Default)"\n  }\n  {\n    "instance": "us-east"\n    "start": "6 Nov 2020 @ 16:24:13"\n    "status": "Active (Default)"\n  }\n  {\n    "instance": "us-west"\n    "start": "6 Nov 2020 @ 16:24:13"\n    "status": "Active (Default)"\n  }\n]',
  showDiff: true }

Metrics [docs]

distributable file count

id before after diff
default 42736 42737 +1

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

@jfsiii jfsiii merged commit b19a342 into elastic:master Nov 6, 2020
gmmorris added a commit to gmmorris/kibana that referenced this pull request Nov 9, 2020
* master: (68 commits)
  [Fleet] Make stream id unique in agent policy (elastic#82447)
  skip flaky suite (elastic#82915)
  skip flaky suite (elastic#75794)
  Copy `dateAsStringRt` to observability plugin (elastic#82839)
  [Maps] rename connected_components/map folder to mb_map (elastic#82897)
  [Security Solution] Fix EventsViewer DnD cypress tests (elastic#82619)
  [Security Solution] Adds logging and performance fan out API for threat/Indicator matching (elastic#82546)
  Implemented Alerting health status pusher by using task manager and status pooler for Kibana status plugins 'kibanahost/api/status' (elastic#79056)
  [APM] Adds new configuration 'xpack.apm.maxServiceEnvironments' (elastic#82090)
  Move single use function in line (elastic#82885)
  [ML] Add unsigned_long support to data frame analytics and anomaly detection (elastic#82636)
  Add flot_chart dependency from shared_deps to Shareable Runtime (elastic#81649)
  [Security Solution][Detections] - Auto refresh all rules/monitoring tables (elastic#82062)
  [APM] Fix apm e2e runner script commands (elastic#82798)
  [Ingest Manager] Move cache functions to from registry to archive (elastic#82871)
  Update webpack-dev-server and webpack-cli (elastic#82844)
  [Uptime] Migrate to new es client (elastic#82003)
  Move parseAndVerify* functions to validation.ts (elastic#82845)
  Remove yeoman & yo (elastic#82825)
  [Canvas] Fix elements not being updated properly when filter is changed on workpad (elastic#81863)
  ...
jfsiii pushed a commit to jfsiii/kibana that referenced this pull request Nov 9, 2020
## Summary

Basic cut-and-paste of `parseAndVerify*` functions from `archive/index.ts` to `archive/validation.ts`.

Should be easier to mock now, replace later, etc.
jfsiii pushed a commit that referenced this pull request Nov 9, 2020
## Summary

Basic cut-and-paste of `parseAndVerify*` functions from `archive/index.ts` to `archive/validation.ts`.

Should be easier to mock now, replace later, etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants