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

[ML] Add ML deep links to navigational search #88958

Merged
merged 6 commits into from
Jan 25, 2021

Conversation

peteharverson
Copy link
Contributor

@peteharverson peteharverson commented Jan 21, 2021

Summary

Adds deep links for the Machine Learning plugin to the navigational search bar.

image

ML is added as a keyword, allowing matches when the user types ML into the navigational search.

image

See #72680

Checklist

Delete any items that are not applicable to this PR.

Fixes #86170

@peteharverson peteharverson added review enhancement New value added to drive a business result :ml v8.0.0 v7.12.0 labels Jan 21, 2021
@peteharverson peteharverson requested a review from a team as a code owner January 21, 2021 12:38
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

@peteharverson peteharverson added release_note:enhancement and removed enhancement New value added to drive a business result labels Jan 21, 2021
@peteharverson peteharverson self-assigned this Jan 21, 2021
Copy link
Member

@jgowdyelastic jgowdyelastic 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

@walterra walterra left a comment

Choose a reason for hiding this comment

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

LGTM, also tested locally.

@peteharverson
Copy link
Contributor Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💛 Build succeeded, but was flaky


Test Failures

Example plugin functional tests.test/examples/bfetch_explorer/batched_function·ts.bfetch explorer batchedFunction executes all requests in a batch

Link to Jenkins

Standard Out

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

[00:00:00]       │
[00:00:41]         └-: bfetch explorer
[00:00:41]           └-> "before all" hook
[00:00:41]           └-> "before all" hook
[00:00:41]             │ debg navigating to bfetch-explorer url: http://localhost:61151/app/bfetch-explorer
[00:00:41]             │ debg navigate to: http://localhost:61151/app/bfetch-explorer
[00:00:42]             │ debg browser[DEBUG] http://localhost:61151/9007199254740991/bundles/plugin/usageCollection/usageCollection.plugin.js 1009:14 "Reporting application usage for dashboardEmbeddableExamples, main"
[00:00:42]             │ debg browser[INFO] http://localhost:61151/app/bfetch-explorer 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:00:42]             │
[00:00:42]             │ debg browser[INFO] http://localhost:61151/bootstrap.js 42:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:00:42]             │ debg ... sleep(700) start
[00:00:43]             │ debg ... sleep(700) end
[00:00:43]             │ debg returned from get, calling refresh
[00:00:43]             │ debg browser[INFO] http://localhost:61151/app/bfetch-explorer 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:00:43]             │
[00:00:43]             │ debg browser[INFO] http://localhost:61151/bootstrap.js 42:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:00:43]             │ debg currentUrl = http://localhost:61151/app/bfetch-explorer
[00:00:43]             │          appUrl = http://localhost:61151/app/bfetch-explorer
[00:00:43]             │ debg TestSubjects.find(kibanaChrome)
[00:00:43]             │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:00:54]             │ debg browser[DEBUG] http://localhost:61151/9007199254740991/bundles/plugin/usageCollection/usageCollection.plugin.js 1009:14 "Reporting user-agent."
[00:00:54]             │ debg ... sleep(501) start
[00:00:55]             │ debg ... sleep(501) end
[00:00:55]             │ debg in navigateTo url = http://localhost:61151/app/bfetch-explorer/count-until
[00:00:55]             │ debg TestSubjects.exists(statusPageContainer)
[00:00:55]             │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="statusPageContainer"]') with timeout=2500
[00:00:57]             │ debg --- retry.tryForTime error: [data-test-subj="statusPageContainer"] is not displayed
[00:00:58]           └-: batchedFunction
[00:00:58]             └-> "before all" hook
[00:00:58]             └-> executes all requests in a batch
[00:00:58]               └-> "before each" hook: global before each
[00:00:58]               └-> "before each" hook
[00:00:58]                 │ debg TestSubjects.click(count-until)
[00:00:58]                 │ debg Find.clickByCssSelector('[data-test-subj="count-until"]') with timeout=10000
[00:00:58]                 │ debg Find.findByCssSelector('[data-test-subj="count-until"]') with timeout=10000
[00:00:58]                 │ debg TestSubjects.click(double-integers)
[00:00:58]                 │ debg Find.clickByCssSelector('[data-test-subj="double-integers"]') with timeout=10000
[00:00:58]                 │ debg Find.findByCssSelector('[data-test-subj="double-integers"]') with timeout=10000
[00:00:58]               │ debg TestSubjects.find(DoubleIntegers)
[00:00:58]               │ debg Find.findByCssSelector('[data-test-subj="DoubleIntegers"]') with timeout=10000
[00:01:02]               │ info Taking screenshot "/dev/shm/workspace/parallel/15/kibana/test/functional/screenshots/failure/bfetch explorer batchedFunction executes all requests in a batch.png"
[00:01:02]               │ info Current URL is: http://localhost:61151/app/bfetch-explorer/double-integers
[00:01:02]               │ info Saving page source to: /dev/shm/workspace/parallel/15/kibana/test/examples/failure_debug/html/bfetch explorer batchedFunction executes all requests in a batch.html
[00:01:02]               └- ✖ fail: bfetch explorer batchedFunction executes all requests in a batch
[00:01:02]               │       Error: expected [ { num: -1, error: { message: 'Invalid number' } },
[00:01:02]               │   { num: 300, result: { num: 600 } },
[00:01:02]               │   { num: 1000, result: { num: 2000 } } ] to sort of equal [ { num: -1, error: { message: 'Invalid number' } },
[00:01:02]               │   { num: 300, result: { num: 600 } },
[00:01:02]               │   { num: 1000, result: { num: 2000 } },
[00:01:02]               │   { num: 2000, result: { num: 4000 } } ]
[00:01:02]               │       + expected - actual
[00:01:02]               │ 
[00:01:02]               │            "result": {
[00:01:02]               │              "num": 2000
[00:01:02]               │            }
[00:01:02]               │          }
[00:01:02]               │       +  {
[00:01:02]               │       +    "num": 2000
[00:01:02]               │       +    "result": {
[00:01:02]               │       +      "num": 4000
[00:01:02]               │       +    }
[00:01:02]               │       +  }
[00:01:02]               │        ]
[00:01:02]               │       
[00:01:02]               │       at Assertion.assert (packages/kbn-expect/expect.js:100:11)
[00:01:02]               │       at Assertion.eql (packages/kbn-expect/expect.js:244:8)
[00:01:02]               │       at Context.<anonymous> (test/examples/bfetch_explorer/batched_function.ts:31:23)
[00:01:02]               │       at processTicksAndRejections (internal/process/task_queues.js:93:5)
[00:01:02]               │       at Object.apply (packages/kbn-test/src/functional_test_runner/lib/mocha/wrap_function.js:73:16)
[00:01:02]               │ 
[00:01:02]               │ 

Stack Trace

Error: expected [ { num: -1, error: { message: 'Invalid number' } },
  { num: 300, result: { num: 600 } },
  { num: 1000, result: { num: 2000 } } ] to sort of equal [ { num: -1, error: { message: 'Invalid number' } },
  { num: 300, result: { num: 600 } },
  { num: 1000, result: { num: 2000 } },
  { num: 2000, result: { num: 4000 } } ]
    at Assertion.assert (packages/kbn-expect/expect.js:100:11)
    at Assertion.eql (packages/kbn-expect/expect.js:244:8)
    at Context.<anonymous> (test/examples/bfetch_explorer/batched_function.ts:31:23)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at Object.apply (packages/kbn-test/src/functional_test_runner/lib/mocha/wrap_function.js:73:16) {
  actual: '[\n' +
    '  {\n' +
    '    "error": {\n' +
    '      "message": "Invalid number"\n' +
    '    }\n' +
    '    "num": -1\n' +
    '  }\n' +
    '  {\n' +
    '    "num": 300\n' +
    '    "result": {\n' +
    '      "num": 600\n' +
    '    }\n' +
    '  }\n' +
    '  {\n' +
    '    "num": 1000\n' +
    '    "result": {\n' +
    '      "num": 2000\n' +
    '    }\n' +
    '  }\n' +
    ']',
  expected: '[\n' +
    '  {\n' +
    '    "error": {\n' +
    '      "message": "Invalid number"\n' +
    '    }\n' +
    '    "num": -1\n' +
    '  }\n' +
    '  {\n' +
    '    "num": 300\n' +
    '    "result": {\n' +
    '      "num": 600\n' +
    '    }\n' +
    '  }\n' +
    '  {\n' +
    '    "num": 1000\n' +
    '    "result": {\n' +
    '      "num": 2000\n' +
    '    }\n' +
    '  }\n' +
    '  {\n' +
    '    "num": 2000\n' +
    '    "result": {\n' +
    '      "num": 4000\n' +
    '    }\n' +
    '  }\n' +
    ']',
  showDiff: true
}

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
ml 1715 1718 +3

Async chunks

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

id before after diff
ml 7.3MB 7.3MB +3.1KB

Page load bundle

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

id before after diff
ml 72.3KB 71.6KB -667.0B

History

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

@peteharverson peteharverson merged commit 4bc5f01 into elastic:master Jan 25, 2021
@peteharverson peteharverson deleted the ml-nav-search-deep-links branch January 25, 2021 16:20
peteharverson added a commit that referenced this pull request Jan 25, 2021
* [ML] Add ML deep links to navigational search

* [ML] Refactor register helper files

* [ML] Edit import in search_deep_links

* [ML] Move register_feature out of register_helper

* [ML] Add comment about registerFeature

Co-authored-by: Kibana Machine <[email protected]>

Co-authored-by: Kibana Machine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[GS] Add Machine Learning deep links to navigational search
5 participants