-
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
[ML] Fixing capabilities when ML is disabled in elasticsearch #143622
[ML] Fixing capabilities when ML is disabled in elasticsearch #143622
Conversation
Pinging @elastic/ml-ui (:ml) |
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.
enterprise-search changes LGTM.
const { hasPlatinumLicense } = useValues(LicensingLogic); | ||
const hasMLPermissions = capabilities?.ml?.canAccessML ?? false; | ||
|
||
if (!hasMLPermissions || !hasPlatinumLicense) { |
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.
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: |
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.
LGTM
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.
Tested and LGTM
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
canAccessMl
capability in favour of explicit capabilities checks.canAccessMl
was 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.