-
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] Moving to kibana capabilities #64057
[ML] Moving to kibana capabilities #64057
Conversation
Pinging @elastic/uptime (Team:uptime) |
0b350cd
to
1af4ac8
Compare
Pinging @elastic/ml-ui (:ml) |
}, | ||
}); | ||
return resp.has_all_requested; | ||
return mlCapabilities.canCreateJob; |
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 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.
This should be fixed in a follow PR as it's not a trivial change.
At the point we initialise the sample datasets, we do not have the complete capabilities from kibana.
so the dataset initialisation will need to move, possibly to the plugin start function
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.
Thinking about this some more, i'm not sure this is possible.
This sample dataset links are initialised once per kibana server setup. They are not based on request and so cannot be toggled based on user credentials.
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.
Agreed, this doesn't currently seem possible with the way the sample data set links work. I've added it as an extra item to #64172 so we can follow up the extra changes that are required to the home
and ml
plugins.
// Filters | ||
canGetFilters: false, | ||
// Data Frame Analytics | ||
canGetDataFrameAnalytics: false, |
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 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.
This is a bug in master. I think it is outside the scope of this PR to fix here.
I've raised #64235 to cover it.
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.
Code 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 latest edits with capabilities and switched and LGTM.
retest |
23bbbe3
to
fcd830d
Compare
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.
Reviewed the capabilities switcher, and did some light testing locally. From my perspective, this looks good!
|
||
return capabilities; | ||
} catch (e) { | ||
logger.debug('Error updating capabilities for ML based on licensing'); |
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.
optional nit: you may want to include the exception in the log message so that failures are easier to diagnose:
logger.debug('Error updating capabilities for ML based on licensing'); | |
logger.debug(`Error updating capabilities for ML based on licensing: ${e}`); |
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.
Fixed in 0eaa2a1
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
* [ML] Moving to kibana capabilities * fixing types * renaming privilges * renaming privileges to capabilities * renaming resolvers * correcting admin capabilities * fixing includes * removing any types * renaming type * readding spaces * adding capabilities switcher * updating comment * removing unnecessary failing tests * adding error to log
* [ML] Moving to kibana capabilities * fixing types * renaming privilges * renaming privileges to capabilities * renaming resolvers * correcting admin capabilities * fixing includes * removing any types * renaming type * readding spaces * adding capabilities switcher * updating comment * removing unnecessary failing tests * adding error to log
…bana into ingest-node-pipeline/open-flyout-create-edit * 'feature/ingest-node-pipelines' of github.com:elastic/kibana: (116 commits) [Ingest Node Pipelines] More lenient treatment of on-failure value (elastic#64411) Report Deletion via UI- functional test (elastic#64031) Bump handlebars dependency from 4.5.3 to 4.7.6 (elastic#64402) [Uptime] Update TLS settings (elastic#64111) [alerting] removes usage of any throughout Alerting Services code (elastic#64161) [CANVAS] Moves notify to a canvas service (elastic#63268) [Canvas] Misc NP Stuff (elastic#63703) update apm index pattern (elastic#64232) Task/hostlist pagination (elastic#63722) [NP] Vega migration (elastic#63849) Move ensureDefaultIndexPattern into data plugin (elastic#63100) [Fleet] Fix agent status count to not include unenrolled agents (elastic#64106) Migrate graph_workspace saved object registration to Kibana platform (elastic#64157) Index pattern management UI -> TypeScript and New Platform Ready (edit_index_pattern) (elastic#64184) [ML] EuiDataGrid ml/transform components. (elastic#63447) [ML] Moving to kibana capabilities (elastic#64057) Move input_control_vis into NP (elastic#63333) remove reference to local application service in graph (elastic#64288) KQL removes leading zero and breaks query (elastic#62748) [FieldFormats] Cleanup: rename IFieldFormatType -> FieldFormatInstanceType (elastic#64193) ...
Changes the way the
ml_capabilities
are populated. Rather than being based on es privileges, they are now based on kibana's capabilities.A licence level filter is applied using a capabilities switcher. This means for the most part, the standard kibana capabilities are correct and can be used by other plugins.
The only difference between the standard kibana capabilities and our
ml_capabilities
endpoint is the later also performs an upgrade mode check and will disable all admin capabilities if an upgrade is in progress.Also renames all uses of "privileges" to "capabilities" in identifiers and file names as they are no longer based on es privileges.
Checklist
Delete any items that are not applicable to this PR.
Unit or functional tests were updated or added to match the most common scenarios
This was checked for breaking API changes and was labeled appropriately