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

[Enterprise Search] Disallow creating pipeline with placeholder of model #172988

Merged
merged 5 commits into from
Dec 12, 2023

Conversation

demjened
Copy link
Contributor

@demjened demjened commented Dec 8, 2023

Summary

This PR adds validation to model selection when creating an inference pipeline. Pipelines cannot be created with a non-deployed placeholder of a model (e.g. E5, ELSER) as this would break other Search UIs and functionality. If such an item is selected, an error message is displayed and the Continue button is disabled.

Note this feature is independent of the changing of the model selection component.

Valid selection:
Screenshot 2023-12-08 at 14 03 59

Invalid selection:
Screenshot 2023-12-08 at 14 04 04

Checklist

@demjened demjened changed the title Demjened/require downloaded model [Enterprise Search] Disallow creating pipeline with placeholder of model Dec 8, 2023
@demjened demjened added release_note:skip Skip the PR/issue when compiling release notes Team:EnterpriseSearch v8.12.0 v8.13.0 labels Dec 8, 2023
@demjened demjened marked this pull request as ready for review December 8, 2023 19:22
@demjened demjened requested a review from a team December 8, 2023 19:22
});

expect(MLInferenceLogic.values.formErrors).toEqual({
modelStatus: 'Model must be deployed before use.',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this sufficient or should we also have a call to action here? (E.g. "Use the Deploy button to deploy the model.")
cc @1Copenut

Copy link
Contributor

Choose a reason for hiding this comment

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

@demjened This seems like a good messge. It clearly explains the reason the selected model couldn't be used yet. I'll live test it too, one second.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@1Copenut Are you OK going with the current message then?

Copy link
Member

@kderusso kderusso left a comment

Choose a reason for hiding this comment

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

LGTM but will allow someone more familiar with frontend best practices to review the style differences.

@demjened
Copy link
Contributor Author

demjened commented Dec 8, 2023

@elasticmachine merge upstream

@demjened demjened force-pushed the demjened/require-downloaded-model branch from 0382556 to b18b521 Compare December 8, 2023 21:23
it('sets placeholder flag on selecting a placeholder item', () => {
setMockValues(DEFAULT_VALUES);

const wrapper = shallow(<ModelSelect />);
Copy link
Contributor

Choose a reason for hiding this comment

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

We are moving from enzyme to react-testing-library. Is it possible to convert these tests to ones compitible with react-testing-library?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@saikatsarkar056 Thanks for the heads up, I just learned about this.
Since this is a critical usability fix that must go into 8.12, are you OK getting this PR merged as-is and deferring the rewriting of tests (possibly with a larger scope) to a tech debt ticket?

@demjened
Copy link
Contributor Author

@elasticmachine merge upstream

@demjened
Copy link
Contributor Author

/ci

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

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
enterpriseSearch 2.7MB 2.7MB +633.0B

History

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

@saikatsarkar056 saikatsarkar056 self-requested a review December 12, 2023 02:23
@demjened demjened merged commit 156c8f2 into main Dec 12, 2023
36 checks passed
@demjened demjened deleted the demjened/require-downloaded-model branch December 12, 2023 17:42
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Dec 12, 2023
…del (elastic#172988)

## Summary

This PR adds validation to model selection when creating an inference
pipeline. Pipelines cannot be created with a non-deployed placeholder of
a model (e.g. E5, ELSER) as this would break other Search UIs and
functionality. If such an item is selected, an error message is
displayed and the Continue button is disabled.

Note this feature is independent of the changing of the model selection
component.

Valid selection:
<img width="919" alt="Screenshot 2023-12-08 at 14 03 59"
src="https://github.com/elastic/kibana/assets/14224983/26f8be24-3f78-4765-9a4c-771adbb221a4">

Invalid selection:
<img width="921" alt="Screenshot 2023-12-08 at 14 04 04"
src="https://github.com/elastic/kibana/assets/14224983/a157fb69-c004-49b2-93c7-13b58e82074c">

### Checklist
- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))

---------

Co-authored-by: Kibana Machine <[email protected]>
(cherry picked from commit 156c8f2)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.12

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Dec 12, 2023
…r of model (#172988) (#173188)

# Backport

This will backport the following commits from `main` to `8.12`:
- [[Enterprise Search] Disallow creating pipeline with placeholder of
model (#172988)](#172988)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Adam
Demjen","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-12-12T17:42:16Z","message":"[Enterprise
Search] Disallow creating pipeline with placeholder of model
(#172988)\n\n## Summary\r\n\r\nThis PR adds validation to model
selection when creating an inference\r\npipeline. Pipelines cannot be
created with a non-deployed placeholder of\r\na model (e.g. E5, ELSER)
as this would break other Search UIs and\r\nfunctionality. If such an
item is selected, an error message is\r\ndisplayed and the Continue
button is disabled.\r\n\r\nNote this feature is independent of the
changing of the model selection\r\ncomponent.\r\n\r\nValid
selection:\r\n<img width=\"919\" alt=\"Screenshot 2023-12-08 at 14 03
59\"\r\nsrc=\"https://github.com/elastic/kibana/assets/14224983/26f8be24-3f78-4765-9a4c-771adbb221a4\">\r\n\r\nInvalid
selection:\r\n<img width=\"921\" alt=\"Screenshot 2023-12-08 at 14 04
04\"\r\nsrc=\"https://github.com/elastic/kibana/assets/14224983/a157fb69-c004-49b2-93c7-13b58e82074c\">\r\n\r\n###
Checklist\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] Any UI
touched in this PR is usable by keyboard only (learn more\r\nabout
[keyboard accessibility](https://webaim.org/techniques/keyboard/))\r\n-
[x] Any UI touched in this PR does not create any new axe
failures\r\n(run axe in
browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))\r\n-
[x] This renders correctly on smaller devices using a
responsive\r\nlayout. (You can test this [in
your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))\r\n\r\n---------\r\n\r\nCo-authored-by:
Kibana Machine
<[email protected]>","sha":"156c8f2323a65153397bbddd308bfd23901d50ba","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:EnterpriseSearch","v8.12.0","v8.13.0"],"number":172988,"url":"https://github.com/elastic/kibana/pull/172988","mergeCommit":{"message":"[Enterprise
Search] Disallow creating pipeline with placeholder of model
(#172988)\n\n## Summary\r\n\r\nThis PR adds validation to model
selection when creating an inference\r\npipeline. Pipelines cannot be
created with a non-deployed placeholder of\r\na model (e.g. E5, ELSER)
as this would break other Search UIs and\r\nfunctionality. If such an
item is selected, an error message is\r\ndisplayed and the Continue
button is disabled.\r\n\r\nNote this feature is independent of the
changing of the model selection\r\ncomponent.\r\n\r\nValid
selection:\r\n<img width=\"919\" alt=\"Screenshot 2023-12-08 at 14 03
59\"\r\nsrc=\"https://github.com/elastic/kibana/assets/14224983/26f8be24-3f78-4765-9a4c-771adbb221a4\">\r\n\r\nInvalid
selection:\r\n<img width=\"921\" alt=\"Screenshot 2023-12-08 at 14 04
04\"\r\nsrc=\"https://github.com/elastic/kibana/assets/14224983/a157fb69-c004-49b2-93c7-13b58e82074c\">\r\n\r\n###
Checklist\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] Any UI
touched in this PR is usable by keyboard only (learn more\r\nabout
[keyboard accessibility](https://webaim.org/techniques/keyboard/))\r\n-
[x] Any UI touched in this PR does not create any new axe
failures\r\n(run axe in
browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))\r\n-
[x] This renders correctly on smaller devices using a
responsive\r\nlayout. (You can test this [in
your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))\r\n\r\n---------\r\n\r\nCo-authored-by:
Kibana Machine
<[email protected]>","sha":"156c8f2323a65153397bbddd308bfd23901d50ba"}},"sourceBranch":"main","suggestedTargetBranches":["8.12"],"targetPullRequestStates":[{"branch":"8.12","label":"v8.12.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.13.0","labelRegex":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/172988","number":172988,"mergeCommit":{"message":"[Enterprise
Search] Disallow creating pipeline with placeholder of model
(#172988)\n\n## Summary\r\n\r\nThis PR adds validation to model
selection when creating an inference\r\npipeline. Pipelines cannot be
created with a non-deployed placeholder of\r\na model (e.g. E5, ELSER)
as this would break other Search UIs and\r\nfunctionality. If such an
item is selected, an error message is\r\ndisplayed and the Continue
button is disabled.\r\n\r\nNote this feature is independent of the
changing of the model selection\r\ncomponent.\r\n\r\nValid
selection:\r\n<img width=\"919\" alt=\"Screenshot 2023-12-08 at 14 03
59\"\r\nsrc=\"https://github.com/elastic/kibana/assets/14224983/26f8be24-3f78-4765-9a4c-771adbb221a4\">\r\n\r\nInvalid
selection:\r\n<img width=\"921\" alt=\"Screenshot 2023-12-08 at 14 04
04\"\r\nsrc=\"https://github.com/elastic/kibana/assets/14224983/a157fb69-c004-49b2-93c7-13b58e82074c\">\r\n\r\n###
Checklist\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] Any UI
touched in this PR is usable by keyboard only (learn more\r\nabout
[keyboard accessibility](https://webaim.org/techniques/keyboard/))\r\n-
[x] Any UI touched in this PR does not create any new axe
failures\r\n(run axe in
browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))\r\n-
[x] This renders correctly on smaller devices using a
responsive\r\nlayout. (You can test this [in
your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))\r\n\r\n---------\r\n\r\nCo-authored-by:
Kibana Machine
<[email protected]>","sha":"156c8f2323a65153397bbddd308bfd23901d50ba"}}]}]
BACKPORT-->

Co-authored-by: Adam Demjen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:EnterpriseSearch v8.12.0 v8.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants