Skip to content

[Console] Add the ability for the ScopeResolver to escape "."#63133

Closed
jloleysens wants to merge 1 commit intoelastic:masterfrom
jloleysens:console/fix/relative-resolve-with-dots
Closed

[Console] Add the ability for the ScopeResolver to escape "."#63133
jloleysens wants to merge 1 commit intoelastic:masterfrom
jloleysens:console/fix/relative-resolve-with-dots

Conversation

@jloleysens
Copy link
Contributor

@jloleysens jloleysens commented Apr 9, 2020

Summary

The "." means that we want to go a level deeper for the location of the relative autocomplete, something like ".a.b", but in a lot of cases "." is actually part of the internal endpoint name and so we need to respect that to resolve correctly.

For instance cluster.put_settings (on master) does not resolve completions correctly for the "transient" key because of this. Both persistant and transient should have the same completions available, test with the following snippet:

PUT _cluster/settings
{
  "persistent": {
  }, 
  "transient": {
  }
}

Checklist

Delete any items that are not applicable to this PR.

For maintainers

The "." means that we want to go a level deeper for the location
of the relative autocomplete, something like ".a.b", but in
a lot of cases "." is actually part of the internal endpoint
name and so we need to respect that to resolve correctly.
@jloleysens jloleysens added Feature:Console Dev Tools Console Feature Feature:Dev Tools v8.0.0 Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more t// release_note:skip Skip the PR/issue when compiling release notes v7.8.0 labels Apr 9, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/es-ui (Team:Elasticsearch UI)

@kibanamachine
Copy link
Contributor

💛 Build succeeded, but was flaky


Test Failures

Kibana Pipeline / kibana-xpack-agent / Chrome X-Pack UI Functional Tests.x-pack/test/functional/apps/canvas/custom_elements·ts.Canvas app custom elements adds the custom element to the workpad when prompted

Link to Jenkins

Standard Out

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

