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

[7.x] [Actions] Adding hasAuth to Webhook Configuration to avoid confusing UX (#81390) #81751

Closed
wants to merge 1 commit into from

Conversation

ymao1
Copy link
Contributor

@ymao1 ymao1 commented Oct 27, 2020

Backports the following commits to 7.x:

…g UX (elastic#81390)

* Adding hasAuth to server and client

* Adding migration and fixing tests

* Fixing test

* Adding spacing

* Adding functional test

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@ymao1 ymao1 added the backport label Oct 27, 2020
@kibanamachine
Copy link
Contributor

kibanamachine commented Oct 27, 2020

💔 Build Failed

Failed CI Steps


Test Failures

X-Pack Alerting API Integration Tests.x-pack/test/alerting_api_integration/spaces_only/tests/actions/migrations·ts.alerting api integration spaces only Actions migrations 7.11.0 migrates webhook connector configurations to have `hasAuth` property

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has failed 1 times on tracked branches: https://dryrun

[00:00:00]       │
[00:00:00]         │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-18-tests-xxl-1603799609517920011] [.kibana-event-log-7.11.0-000001] creating index, cause [api], templates [.kibana-event-log-7.11.0-template], shards [1]/[1]
[00:00:00]         │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-ubuntu-18-tests-xxl-1603799609517920011] updating number_of_replicas to [0] for indices [.kibana-event-log-7.11.0-000001]
[00:00:00]         └-: alerting api integration spaces only
[00:00:00]           └-> "before all" hook
[00:00:00]           └-: Actions
[00:00:00]             └-> "before all" hook
[00:00:00]             └-> "before all" hook
[00:00:00]               │ debg creating space
[00:00:00]               │ info [o.e.x.i.IndexLifecycleTransition] [kibana-ci-immutable-ubuntu-18-tests-xxl-1603799609517920011] moving index [.kibana-event-log-7.11.0-000001] from [null] to [{"phase":"new","action":"complete","name":"complete"}] in policy [kibana-event-log-policy]
[00:00:00]               │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-ubuntu-18-tests-xxl-1603799609517920011] Cluster health status changed from [YELLOW] to [GREEN] (reason: [shards started [[.kibana-event-log-7.11.0-000001][0]]]).
[00:00:00]               │ info [o.e.x.i.IndexLifecycleTransition] [kibana-ci-immutable-ubuntu-18-tests-xxl-1603799609517920011] moving index [.kibana-event-log-7.11.0-000001] from [{"phase":"new","action":"complete","name":"complete"}] to [{"phase":"hot","action":"unfollow","name":"wait-for-indexing-complete"}] in policy [kibana-event-log-policy]
[00:00:00]               │ info [o.e.x.i.IndexLifecycleTransition] [kibana-ci-immutable-ubuntu-18-tests-xxl-1603799609517920011] moving index [.kibana-event-log-7.11.0-000001] from [{"phase":"hot","action":"unfollow","name":"wait-for-indexing-complete"}] to [{"phase":"hot","action":"unfollow","name":"wait-for-follow-shard-tasks"}] in policy [kibana-event-log-policy]
[00:00:00]               │ debg created space
[00:00:00]               │ debg creating space
[00:00:00]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-18-tests-xxl-1603799609517920011] [ilm-history-3-000001] creating index, cause [api], templates [ilm-history], shards [1]/[0]
[00:00:01]               │ info [o.e.x.i.IndexLifecycleTransition] [kibana-ci-immutable-ubuntu-18-tests-xxl-1603799609517920011] moving index [ilm-history-3-000001] from [null] to [{"phase":"new","action":"complete","name":"complete"}] in policy [ilm-history-ilm-policy]
[00:00:01]               │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-ubuntu-18-tests-xxl-1603799609517920011] Cluster health status changed from [YELLOW] to [GREEN] (reason: [shards started [[ilm-history-3-000001][0]]]).
[00:00:01]               │ info [o.e.x.i.IndexLifecycleTransition] [kibana-ci-immutable-ubuntu-18-tests-xxl-1603799609517920011] moving index [ilm-history-3-000001] from [{"phase":"new","action":"complete","name":"complete"}] to [{"phase":"hot","action":"unfollow","name":"wait-for-indexing-complete"}] in policy [ilm-history-ilm-policy]
[00:00:01]               │ info [o.e.x.i.IndexLifecycleTransition] [kibana-ci-immutable-ubuntu-18-tests-xxl-1603799609517920011] moving index [ilm-history-3-000001] from [{"phase":"hot","action":"unfollow","name":"wait-for-indexing-complete"}] to [{"phase":"hot","action":"unfollow","name":"wait-for-follow-shard-tasks"}] in policy [ilm-history-ilm-policy]
[00:00:01]               │ debg created space
[00:00:41]             └-: migrations
[00:00:41]               └-> "before all" hook
[00:00:41]               └-> "before all" hook
[00:00:41]                 │ info [actions] Loading "mappings.json"
[00:00:41]                 │ info [actions] Loading "data.json"
[00:00:41]                 │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-ubuntu-18-tests-xxl-1603799609517920011] [.kibana_2/c45RqCRdRRu9msqel-mIPw] deleting index
[00:00:41]                 │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-ubuntu-18-tests-xxl-1603799609517920011] [.kibana_1/_UeEf1FjR628mNNFxCVfTg] deleting index
[00:00:41]                 │ info [actions] Deleted existing index [".kibana_2",".kibana_1"]
[00:00:41]                 │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-18-tests-xxl-1603799609517920011] [.kibana_1] creating index, cause [api], templates [], shards [1]/[0]
[00:00:41]                 │ info [actions] Created index ".kibana_1"
[00:00:41]                 │ debg [actions] ".kibana_1" settings {"index":{"auto_expand_replicas":"0-1","number_of_replicas":"0","number_of_shards":"1"}}
[00:00:41]                 │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-18-tests-xxl-1603799609517920011] [.kibana_1/yS-34yW4SGW-krQwiU27PA] update_mapping [_doc]
[00:00:41]                 │ info [actions] Indexed 3 docs into ".kibana_1"
[00:00:41]                 │ info [actions] Indexed 1 docs into ".kibana"
[00:00:41]                 │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-18-tests-xxl-1603799609517920011] [.kibana_1/yS-34yW4SGW-krQwiU27PA] update_mapping [_doc]
[00:00:41]                 │ debg Migrating saved objects
[00:00:42]                 │ proc [kibana]   log   [13:16:42.856] [info][savedobjects-service] Creating index .kibana_2.
[00:00:42]                 │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-18-tests-xxl-1603799609517920011] [.kibana_2] creating index, cause [api], templates [], shards [1]/[1]
[00:00:42]                 │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-ubuntu-18-tests-xxl-1603799609517920011] updating number_of_replicas to [0] for indices [.kibana_2]
[00:00:42]                 │ proc [kibana]   log   [13:16:42.931] [info][savedobjects-service] Migrating .kibana_1 saved objects to .kibana_2
[00:00:42]                 │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-18-tests-xxl-1603799609517920011] [.kibana_2/_YNjf-GdTRac3cgeEFFxyQ] update_mapping [_doc]
[00:00:42]                 │ proc [kibana]   log   [13:16:43.067] [info][savedobjects-service] Pointing alias .kibana to .kibana_2.
[00:00:42]                 │ proc [kibana]   log   [13:16:43.102] [info][savedobjects-service] Finished in 248ms.
[00:00:42]               └-> 7.10.0 migrates the `casesConfiguration` to be the `incidentConfiguration` in `config`
[00:00:42]                 └-> "before each" hook: global before each
[00:00:42]                 └- ✓ pass  (8ms) "alerting api integration spaces only Actions migrations 7.10.0 migrates the `casesConfiguration` to be the `incidentConfiguration` in `config`"
[00:00:42]               └-> 7.11.0 migrates webhook connector configurations to have `hasAuth` property
[00:00:42]                 └-> "before each" hook: global before each
[00:00:42]                 └- ✖ fail: alerting api integration spaces only Actions migrations 7.11.0 migrates webhook connector configurations to have `hasAuth` property
[00:00:42]                 │      Error: expected { headers: null,
[00:00:42]                 │   method: 'post',
[00:00:42]                 │   url: 'http://localhost' } to include key 'hasAuth'
[00:00:42]                 │       at Assertion.assert (/dev/shm/workspace/parallel/2/kibana/packages/kbn-expect/expect.js:100:11)
[00:00:42]                 │       at Assertion.key (/dev/shm/workspace/parallel/2/kibana/packages/kbn-expect/expect.js:505:8)
[00:00:42]                 │       at Context.it (test/alerting_api_integration/spaces_only/tests/actions/migrations.ts:65:44)
[00:00:42]                 │ 
[00:00:42]                 │ 

Stack Trace

Error: expected { headers: null,
  method: 'post',
  url: 'http://localhost' } to include key 'hasAuth'
    at Assertion.assert (/dev/shm/workspace/parallel/2/kibana/packages/kbn-expect/expect.js:100:11)
    at Assertion.key (/dev/shm/workspace/parallel/2/kibana/packages/kbn-expect/expect.js:505:8)
    at Context.it (test/alerting_api_integration/spaces_only/tests/actions/migrations.ts:65:44)

X-Pack Alerting API Integration Tests.x-pack/test/alerting_api_integration/spaces_only/tests/actions/migrations·ts.alerting api integration spaces only Actions migrations 7.11.0 migrates webhook connector configurations to have `hasAuth` property

Link to Jenkins

Standard Out

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

[00:00:00]       │
[00:00:00]         └-: alerting api integration spaces only
[00:00:00]           └-> "before all" hook
[00:00:00]           └-: Actions
[00:00:00]             └-> "before all" hook
[00:00:00]             └-> "before all" hook
[00:00:00]               │ debg creating space
[00:00:00]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-18-tests-xxl-1603799609517920011] [.kibana-event-log-7.11.0-000001] creating index, cause [api], templates [.kibana-event-log-7.11.0-template], shards [1]/[1]
[00:00:00]               │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-ubuntu-18-tests-xxl-1603799609517920011] updating number_of_replicas to [0] for indices [.kibana-event-log-7.11.0-000001]
[00:00:00]               │ info [o.e.x.i.IndexLifecycleTransition] [kibana-ci-immutable-ubuntu-18-tests-xxl-1603799609517920011] moving index [.kibana-event-log-7.11.0-000001] from [null] to [{"phase":"new","action":"complete","name":"complete"}] in policy [kibana-event-log-policy]
[00:00:00]               │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-ubuntu-18-tests-xxl-1603799609517920011] Cluster health status changed from [YELLOW] to [GREEN] (reason: [shards started [[.kibana-event-log-7.11.0-000001][0]]]).
[00:00:00]               │ info [o.e.x.i.IndexLifecycleTransition] [kibana-ci-immutable-ubuntu-18-tests-xxl-1603799609517920011] moving index [.kibana-event-log-7.11.0-000001] from [{"phase":"new","action":"complete","name":"complete"}] to [{"phase":"hot","action":"unfollow","name":"wait-for-indexing-complete"}] in policy [kibana-event-log-policy]
[00:00:00]               │ info [o.e.x.i.IndexLifecycleTransition] [kibana-ci-immutable-ubuntu-18-tests-xxl-1603799609517920011] moving index [.kibana-event-log-7.11.0-000001] from [{"phase":"hot","action":"unfollow","name":"wait-for-indexing-complete"}] to [{"phase":"hot","action":"unfollow","name":"wait-for-follow-shard-tasks"}] in policy [kibana-event-log-policy]
[00:00:00]               │ debg created space
[00:00:00]               │ debg creating space
[00:00:01]               │ debg created space
[00:00:41]             └-: migrations
[00:00:41]               └-> "before all" hook
[00:00:41]               └-> "before all" hook
[00:00:41]                 │ info [actions] Loading "mappings.json"
[00:00:41]                 │ info [actions] Loading "data.json"
[00:00:41]                 │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-ubuntu-18-tests-xxl-1603799609517920011] [.kibana_2/l6WZu0nTRMyBDsEdiAYcig] deleting index
[00:00:41]                 │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-ubuntu-18-tests-xxl-1603799609517920011] [.kibana_1/1ny0jaMjTeOLdHCGEHg5Og] deleting index
[00:00:41]                 │ info [actions] Deleted existing index [".kibana_2",".kibana_1"]
[00:00:41]                 │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-18-tests-xxl-1603799609517920011] [.kibana_1] creating index, cause [api], templates [], shards [1]/[0]
[00:00:41]                 │ info [actions] Created index ".kibana_1"
[00:00:41]                 │ debg [actions] ".kibana_1" settings {"index":{"auto_expand_replicas":"0-1","number_of_replicas":"0","number_of_shards":"1"}}
[00:00:41]                 │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-18-tests-xxl-1603799609517920011] [.kibana_1/8mkyquDaQ7qntJV3LTY5eg] update_mapping [_doc]
[00:00:41]                 │ info [actions] Indexed 3 docs into ".kibana_1"
[00:00:41]                 │ info [actions] Indexed 1 docs into ".kibana"
[00:00:41]                 │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-18-tests-xxl-1603799609517920011] [.kibana_1/8mkyquDaQ7qntJV3LTY5eg] update_mapping [_doc]
[00:00:41]                 │ debg Migrating saved objects
[00:00:41]                 │ proc [kibana]   log   [12:50:16.654] [info][savedobjects-service] Creating index .kibana_2.
[00:00:41]                 │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-18-tests-xxl-1603799609517920011] [.kibana_2] creating index, cause [api], templates [], shards [1]/[1]
[00:00:41]                 │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-ubuntu-18-tests-xxl-1603799609517920011] updating number_of_replicas to [0] for indices [.kibana_2]
[00:00:41]                 │ proc [kibana]   log   [12:50:16.736] [info][savedobjects-service] Migrating .kibana_1 saved objects to .kibana_2
[00:00:42]                 │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-18-tests-xxl-1603799609517920011] [.kibana_2/CZTiSWFzS2CHGsBj2WDTFg] update_mapping [_doc]
[00:00:42]                 │ proc [kibana]   log   [12:50:16.882] [info][savedobjects-service] Pointing alias .kibana to .kibana_2.
[00:00:42]                 │ proc [kibana]   log   [12:50:16.917] [info][savedobjects-service] Finished in 265ms.
[00:00:42]               └-> 7.10.0 migrates the `casesConfiguration` to be the `incidentConfiguration` in `config`
[00:00:42]                 └-> "before each" hook: global before each
[00:00:42]                 └- ✓ pass  (8ms) "alerting api integration spaces only Actions migrations 7.10.0 migrates the `casesConfiguration` to be the `incidentConfiguration` in `config`"
[00:00:42]               └-> 7.11.0 migrates webhook connector configurations to have `hasAuth` property
[00:00:42]                 └-> "before each" hook: global before each
[00:00:42]                 └- ✖ fail: alerting api integration spaces only Actions migrations 7.11.0 migrates webhook connector configurations to have `hasAuth` property
[00:00:42]                 │      Error: expected { headers: null,
[00:00:42]                 │   method: 'post',
[00:00:42]                 │   url: 'http://localhost' } to include key 'hasAuth'
[00:00:42]                 │       at Assertion.assert (/dev/shm/workspace/parallel/2/kibana/packages/kbn-expect/expect.js:100:11)
[00:00:42]                 │       at Assertion.key (/dev/shm/workspace/parallel/2/kibana/packages/kbn-expect/expect.js:505:8)
[00:00:42]                 │       at Context.it (test/alerting_api_integration/spaces_only/tests/actions/migrations.ts:65:44)
[00:00:42]                 │ 
[00:00:42]                 │ 

Stack Trace

Error: expected { headers: null,
  method: 'post',
  url: 'http://localhost' } to include key 'hasAuth'
    at Assertion.assert (/dev/shm/workspace/parallel/2/kibana/packages/kbn-expect/expect.js:100:11)
    at Assertion.key (/dev/shm/workspace/parallel/2/kibana/packages/kbn-expect/expect.js:505:8)
    at Context.it (test/alerting_api_integration/spaces_only/tests/actions/migrations.ts:65:44)

X-Pack Jest Tests.x-pack/plugins/actions/server/saved_objects.7.11.0 add hasAuth = true for .webhook actions with user and password

Link to Jenkins

Standard Out

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


Stack Trace

Error: expect(received).toMatchObject(expected)

- Expected  - 3
+ Received  + 1

@@ -1,11 +1,9 @@
  Object {
    "attributes": Object {
      "actionTypeId": ".webhook",
-     "config": Object {
-       "hasAuth": true,
-     },
+     "config": Object {},
      "name": "abc",
      "secrets": Object {
        "password": "123",
        "user": "test",
      },
    at Object.test (/dev/shm/workspace/parallel/9/kibana/x-pack/plugins/actions/server/saved_objects/migrations.test.ts:72:43)
    at Promise (/dev/shm/workspace/kibana/node_modules/jest-circus/build/utils.js:230:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (/dev/shm/workspace/kibana/node_modules/jest-circus/build/utils.js:170:10)
    at _callCircusTest (/dev/shm/workspace/kibana/node_modules/jest-circus/build/run.js:212:40)
    at process._tickCallback (internal/process/next_tick.js:68:7)

and 1 more failures, only showing the first 3.

Metrics [docs]

async chunks size

id before after diff
triggersActionsUi 1.5MB 1.5MB +1.0KB

page load bundle size

id before after diff
triggersActionsUi 144.5KB 145.0KB +596.0B

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

@ymao1 ymao1 closed this Oct 27, 2020
@ymao1 ymao1 deleted the backport/7.x/pr-81390 branch February 4, 2021 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants