[ML] Fixing capabilities when ML is disabled in elasticsearch#143622
Merged
jgowdyelastic merged 11 commits intoelastic:mainfrom Dec 13, 2022
Merged
[ML] Fixing capabilities when ML is disabled in elasticsearch#143622jgowdyelastic merged 11 commits intoelastic:mainfrom
jgowdyelastic merged 11 commits intoelastic:mainfrom
Conversation
Contributor
|
Pinging @elastic/ml-ui (:ml) |
TattdCodeMonkey
approved these changes
Dec 12, 2022
Contributor
TattdCodeMonkey
left a comment
There was a problem hiding this comment.
enterprise-search changes LGTM.
jgowdyelastic
commented
Dec 12, 2022
| const { hasPlatinumLicense } = useValues(LicensingLogic); | ||
| const hasMLPermissions = capabilities?.ml?.canAccessML ?? false; | ||
|
|
||
| if (!hasMLPermissions || !hasPlatinumLicense) { |
Member
Author
There was a problem hiding this comment.
there is no need to test for the license level as this has already been done when setting the canGetTrainedModels capability.
💚 Build Succeeded
Metrics [docs]Async chunks
Page load bundle
Unknown metric groupsESLint disabled in files
ESLint disabled line counts
References to deprecated APIs
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves the initialisation of ML saved objects and the auto sync task to after a license check has been performed. If ML is not enabled or the license is not platinum or trial we do not initialise the saved objects or create the auto sync task.
Updates the license checks to react to license changes. If the license changes from full (platinum or trial) to something else (e.g. basic) we disable the auto sync tasks.
If the license changes from non-full to full we initialise the saved objects and start the task.
Removes the
canAccessMlcapability in favour of explicit capabilities checks.canAccessMlwas badly named and as a result was being misused by a few plugins, thinking it was the correct capability to check to see if ML is available, when really it was the very minimum check to cover our basic licensed features.