[00:00:00]       │
[00:01:48]         └-: Canvas app
[00:01:48]           └-> "before all" hook
[00:02:52]           └-: custom elements
[00:02:52]             └-> "before all" hook
[00:02:52]             └-> "before all" hook
[00:02:52]               │ info [logstash_functional] Loading "mappings.json"
[00:02:52]               │ info [logstash_functional] Loading "data.json.gz"
[00:02:52]               │ info [logstash_functional] Skipped restore for existing index "logstash-2015.09.22"
[00:02:52]               │ info [logstash_functional] Skipped restore for existing index "logstash-2015.09.20"
[00:02:52]               │ info [logstash_functional] Skipped restore for existing index "logstash-2015.09.21"
[00:02:54]               │ info [canvas/default] Loading "mappings.json"
[00:02:54]               │ info [canvas/default] Loading "data.json.gz"
[00:02:54]               │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586444588349330201] [.kibana_2/XafUB7vXRfGO4nvdHc08SQ] deleting index
[00:02:54]               │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586444588349330201] [.kibana_1/slkRcY5AQYqN7ZMaDJXIlA] deleting index
[00:02:54]               │ info [canvas/default] Deleted existing index [".kibana_2",".kibana_1"]
[00:02:54]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586444588349330201] applying create index request using v1 templates []
[00:02:54]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586444588349330201] [.kibana_1] creating index, cause [api], templates [], shards [1]/[1], mappings [_doc]
[00:02:54]               │ info [canvas/default] Created index ".kibana_1"
[00:02:54]               │ debg [canvas/default] ".kibana_1" settings {"index":{"number_of_replicas":"1","number_of_shards":"1"}}
[00:02:54]               │ info [canvas/default] Indexed 3 docs into ".kibana_1"
[00:02:55]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586444588349330201] [.kibana_1/UEGp9ASESRO8ay0TOAUJ7g] update_mapping [_doc]
[00:02:55]               │ debg Migrating saved objects
[00:02:55]               │ proc [kibana]   log   [15:42:12.180] [info][savedobjects-service] Creating index .kibana_2.
[00:02:55]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586444588349330201] applying create index request using v1 templates []
[00:02:55]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586444588349330201] [.kibana_2] creating index, cause [api], templates [], shards [1]/[1], mappings [_doc]
[00:02:55]               │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586444588349330201] updating number_of_replicas to [0] for indices [.kibana_2]
[00:02:56]               │ proc [kibana]   log   [15:42:12.326] [info][savedobjects-service] Migrating .kibana_1 saved objects to .kibana_2
[00:02:56]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586444588349330201] [.kibana_2/c-PFTBDASFCRadP4chC_pg] update_mapping [_doc]
[00:02:56]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586444588349330201] [.kibana_2/c-PFTBDASFCRadP4chC_pg] update_mapping [_doc]
[00:02:56]               │ proc [kibana]   log   [15:42:12.521] [info][savedobjects-service] Pointing alias .kibana to .kibana_2.
[00:02:56]               │ proc [kibana]   log   [15:42:12.594] [info][savedobjects-service] Finished in 417ms.
[00:02:56]               │ debg navigating to canvas url: http://localhost:6121/app/canvas#/
[00:02:56]               │ debg navigate to: http://localhost:6121/app/canvas#/
[00:02:56]               │ debg browser[INFO] http://localhost:6121/app/canvas?_t=1586446932602#/ 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:02:56]               │
[00:02:56]               │ debg browser[INFO] http://localhost:6121/bundles/app/canvas/bootstrap.js 9:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:02:56]               │ debg ... sleep(700) start
[00:02:57]               │ debg ... sleep(700) end
[00:02:57]               │ debg returned from get, calling refresh
[00:02:59]               │ debg browser[INFO] http://localhost:6121/app/canvas?_t=1586446932602#/ 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:02:59]               │
[00:02:59]               │ debg browser[INFO] http://localhost:6121/bundles/app/canvas/bootstrap.js 9:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:02:59]               │ debg currentUrl = http://localhost:6121/app/canvas#/
[00:02:59]               │          appUrl = http://localhost:6121/app/canvas#/
[00:02:59]               │ debg TestSubjects.find(kibanaChrome)
[00:02:59]               │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:03:03]               │ debg browser[INFO] http://localhost:6121/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js 380:106115 "INFO: 2020-04-09T15:42:18Z
[00:03:03]               │        Adding connection to http://localhost:6121/elasticsearch
[00:03:03]               │
[00:03:03]               │      "
[00:03:03]               │ debg ... sleep(501) start
[00:03:04]               │ debg ... sleep(501) end
[00:03:04]               │ debg in navigateTo url = http://localhost:6121/app/canvas#/
[00:03:04]               │ debg TestSubjects.exists(statusPageContainer)
[00:03:04]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="statusPageContainer"]') with timeout=2500
[00:03:07]               │ debg --- retry.tryForTime error: [data-test-subj="statusPageContainer"] is not displayed
[00:03:07]               │ debg navigating to canvas url: http://localhost:6121/app/canvas#/workpad/workpad-1705f884-6224-47de-ba49-ca224fe6ec31/page/1
[00:03:07]               │ debg navigate to: http://localhost:6121/app/canvas#/workpad/workpad-1705f884-6224-47de-ba49-ca224fe6ec31/page/1
[00:03:07]               │ debg browser[INFO] http://localhost:6121/app/canvas?_t=1586446943769#/workpad/workpad-1705f884-6224-47de-ba49-ca224fe6ec31/page/1 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:03:07]               │
[00:03:07]               │ debg browser[INFO] http://localhost:6121/bundles/app/canvas/bootstrap.js 9:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:03:07]               │ debg ... sleep(700) start
[00:03:08]               │ debg ... sleep(700) end
[00:03:08]               │ debg returned from get, calling refresh
[00:03:09]               │ debg browser[INFO] http://localhost:6121/app/canvas?_t=1586446943769#/workpad/workpad-1705f884-6224-47de-ba49-ca224fe6ec31/page/1 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:03:09]               │
[00:03:09]               │ debg browser[INFO] http://localhost:6121/bundles/app/canvas/bootstrap.js 9:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:03:09]               │ debg currentUrl = http://localhost:6121/app/canvas#/workpad/workpad-1705f884-6224-47de-ba49-ca224fe6ec31/page/1
[00:03:09]               │          appUrl = http://localhost:6121/app/canvas#/workpad/workpad-1705f884-6224-47de-ba49-ca224fe6ec31/page/1
[00:03:09]               │ debg TestSubjects.find(kibanaChrome)
[00:03:09]               │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:03:14]               │ debg browser[INFO] http://localhost:6121/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js 380:106115 "INFO: 2020-04-09T15:42:29Z
[00:03:14]               │        Adding connection to http://localhost:6121/elasticsearch
[00:03:14]               │
[00:03:14]               │      "
[00:03:14]               │ debg ... sleep(501) start
[00:03:15]               │ debg ... sleep(501) end
[00:03:15]               │ debg in navigateTo url = http://localhost:6121/app/canvas#/workpad/workpad-1705f884-6224-47de-ba49-ca224fe6ec31/page/1
[00:03:15]               │ debg TestSubjects.exists(statusPageContainer)
[00:03:15]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="statusPageContainer"]') with timeout=2500
[00:03:17]               │ debg --- retry.tryForTime error: [data-test-subj="statusPageContainer"] is not displayed
[00:03:18]             └-> creates a custom element from an element when prompted
[00:03:18]               └-> "before each" hook: global before each
[00:03:18]               │ debg TestSubjects.click(canvasWorkpadPage > canvasWorkpadPageElementContent)
[00:03:18]               │ debg Find.clickByCssSelector('[data-test-subj="canvasWorkpadPage"] [data-test-subj="canvasWorkpadPageElementContent"]') with timeout=20000
[00:03:18]               │ debg Find.findByCssSelector('[data-test-subj="canvasWorkpadPage"] [data-test-subj="canvasWorkpadPageElementContent"]') with timeout=20000
[00:03:18]               │ debg Find.clickByCssSelector('[aria-label="Save as new element"]') with timeout=20000
[00:03:18]               │ debg Find.findByCssSelector('[aria-label="Save as new element"]') with timeout=20000
[00:03:19]               │ debg TestSubjects.setValue(canvasCustomElementForm-name, My New Element)
[00:03:19]               │ debg TestSubjects.click(canvasCustomElementForm-name)
[00:03:19]               │ debg Find.clickByCssSelector('[data-test-subj="canvasCustomElementForm-name"]') with timeout=10000
[00:03:19]               │ debg Find.findByCssSelector('[data-test-subj="canvasCustomElementForm-name"]') with timeout=10000
[00:03:19]               │ debg TestSubjects.setValue(canvasCustomElementForm-description, An excellent new element)
[00:03:19]               │ debg TestSubjects.click(canvasCustomElementForm-description)
[00:03:19]               │ debg Find.clickByCssSelector('[data-test-subj="canvasCustomElementForm-description"]') with timeout=10000
[00:03:19]               │ debg Find.findByCssSelector('[data-test-subj="canvasCustomElementForm-description"]') with timeout=10000
[00:03:20]               │ debg TestSubjects.click(canvasCustomElementForm-submit)
[00:03:20]               │ debg Find.clickByCssSelector('[data-test-subj="canvasCustomElementForm-submit"]') with timeout=10000
[00:03:20]               │ debg Find.findByCssSelector('[data-test-subj="canvasCustomElementForm-submit"]') with timeout=10000
[00:03:20]               │ debg TestSubjects.exists(canvasCustomElementCreate-success)
[00:03:20]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="canvasCustomElementCreate-success"]') with timeout=30000
[00:03:21]               └- ✓ pass  (3.0s) "Canvas app custom elements creates a custom element from an element when prompted"
[00:03:21]             └-> adds the custom element to the workpad when prompted
[00:03:21]               └-> "before each" hook: global before each
[00:03:21]               │ debg TestSubjects.click(add-element-button)
[00:03:21]               │ debg Find.clickByCssSelector('[data-test-subj="add-element-button"]') with timeout=10000
[00:03:21]               │ debg Find.findByCssSelector('[data-test-subj="add-element-button"]') with timeout=10000
[00:03:21]               │ debg Find.clickByCssSelector('#customElements') with timeout=20000
[00:03:21]               │ debg Find.findByCssSelector('#customElements') with timeout=20000
[00:03:21]               │ debg Find.findByCssSelector('[aria-labelledby="customElements"] .canvasElementCard__wrapper') with timeout=10000
[00:03:31]               │ info Taking screenshot "/dev/shm/workspace/kibana/x-pack/test/functional/screenshots/failure/Canvas app custom elements adds the custom element to the workpad when prompted.png"
[00:03:32]               │ info Current URL is: http://localhost:6121/app/canvas#/workpad/workpad-1705f884-6224-47de-ba49-ca224fe6ec31/page/1
[00:03:32]               │ info Saving page source to: /dev/shm/workspace/kibana/x-pack/test/functional/failure_debug/html/Canvas app custom elements adds the custom element to the workpad when prompted.html
[00:03:32]               └- ✖ fail: "Canvas app custom elements adds the custom element to the workpad when prompted"
[00:03:32]               │

Stack Trace

{ TimeoutError: Waiting for element to be located By(css selector, [aria-labelledby="customElements"] .canvasElementCard__wrapper)
Wait timed out after 10048ms
    at /dev/shm/workspace/kibana/node_modules/selenium-webdriver/lib/webdriver.js:842:17
    at process._tickCallback (internal/process/next_tick.js:68:7) name: 'TimeoutError', remoteStacktrace: '' }

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

@jloleysens jloleysens closed this Apr 14, 2020
@jloleysens
Copy link
Contributor Author

Closed in favor of #63444 for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature:Console Dev Tools Console Feature Feature:Dev Tools release_note:skip Skip the PR/issue when compiling release notes Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more t// v7.8.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments