-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Security AI Assistant] Fixed license issue for Knowledge Base resources initialization #198239
[Security AI Assistant] Fixed license issue for Knowledge Base resources initialization #198239
Conversation
…ces initialization
x-pack/plugins/elastic_assistant/server/ai_assistant_service/index.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/elastic_assistant/server/routes/anonymization_fields/bulk_actions_route.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/elastic_assistant/server/routes/user_conversations/find_route.ts
Show resolved
Hide resolved
x-pack/plugins/elastic_assistant/server/routes/anonymization_fields/find_route.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for this fix Yuliia! I tested locally and not only do we no longer receive the toaster errors, we no longer get our "expected" error log on start up. Hooray! LGTM
Starting backport for target branches: 8.16 https://github.com/elastic/kibana/actions/runs/11601780421 |
…ces initialization (elastic#198239) (cherry picked from commit ed81e43)
💔 Some backports could not be created
Note: Successful backport PRs will be merged automatically after passing CI. Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
💔 All backports failed
Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
I will backport to 8.16 once #198439 has merged |
…ces initialization (elastic#198239) (cherry picked from commit ed81e43) # Conflicts: # x-pack/packages/kbn-elastic-assistant/impl/assistant/chat_send/use_chat_send.tsx # x-pack/packages/kbn-elastic-assistant/impl/knowledge_base/knowledge_base_settings.tsx # x-pack/packages/kbn-elastic-assistant/impl/knowledge_base/knowledge_base_settings_management/index.tsx # x-pack/packages/kbn-elastic-assistant/impl/knowledge_base/setup_knowledge_base_button.tsx # x-pack/plugins/elastic_assistant/server/ai_assistant_service/index.test.ts # x-pack/plugins/elastic_assistant/server/ai_assistant_service/index.ts # x-pack/plugins/elastic_assistant/server/routes/knowledge_base/entries/bulk_actions_route.ts # x-pack/plugins/elastic_assistant/server/routes/knowledge_base/entries/find_route.ts # x-pack/plugins/elastic_assistant/server/routes/request_context_factory.ts
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…ces initialization (elastic#198239) (cherry picked from commit ed81e43)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…resources initialization (#198239) (#198447) # Backport This will backport the following commits from `main` to `8.x`: - [[Security AI Assistant] Fixed license issue for Knowledge Base resources initialization (#198239)](#198239) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Yuliia Naumenko","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-30T21:13:33Z","message":"[Security AI Assistant] Fixed license issue for Knowledge Base resources initialization (#198239)","sha":"ed81e4334f4d5608517dacdba28d46dfea966be0","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","v9.0.0","backport:all-open","v8.16.0"],"title":"[Security AI Assistant] Fixed license issue for Knowledge Base resources initialization","number":198239,"url":"https://github.com/elastic/kibana/pull/198239","mergeCommit":{"message":"[Security AI Assistant] Fixed license issue for Knowledge Base resources initialization (#198239)","sha":"ed81e4334f4d5608517dacdba28d46dfea966be0"}},"sourceBranch":"main","suggestedTargetBranches":["8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/198239","number":198239,"mergeCommit":{"message":"[Security AI Assistant] Fixed license issue for Knowledge Base resources initialization (#198239)","sha":"ed81e4334f4d5608517dacdba28d46dfea966be0"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Yuliia Naumenko <[email protected]>
… resources initialization (#198239) (#198451) # Backport This will backport the following commits from `main` to `8.16`: - [[Security AI Assistant] Fixed license issue for Knowledge Base resources initialization (#198239)](#198239) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Yuliia Naumenko","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-30T21:13:33Z","message":"[Security AI Assistant] Fixed license issue for Knowledge Base resources initialization (#198239)","sha":"ed81e4334f4d5608517dacdba28d46dfea966be0","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","v9.0.0","v8.16.0","backport:version","v8.17.0","v8.15.4"],"number":198239,"url":"https://github.com/elastic/kibana/pull/198239","mergeCommit":{"message":"[Security AI Assistant] Fixed license issue for Knowledge Base resources initialization (#198239)","sha":"ed81e4334f4d5608517dacdba28d46dfea966be0"}},"sourceBranch":"main","suggestedTargetBranches":["8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/198239","number":198239,"mergeCommit":{"message":"[Security AI Assistant] Fixed license issue for Knowledge Base resources initialization (#198239)","sha":"ed81e4334f4d5608517dacdba28d46dfea966be0"}},{"branch":"8.16","label":"v8.16.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.17.0","labelRegex":"^v8.17.0$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/198447","number":198447,"state":"OPEN"},{"branch":"8.15","label":"v8.15.4","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/198449","number":198449,"state":"OPEN"}]}] BACKPORT--> Co-authored-by: Yuliia Naumenko <[email protected]>
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
3 similar comments
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
… resources initialization (#198239) (#198449) # Backport This will backport the following commits from `main` to `8.15`: - [[Security AI Assistant] Fixed license issue for Knowledge Base resources initialization (#198239)](#198239) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Yuliia Naumenko","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-30T21:13:33Z","message":"[Security AI Assistant] Fixed license issue for Knowledge Base resources initialization (#198239)","sha":"ed81e4334f4d5608517dacdba28d46dfea966be0","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","v9.0.0","v8.16.0","backport:version","v8.17.0","v8.15.4"],"number":198239,"url":"https://github.com/elastic/kibana/pull/198239","mergeCommit":{"message":"[Security AI Assistant] Fixed license issue for Knowledge Base resources initialization (#198239)","sha":"ed81e4334f4d5608517dacdba28d46dfea966be0"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.15"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/198239","number":198239,"mergeCommit":{"message":"[Security AI Assistant] Fixed license issue for Knowledge Base resources initialization (#198239)","sha":"ed81e4334f4d5608517dacdba28d46dfea966be0"}},{"branch":"8.16","label":"v8.16.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.17.0","labelRegex":"^v8.17.0$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/198447","number":198447,"state":"OPEN"},{"branch":"8.15","label":"v8.15.4","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> --------- Co-authored-by: Yuliia Naumenko <[email protected]> Co-authored-by: kibanamachine <[email protected]>
This PR didn't make on time to the latest 8.16.0 and 8.15.4 BC. Updating the labels. |
Fixed assistant resources initialization by adding license check before retry to install.
The problem was caused by fetching ELSER model from ML, which was license gated.
Fixed unnecessary client call to get KB status when the license is not min enterprise.
Unified license check and auth for all routes to use
performChecks
performChecks
cleanupMakes changes around the
performChecks
function. Everywhere this was called was passingauthenticatedUser: true
andlicense: true
, so we removed those parameters and updated the code so that those checks always happen. Previously,performChecks
either returned an error response or undefined. We updated it to return either:That way when the check passes, it always returns our
AuthenticatedUser
and eliminates the need to re-run that check.Finally, we found any spot that was checking license + user on its own to use the
performChecks
function.