-
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
Remove MLs use of internal Spaces utilities #46366
Conversation
@@ -66,6 +69,41 @@ export class SpacesService { | |||
return spaceId; | |||
}; | |||
|
|||
const getScopedClient = async (request: RequestFacade) => { |
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.
No functional changes; just moved from its original location below so it could be reused by getActiveSpace
Pinging @elastic/ml-ui |
Pinging @elastic/kibana-security |
💚 Build Succeeded |
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.
ML changes 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.
There are a few dangling references to lib/get_active_space
, were you postponing removing those for a subsequent PR?
x-pack/legacy/plugins/spaces/server/new_platform/spaces_service/spaces_service.test.ts
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/spaces/server/new_platform/spaces_service/spaces_service.test.ts
Outdated
Show resolved
Hide resolved
Co-Authored-By: Brandon Kobel <brandon.kobel@gmail.com>
Yes, this was only meant to address ML's usage. Subsequent cleanup is already taking place in #46181, but I didn't want to include ML changes in that PR. |
💚 Build Succeeded |
* remove MLs use of internal Spaces utilities * move logic to SpacesService for testability * make TS happy * Apply suggestions from code review Co-Authored-By: Brandon Kobel <brandon.kobel@gmail.com>
Summary
While migrating the Spaces server-side plugin to the new platform, I noticed that ML is importing the private
getActiveSpace
utility in order to retrieve the user's active space.This PR introduces a first-class way for plugins to retrieve this information in the legacy platform, so that I can continue with migration and cleanup of the spaces plugin.