Skip to content

[7.x] [Cases] ServiceNow connectors UI changes (#114234)#115358

Merged
kibanamachine merged 3 commits intoelastic:7.xfrom
kibanamachine:backport/7.x/pr-114234
Oct 18, 2021
Merged

[7.x] [Cases] ServiceNow connectors UI changes (#114234)#115358
kibanamachine merged 3 commits intoelastic:7.xfrom
kibanamachine:backport/7.x/pr-114234

Conversation

@kibanamachine
Copy link
Copy Markdown
Contributor

Backports the following commits to 7.x:

* POC

* Before and after saving connector callbacks

* Draft callbacks on SN

* Migrate legacy connectors

* Add deprecated connector

* Fix callbacks types

* Pass isEdit to connector forms

* Get application info hook

* Validate instance on save

* Support both legacy and new app

* Seperate SIR

* Log application version & and throw otherwise

* Deprecated tooltip cases

* Deprecated tooltip alerts

* Improve message

* Improve translation

* Change to elastic table & fix types

* Add callbacks to add modal

* Pass new props to tests

* Change health api url to production

* Better installation message

* Migrate connectors functionality

* Change migration version to 7.16

* Fix bug

* Improve message

* Use feature flag

* Create credentials component

* Add form to migration modal

* Improve installation callout

* Improve deprecated callout

* Improve modal

* Improve application required modal

* Improve SN form

* Support both connectors

* Support correlation attributes

* Use same component for SIR

* Prevent using legacy connectors when creating a case

* Add observables

* Unique observables

* Push only if there are observables

* Change labels to plural

* Pass correlation ID and value

* Show errors on the callout

* Improve alerts tooltip

* Improve cases tooltip

* Warning callout on cases configuration page

* Fix tooltip content

* Add help text

* Change from string to array

* Fix i18n

* Fix spelling

* Update incidents for ITSM

* Update incidents for SIR

* Fix types

* Fix backend tests

* Fix frontend tests

* Add service tests

* Fix i18n

* Fix cypress test

* Improve ServiceNow intergration tests

* Fix cases integration tests

* Fix triggers actions ui end to end test

* Fix tests

* Rename modal

* Show error message on modal

* Create useOldConnector helper

* Show the update incident toggle only on new connectors

* Add observables for old connectors

* Fix error when obs are empty

* Enable SIR for alerts

* Fix types

* Improve combineObservables

* Add test for the sir api

* Add test for the sir service

* Add documentation

* PR feedback

* Improve cases deprecated callouts

* Improve observables format

* Add integration tests for SIR

* Fix doc error

* Add config tests

* Add getIncident tests

* Add util tests

* Add migration tests

* Add tests for connectors and improve callouts

* Add more tests

* Add more UI tests

* update connector modal to flyout

* PR feedback

* Test CI

* restore auth callout

* edit connector form spacing

* Improve integration tests

* Add 8 pixels to the left of the connector icon

* update switch to checkboxes

* case detail ui

* Seperate ServiceNow integration tests

* Remove observables fields

* Add correlation values

* Fix merge

* add deprecated text in the dropdown

* update card icon to the right

* new update connetor test and other tests fixes

* PR feedback

* Remove observables from docs

* Remove unused translations

* Using eui theme for styling

* Content feeback

* Add more unit tests

* Fix i18n

* Fix types

* Fixes

* Fixes

* test properly

* fix duplicated translation

* Simplify tooltip

* Writing feedback

Co-authored-by: Christos Nasikas <christos.nasikas@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Jonathan Buttner <jonathan.buttner@elastic.co>
@kibanamachine kibanamachine added the backport This PR is a backport of another PR label Oct 18, 2021
@kibanamachine kibanamachine enabled auto-merge (squash) October 18, 2021 12:52
@cnasikas
Copy link
Copy Markdown
Member

@elasticmachine merge upstream

@cnasikas
Copy link
Copy Markdown
Member

@elasticmachine merge upstream

@kibanamachine
Copy link
Copy Markdown
Contributor Author

💛 Build succeeded, but was flaky


Test Failures

Kibana Pipeline / general / X-Pack API Integration Tests.x-pack/test/api_integration/apis/ml/jobs/categorization_field_examples·ts.apis Machine Learning jobs Categorization example endpoint - partially valid, more than 75% are null

Link to Jenkins

Standard Out

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

[00:00:00]     │
[00:00:00]       └-: apis
[00:00:00]         └-> "before all" hook in "apis"
[00:10:08]         └-: Machine Learning
[00:10:08]           └-> "before all" hook in "Machine Learning"
[00:10:08]           └-> "before all" hook in "Machine Learning"
[00:10:08]             │ debg creating role ft_ml_source
[00:10:08]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [ft_ml_source]
[00:10:08]             │ debg creating role ft_ml_source_readonly
[00:10:08]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [ft_ml_source_readonly]
[00:10:08]             │ debg creating role ft_ml_dest
[00:10:08]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [ft_ml_dest]
[00:10:08]             │ debg creating role ft_ml_dest_readonly
[00:10:08]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [ft_ml_dest_readonly]
[00:10:08]             │ debg creating role ft_ml_ui_extras
[00:10:08]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [ft_ml_ui_extras]
[00:10:08]             │ debg creating role ft_default_space_ml_all
[00:10:08]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [ft_default_space_ml_all]
[00:10:08]             │ debg creating role ft_default_space1_ml_all
[00:10:08]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [ft_default_space1_ml_all]
[00:10:08]             │ debg creating role ft_all_spaces_ml_all
[00:10:08]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [ft_all_spaces_ml_all]
[00:10:08]             │ debg creating role ft_default_space_ml_read
[00:10:08]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [ft_default_space_ml_read]
[00:10:08]             │ debg creating role ft_default_space1_ml_read
[00:10:08]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [ft_default_space1_ml_read]
[00:10:08]             │ debg creating role ft_all_spaces_ml_read
[00:10:09]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [ft_all_spaces_ml_read]
[00:10:09]             │ debg creating role ft_default_space_ml_none
[00:10:09]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [ft_default_space_ml_none]
[00:10:09]             │ debg creating user ft_ml_poweruser
[00:10:09]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [ft_ml_poweruser]
[00:10:09]             │ debg created user ft_ml_poweruser
[00:10:09]             │ debg creating user ft_ml_poweruser_spaces
[00:10:09]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [ft_ml_poweruser_spaces]
[00:10:09]             │ debg created user ft_ml_poweruser_spaces
[00:10:09]             │ debg creating user ft_ml_poweruser_space1
[00:10:09]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [ft_ml_poweruser_space1]
[00:10:09]             │ debg created user ft_ml_poweruser_space1
[00:10:09]             │ debg creating user ft_ml_poweruser_all_spaces
[00:10:09]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [ft_ml_poweruser_all_spaces]
[00:10:09]             │ debg created user ft_ml_poweruser_all_spaces
[00:10:09]             │ debg creating user ft_ml_viewer
[00:10:09]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [ft_ml_viewer]
[00:10:09]             │ debg created user ft_ml_viewer
[00:10:09]             │ debg creating user ft_ml_viewer_spaces
[00:10:09]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [ft_ml_viewer_spaces]
[00:10:09]             │ debg created user ft_ml_viewer_spaces
[00:10:09]             │ debg creating user ft_ml_viewer_space1
[00:10:09]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [ft_ml_viewer_space1]
[00:10:09]             │ debg created user ft_ml_viewer_space1
[00:10:09]             │ debg creating user ft_ml_viewer_all_spaces
[00:10:09]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [ft_ml_viewer_all_spaces]
[00:10:09]             │ debg created user ft_ml_viewer_all_spaces
[00:10:09]             │ debg creating user ft_ml_unauthorized
[00:10:10]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [ft_ml_unauthorized]
[00:10:10]             │ debg created user ft_ml_unauthorized
[00:10:10]             │ debg creating user ft_ml_unauthorized_spaces
[00:10:10]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [ft_ml_unauthorized_spaces]
[00:10:10]             │ debg created user ft_ml_unauthorized_spaces
[00:14:25]           └-: jobs
[00:14:25]             └-> "before all" hook in "jobs"
[00:14:25]             └-: Categorization example endpoint - 
[00:14:25]               └-> "before all" hook for "valid with good number of tokens"
[00:14:25]               └-> "before all" hook for "valid with good number of tokens"
[00:14:25]                 │ info [x-pack/test/functional/es_archives/ml/categorization] Loading "mappings.json"
[00:14:25]                 │ info [x-pack/test/functional/es_archives/ml/categorization] Loading "data.json.gz"
[00:14:25]                 │ info [o.e.c.m.MetadataCreateIndexService] [node-01] [ft_categorization] creating index, cause [api], templates [], shards [1]/[0]
[00:14:25]                 │ info [x-pack/test/functional/es_archives/ml/categorization] Created index "ft_categorization"
[00:14:25]                 │ debg [x-pack/test/functional/es_archives/ml/categorization] "ft_categorization" settings {"index":{"number_of_replicas":"0","number_of_shards":"1"}}
[00:14:27]                 │ info [x-pack/test/functional/es_archives/ml/categorization] Indexed 1501 docs into "ft_categorization"
[00:14:27]                 │ debg applying update to kibana config: {"dateFormat:tz":"UTC"}
[00:14:27]               └-> valid with good number of tokens
[00:14:27]                 └-> "before each" hook: global before each for "valid with good number of tokens"
[00:14:27]                 └- ✓ pass  (159ms)
[00:14:27]               └-> invalid, too many tokens.
[00:14:27]                 └-> "before each" hook: global before each for "invalid, too many tokens."
[00:14:27]                 │ info [r.suppressed] [node-01] path: /_analyze, params: {}
[00:14:27]                 │      org.elasticsearch.transport.RemoteTransportException: [node-01][127.0.0.1:63231][indices:admin/analyze[s]]
[00:14:27]                 │      Caused by: java.lang.IllegalStateException: The number of tokens produced by calling _analyze has exceeded the allowed maximum of [10000]. This limit can be set by changing the [index.analyze.max_token_count] index level setting.
[00:14:27]                 │      	at org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction$TokenCounter.increment(TransportAnalyzeAction.java:397) ~[elasticsearch-7.16.0-SNAPSHOT.jar:7.16.0-SNAPSHOT]
[00:14:27]                 │      	at org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction$TokenCounter.access$100(TransportAnalyzeAction.java:387) ~[elasticsearch-7.16.0-SNAPSHOT.jar:7.16.0-SNAPSHOT]
[00:14:27]                 │      	at org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction.simpleAnalyze(TransportAnalyzeAction.java:229) ~[elasticsearch-7.16.0-SNAPSHOT.jar:7.16.0-SNAPSHOT]
[00:14:27]                 │      	at org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction.analyze(TransportAnalyzeAction.java:204) ~[elasticsearch-7.16.0-SNAPSHOT.jar:7.16.0-SNAPSHOT]
[00:14:27]                 │      	at org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction.analyze(TransportAnalyzeAction.java:122) ~[elasticsearch-7.16.0-SNAPSHOT.jar:7.16.0-SNAPSHOT]
[00:14:27]                 │      	at org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction.shardOperation(TransportAnalyzeAction.java:110) ~[elasticsearch-7.16.0-SNAPSHOT.jar:7.16.0-SNAPSHOT]
[00:14:27]                 │      	at org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction.shardOperation(TransportAnalyzeAction.java:62) ~[elasticsearch-7.16.0-SNAPSHOT.jar:7.16.0-SNAPSHOT]
[00:14:27]                 │      	at org.elasticsearch.action.support.single.shard.TransportSingleShardAction.lambda$asyncShardOperation$0(TransportSingleShardAction.java:99) ~[elasticsearch-7.16.0-SNAPSHOT.jar:7.16.0-SNAPSHOT]
[00:14:27]                 │      	at org.elasticsearch.action.ActionRunnable.lambda$supply$0(ActionRunnable.java:47) [elasticsearch-7.16.0-SNAPSHOT.jar:7.16.0-SNAPSHOT]
[00:14:27]                 │      	at org.elasticsearch.action.ActionRunnable$2.doRun(ActionRunnable.java:62) ~[elasticsearch-7.16.0-SNAPSHOT.jar:7.16.0-SNAPSHOT]
[00:14:27]                 │      	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:737) [elasticsearch-7.16.0-SNAPSHOT.jar:7.16.0-SNAPSHOT]
[00:14:27]                 │      	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26) [elasticsearch-7.16.0-SNAPSHOT.jar:7.16.0-SNAPSHOT]
[00:14:27]                 │      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
[00:14:27]                 │      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
[00:14:27]                 │      	at java.lang.Thread.run(Thread.java:833) [?:?]
[00:14:27]                 │ info [r.suppressed] [node-01] path: /_analyze, params: {}
[00:14:27]                 │      org.elasticsearch.transport.RemoteTransportException: [node-01][127.0.0.1:63231][indices:admin/analyze[s]]
[00:14:27]                 │      Caused by: java.lang.IllegalStateException: The number of tokens produced by calling _analyze has exceeded the allowed maximum of [10000]. This limit can be set by changing the [index.analyze.max_token_count] index level setting.
[00:14:27]                 │      	at org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction$TokenCounter.increment(TransportAnalyzeAction.java:397) ~[elasticsearch-7.16.0-SNAPSHOT.jar:7.16.0-SNAPSHOT]
[00:14:27]                 │      	at org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction$TokenCounter.access$100(TransportAnalyzeAction.java:387) ~[elasticsearch-7.16.0-SNAPSHOT.jar:7.16.0-SNAPSHOT]
[00:14:27]                 │      	at org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction.simpleAnalyze(TransportAnalyzeAction.java:229) ~[elasticsearch-7.16.0-SNAPSHOT.jar:7.16.0-SNAPSHOT]
[00:14:27]                 │      	at org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction.analyze(TransportAnalyzeAction.java:204) ~[elasticsearch-7.16.0-SNAPSHOT.jar:7.16.0-SNAPSHOT]
[00:14:27]                 │      	at org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction.analyze(TransportAnalyzeAction.java:122) ~[elasticsearch-7.16.0-SNAPSHOT.jar:7.16.0-SNAPSHOT]
[00:14:27]                 │      	at org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction.shardOperation(TransportAnalyzeAction.java:110) ~[elasticsearch-7.16.0-SNAPSHOT.jar:7.16.0-SNAPSHOT]
[00:14:27]                 │      	at org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction.shardOperation(TransportAnalyzeAction.java:62) ~[elasticsearch-7.16.0-SNAPSHOT.jar:7.16.0-SNAPSHOT]
[00:14:27]                 │      	at org.elasticsearch.action.support.single.shard.TransportSingleShardAction.lambda$asyncShardOperation$0(TransportSingleShardAction.java:99) ~[elasticsearch-7.16.0-SNAPSHOT.jar:7.16.0-SNAPSHOT]
[00:14:27]                 │      	at org.elasticsearch.action.ActionRunnable.lambda$supply$0(ActionRunnable.java:47) [elasticsearch-7.16.0-SNAPSHOT.jar:7.16.0-SNAPSHOT]
[00:14:27]                 │      	at org.elasticsearch.action.ActionRunnable$2.doRun(ActionRunnable.java:62) ~[elasticsearch-7.16.0-SNAPSHOT.jar:7.16.0-SNAPSHOT]
[00:14:27]                 │      	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:737) [elasticsearch-7.16.0-SNAPSHOT.jar:7.16.0-SNAPSHOT]
[00:14:27]                 │      	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26) [elasticsearch-7.16.0-SNAPSHOT.jar:7.16.0-SNAPSHOT]
[00:14:27]                 │      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
[00:14:27]                 │      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
[00:14:27]                 │      	at java.lang.Thread.run(Thread.java:833) [?:?]
[00:14:27]                 └- ✓ pass  (174ms)
[00:14:27]               └-> partially valid, more than 75% are null
[00:14:27]                 └-> "before each" hook: global before each for "partially valid, more than 75% are null"
[00:14:27]                 └- ✖ fail: apis Machine Learning jobs Categorization example endpoint -  partially valid, more than 75% are null
[00:14:27]                 │       Error: expected 249 to sort of equal 250
[00:14:27]                 │       + expected - actual
[00:14:27]                 │ 
[00:14:27]                 │       -249
[00:14:27]                 │       +250
[00:14:27]                 │       
[00:14:27]                 │       at Assertion.assert (/dev/shm/workspace/parallel/23/kibana/node_modules/@kbn/expect/expect.js:100:11)
[00:14:27]                 │       at Assertion.eql (/dev/shm/workspace/parallel/23/kibana/node_modules/@kbn/expect/expect.js:244:8)
[00:14:27]                 │       at Context.<anonymous> (test/api_integration/apis/ml/jobs/categorization_field_examples.ts:303:36)
[00:14:27]                 │       at runMicrotasks (<anonymous>)
[00:14:27]                 │       at processTicksAndRejections (node:internal/process/task_queues:96:5)
[00:14:27]                 │       at Object.apply (/dev/shm/workspace/parallel/23/kibana/node_modules/@kbn/test/target_node/functional_test_runner/lib/mocha/wrap_function.js:87:16)
[00:14:27]                 │ 
[00:14:27]                 │ 

Stack Trace

Error: expected 249 to sort of equal 250
    at Assertion.assert (/dev/shm/workspace/parallel/23/kibana/node_modules/@kbn/expect/expect.js:100:11)
    at Assertion.eql (/dev/shm/workspace/parallel/23/kibana/node_modules/@kbn/expect/expect.js:244:8)
    at Context.<anonymous> (test/api_integration/apis/ml/jobs/categorization_field_examples.ts:303:36)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Object.apply (/dev/shm/workspace/parallel/23/kibana/node_modules/@kbn/test/target_node/functional_test_runner/lib/mocha/wrap_function.js:87:16) {
  actual: '249',
  expected: '250',
  showDiff: true
}

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
triggersActionsUi 378 379 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
cases 316.6KB 317.5KB +900.0B
triggersActionsUi 793.5KB 789.4KB -4.1KB
total -3.2KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
core 303.1KB 303.1KB +58.0B

History

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

cc @semd

@kibanamachine kibanamachine merged commit 7f4f43b into elastic:7.x Oct 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants