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

[Alerting] Always call .resolve() on the rules detail page #114670

Merged
merged 1 commit into from
Oct 13, 2021

Conversation

chrisronline
Copy link
Contributor

@chrisronline chrisronline commented Oct 12, 2021

Resolves #114127

This PR changes how the rule detail page loads rules based on the effort to ensure rules and connectors were sharable in 8.0 to exclusively call the .resolve() route. Previously (currently), it attempts to call the .get() and only calls the .resolve() if the initial .get() returned a 404.

@chrisronline chrisronline changed the title [Alerting] Always call .resolve() on the rules detail page [Alerting][skip-ci] Always call .resolve() on the rules detail page Oct 12, 2021
@kibanamachine
Copy link
Contributor

💛 Build succeeded, but was flaky


Test Failures

Kibana Pipeline / general / X-Pack API Integration Tests.x-pack/test/api_integration/apis/maps/get_tile·js.apis Maps endpoints getTile should return vector tile containing document

Link to Jenkins

Standard Out

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

[00:00:00]     │
[00:00:00]       └-: apis
[00:00:00]         └-> "before all" hook in "apis"
[00:07:09]         └-: Maps endpoints
[00:07:09]           └-> "before all" hook in "Maps endpoints"
[00:07:09]           └-> "before all" hook in "Maps endpoints"
[00:07:09]             │ info [x-pack/test/functional/es_archives/logstash_functional] Loading "mappings.json"
[00:07:09]             │ info [x-pack/test/functional/es_archives/logstash_functional] Loading "data.json.gz"
[00:07:09]             │ info [o.e.c.m.MetadataCreateIndexService] [node-01] [logstash-2015.09.22] creating index, cause [api], templates [], shards [1]/[0]
[00:07:09]             │ info [x-pack/test/functional/es_archives/logstash_functional] Created index "logstash-2015.09.22"
[00:07:09]             │ debg [x-pack/test/functional/es_archives/logstash_functional] "logstash-2015.09.22" settings {"index":{"analysis":{"analyzer":{"url":{"max_token_length":"1000","tokenizer":"uax_url_email","type":"standard"}}},"number_of_replicas":"0","number_of_shards":"1"}}
[00:07:09]             │ info [o.e.c.m.MetadataCreateIndexService] [node-01] [logstash-2015.09.20] creating index, cause [api], templates [], shards [1]/[0]
[00:07:09]             │ info [x-pack/test/functional/es_archives/logstash_functional] Created index "logstash-2015.09.20"
[00:07:09]             │ debg [x-pack/test/functional/es_archives/logstash_functional] "logstash-2015.09.20" settings {"index":{"analysis":{"analyzer":{"url":{"max_token_length":"1000","tokenizer":"uax_url_email","type":"standard"}}},"number_of_replicas":"0","number_of_shards":"1"}}
[00:07:09]             │ info [o.e.c.m.MetadataCreateIndexService] [node-01] [logstash-2015.09.21] creating index, cause [api], templates [], shards [1]/[0]
[00:07:09]             │ info [x-pack/test/functional/es_archives/logstash_functional] Created index "logstash-2015.09.21"
[00:07:09]             │ debg [x-pack/test/functional/es_archives/logstash_functional] "logstash-2015.09.21" settings {"index":{"analysis":{"analyzer":{"url":{"max_token_length":"1000","tokenizer":"uax_url_email","type":"standard"}}},"number_of_replicas":"0","number_of_shards":"1"}}
[00:07:09]             │ info [o.e.c.m.MetadataMappingService] [node-01] [logstash-2015.09.21/l6XiOMWDQ_KDPNFiuZW6pg] update_mapping [_doc]
[00:07:12]             │ info [o.e.c.m.MetadataMappingService] [node-01] [logstash-2015.09.20/oycOuU6jRb6GWErjRazvFA] update_mapping [_doc]
[00:07:19]             │ info progress: 13540
[00:07:19]             │ info [x-pack/test/functional/es_archives/logstash_functional] Indexed 4634 docs into "logstash-2015.09.22"
[00:07:19]             │ info [x-pack/test/functional/es_archives/logstash_functional] Indexed 4757 docs into "logstash-2015.09.20"
[00:07:19]             │ info [x-pack/test/functional/es_archives/logstash_functional] Indexed 4614 docs into "logstash-2015.09.21"
[00:07:19]             │ info [x-pack/test/functional/es_archives/maps/data] Loading "mappings.json"
[00:07:19]             │ info [x-pack/test/functional/es_archives/maps/data] Loading "data.json"
[00:07:19]             │ info [o.e.c.m.MetadataCreateIndexService] [node-01] [geo_shapes] creating index, cause [api], templates [], shards [1]/[0]
[00:07:19]             │ info [x-pack/test/functional/es_archives/maps/data] Created index "geo_shapes"
[00:07:19]             │ debg [x-pack/test/functional/es_archives/maps/data] "geo_shapes" settings {"index":{"number_of_replicas":"0","number_of_shards":"1","max_result_window":"10001","max_inner_result_window":"101"}}
[00:07:19]             │ info [o.e.c.m.MetadataCreateIndexService] [node-01] [drawing_data] creating index, cause [api], templates [], shards [1]/[0]
[00:07:19]             │ info [x-pack/test/functional/es_archives/maps/data] Created index "drawing_data"
[00:07:19]             │ debg [x-pack/test/functional/es_archives/maps/data] "drawing_data" settings {"index":{"number_of_replicas":"0","number_of_shards":"1","max_result_window":"10001","max_inner_result_window":"101"}}
[00:07:19]             │ info [o.e.c.m.MetadataCreateIndexService] [node-01] [meta_for_geo_shapes] creating index, cause [api], templates [], shards [1]/[0]
[00:07:19]             │ info [x-pack/test/functional/es_archives/maps/data] Created index "meta_for_geo_shapes"
[00:07:19]             │ debg [x-pack/test/functional/es_archives/maps/data] "meta_for_geo_shapes" settings {"index":{"number_of_replicas":"0","number_of_shards":"1"}}
[00:07:19]             │ info [o.e.c.m.MetadataCreateIndexService] [node-01] [antimeridian_points] creating index, cause [api], templates [], shards [1]/[0]
[00:07:19]             │ info [x-pack/test/functional/es_archives/maps/data] Created index "antimeridian_points"
[00:07:19]             │ debg [x-pack/test/functional/es_archives/maps/data] "antimeridian_points" settings {"index":{"number_of_replicas":"0","number_of_shards":"1"}}
[00:07:19]             │ info [o.e.c.m.MetadataCreateIndexService] [node-01] [antimeridian_shapes] creating index, cause [api], templates [], shards [1]/[0]
[00:07:20]             │ info [x-pack/test/functional/es_archives/maps/data] Created index "antimeridian_shapes"
[00:07:20]             │ debg [x-pack/test/functional/es_archives/maps/data] "antimeridian_shapes" settings {"index":{"number_of_replicas":"0","number_of_shards":"1"}}
[00:07:20]             │ info [o.e.c.m.MetadataCreateIndexService] [node-01] [flights] creating index, cause [api], templates [], shards [1]/[0]
[00:07:20]             │ info [x-pack/test/functional/es_archives/maps/data] Created index "flights"
[00:07:20]             │ debg [x-pack/test/functional/es_archives/maps/data] "flights" settings {"index":{"number_of_replicas":"0","number_of_shards":"1"}}
[00:07:20]             │ info [o.e.c.m.MetadataCreateIndexService] [node-01] [connections] creating index, cause [api], templates [], shards [1]/[0]
[00:07:20]             │ info [x-pack/test/functional/es_archives/maps/data] Created index "connections"
[00:07:20]             │ debg [x-pack/test/functional/es_archives/maps/data] "connections" settings {"index":{"number_of_replicas":"0","number_of_shards":"1"}}
[00:07:20]             │ info [o.e.c.m.MetadataMappingService] [node-01] [meta_for_geo_shapes/vlz9bqs3SHmxrML8yG844w] update_mapping [_doc]
[00:07:20]             │ info [x-pack/test/functional/es_archives/maps/data] Indexed 4 docs into "geo_shapes"
[00:07:20]             │ info [x-pack/test/functional/es_archives/maps/data] Indexed 1 docs into "drawing_data"
[00:07:20]             │ info [x-pack/test/functional/es_archives/maps/data] Indexed 6 docs into "meta_for_geo_shapes"
[00:07:20]             │ info [x-pack/test/functional/es_archives/maps/data] Indexed 3 docs into "antimeridian_points"
[00:07:20]             │ info [x-pack/test/functional/es_archives/maps/data] Indexed 3 docs into "antimeridian_shapes"
[00:07:20]             │ info [x-pack/test/functional/es_archives/maps/data] Indexed 3 docs into "flights"
[00:07:20]             │ info [x-pack/test/functional/es_archives/maps/data] Indexed 4 docs into "connections"
[00:07:20]           └-: 
[00:07:20]             └-> "before all" hook in ""
[00:07:29]             └-: getTile
[00:07:29]               └-> "before all" hook for "should return vector tile containing document"
[00:07:29]               └-> should return vector tile containing document
[00:07:29]                 └-> "before each" hook: global before each for "should return vector tile containing document"
[00:07:29]                 └- ✖ fail: apis Maps endpoints  getTile should return vector tile containing document
[00:07:29]                 │       Error: expected { __kbn_metadata_feature__: true,
[00:07:29]                 │   __kbn_is_tile_complete__: true,
[00:07:29]                 │   __kbn_vector_shape_type_counts__: '{"POINT":2,"LINE":0,"POLYGON":0}',
[00:07:29]                 │   __kbn_feature_count__: 2,
[00:07:29]                 │   fieldMeta: '{"bytes":{"range":{"min":9252,"max":9583,"delta":331},"categories":{"categories":[{"key":9583,"count":1},{"key":9252,"count":1}]}},"machine.os.raw":{"categories":{"categories":[{"count":1},{"key":"ios","count":1}]}}}' } to sort of equal { __kbn_feature_count__: 2,
[00:07:29]                 │   __kbn_is_tile_complete__: true,
[00:07:29]                 │   __kbn_metadata_feature__: true,
[00:07:29]                 │   __kbn_vector_shape_type_counts__: '{"POINT":2,"LINE":0,"POLYGON":0}',
[00:07:29]                 │   fieldMeta: '{"machine.os.raw":{"categories":{"categories":[{"key":"ios","count":1},{"count":1}]}},"bytes":{"range":{"min":9252,"max":9583,"delta":331},"categories":{"categories":[{"key":9252,"count":1},{"key":9583,"count":1}]}}}' }
[00:07:29]                 │       + expected - actual
[00:07:29]                 │ 
[00:07:29]                 │          "__kbn_feature_count__": 2
[00:07:29]                 │          "__kbn_is_tile_complete__": true
[00:07:29]                 │          "__kbn_metadata_feature__": true
[00:07:29]                 │          "__kbn_vector_shape_type_counts__": "{\"POINT\":2,\"LINE\":0,\"POLYGON\":0}"
[00:07:29]                 │       -  "fieldMeta": "{\"bytes\":{\"range\":{\"min\":9252,\"max\":9583,\"delta\":331},\"categories\":{\"categories\":[{\"key\":9583,\"count\":1},{\"key\":9252,\"count\":1}]}},\"machine.os.raw\":{\"categories\":{\"categories\":[{\"count\":1},{\"key\":\"ios\",\"count\":1}]}}}"
[00:07:29]                 │       +  "fieldMeta": "{\"machine.os.raw\":{\"categories\":{\"categories\":[{\"key\":\"ios\",\"count\":1},{\"count\":1}]}},\"bytes\":{\"range\":{\"min\":9252,\"max\":9583,\"delta\":331},\"categories\":{\"categories\":[{\"key\":9252,\"count\":1},{\"key\":9583,\"count\":1}]}}}"
[00:07:29]                 │        }
[00:07:29]                 │       
[00:07:29]                 │       at Assertion.assert (/dev/shm/workspace/parallel/16/kibana/node_modules/@kbn/expect/expect.js:100:11)
[00:07:29]                 │       at Assertion.eql (/dev/shm/workspace/parallel/16/kibana/node_modules/@kbn/expect/expect.js:244:8)
[00:07:29]                 │       at Context.<anonymous> (test/api_integration/apis/maps/get_tile.js:69:45)
[00:07:29]                 │       at runMicrotasks (<anonymous>)
[00:07:29]                 │       at processTicksAndRejections (internal/process/task_queues.js:95:5)
[00:07:29]                 │       at Object.apply (/dev/shm/workspace/parallel/16/kibana/node_modules/@kbn/test/target_node/functional_test_runner/lib/mocha/wrap_function.js:87:16)
[00:07:29]                 │ 
[00:07:29]                 │ 

Stack Trace

Error: expected { __kbn_metadata_feature__: true,
  __kbn_is_tile_complete__: true,
  __kbn_vector_shape_type_counts__: '{"POINT":2,"LINE":0,"POLYGON":0}',
  __kbn_feature_count__: 2,
  fieldMeta: '{"bytes":{"range":{"min":9252,"max":9583,"delta":331},"categories":{"categories":[{"key":9583,"count":1},{"key":9252,"count":1}]}},"machine.os.raw":{"categories":{"categories":[{"count":1},{"key":"ios","count":1}]}}}' } to sort of equal { __kbn_feature_count__: 2,
  __kbn_is_tile_complete__: true,
  __kbn_metadata_feature__: true,
  __kbn_vector_shape_type_counts__: '{"POINT":2,"LINE":0,"POLYGON":0}',
  fieldMeta: '{"machine.os.raw":{"categories":{"categories":[{"key":"ios","count":1},{"count":1}]}},"bytes":{"range":{"min":9252,"max":9583,"delta":331},"categories":{"categories":[{"key":9252,"count":1},{"key":9583,"count":1}]}}}' }
    at Assertion.assert (/dev/shm/workspace/parallel/16/kibana/node_modules/@kbn/expect/expect.js:100:11)
    at Assertion.eql (/dev/shm/workspace/parallel/16/kibana/node_modules/@kbn/expect/expect.js:244:8)
    at Context.<anonymous> (test/api_integration/apis/maps/get_tile.js:69:45)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at Object.apply (/dev/shm/workspace/parallel/16/kibana/node_modules/@kbn/test/target_node/functional_test_runner/lib/mocha/wrap_function.js:87:16) {
  actual: '{\n' +
    '  "__kbn_feature_count__": 2\n' +
    '  "__kbn_is_tile_complete__": true\n' +
    '  "__kbn_metadata_feature__": true\n' +
    '  "__kbn_vector_shape_type_counts__": "{\\"POINT\\":2,\\"LINE\\":0,\\"POLYGON\\":0}"\n' +
    '  "fieldMeta": "{\\"bytes\\":{\\"range\\":{\\"min\\":9252,\\"max\\":9583,\\"delta\\":331},\\"categories\\":{\\"categories\\":[{\\"key\\":9583,\\"count\\":1},{\\"key\\":9252,\\"count\\":1}]}},\\"machine.os.raw\\":{\\"categories\\":{\\"categories\\":[{\\"count\\":1},{\\"key\\":\\"ios\\",\\"count\\":1}]}}}"\n' +
    '}',
  expected: '{\n' +
    '  "__kbn_feature_count__": 2\n' +
    '  "__kbn_is_tile_complete__": true\n' +
    '  "__kbn_metadata_feature__": true\n' +
    '  "__kbn_vector_shape_type_counts__": "{\\"POINT\\":2,\\"LINE\\":0,\\"POLYGON\\":0}"\n' +
    '  "fieldMeta": "{\\"machine.os.raw\\":{\\"categories\\":{\\"categories\\":[{\\"key\\":\\"ios\\",\\"count\\":1},{\\"count\\":1}]}},\\"bytes\\":{\\"range\\":{\\"min\\":9252,\\"max\\":9583,\\"delta\\":331},\\"categories\\":{\\"categories\\":[{\\"key\\":9252,\\"count\\":1},{\\"key\\":9583,\\"count\\":1}]}}}"\n' +
    '}',
  showDiff: true
}

Metrics [docs]

Async chunks

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

id before after diff
triggersActionsUi 762.7KB 762.5KB -128.0B

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

@chrisronline chrisronline changed the title [Alerting][skip-ci] Always call .resolve() on the rules detail page [Alerting] Always call .resolve() on the rules detail page Oct 13, 2021
@chrisronline chrisronline added Feature:Alerting/RulesManagement Issues related to the Rules Management UX Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) release_note:skip Skip the PR/issue when compiling release notes v7.16.0 v8.0.0 labels Oct 13, 2021
@chrisronline chrisronline marked this pull request as ready for review October 13, 2021 13:16
@chrisronline chrisronline requested a review from a team as a code owner October 13, 2021 13:16
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-alerting-services (Team:Alerting Services)

Copy link
Contributor

@ymao1 ymao1 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@YulNaumenko YulNaumenko left a comment

Choose a reason for hiding this comment

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

LGTM

@chrisronline chrisronline merged commit fda421f into elastic:master Oct 13, 2021
@chrisronline chrisronline deleted the alerting/always_resolve branch October 13, 2021 20:37
chrisronline added a commit to chrisronline/kibana that referenced this pull request Oct 13, 2021
chrisronline added a commit that referenced this pull request Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
buildkite-ci Feature:Alerting/RulesManagement Issues related to the Rules Management UX release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v7.16.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Alerting] Rule details page should always use resolve API
5 participants