-
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] Renaming ML API service #191742
[ML] Renaming ML API service #191742
Conversation
/ci |
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.
LGTM, great to have that consistency now! Just added a comment with a question on some special initialization.
@@ -25,7 +25,7 @@ export function useMlNodeAvailableCheck() { | |||
|
|||
export function useMlNodeCheck() { | |||
const { http } = useKibana().services; | |||
const ml = useMemo(() => mlApiServicesProvider(new HttpService(http!)), [http]); | |||
const mlApi = useMemo(() => mlApiProvider(new HttpService(http!)), [http]); |
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.
Is there a reason for this specific code or could this be const mlApi = useMlApi()
?
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.
Yes, this is intentional, this component is shared out from the ML plugin and used in other plugins to warn about ML node availability.
We don't wrap it in a our various contexts and only require that the consuming plugin has http
in their kibana context.
@@ -74,12 +74,12 @@ const defaultCloudInfo: CloudInfo = { | |||
|
|||
export function useCloudCheck() { | |||
const { http } = useKibana().services; | |||
const ml = useMemo(() => mlApiServicesProvider(new HttpService(http!)), [http]); | |||
const mlApi = useMemo(() => mlApiProvider(new HttpService(http!)), [http]); |
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.
Is there a reason for this specific code or could this be const mlApi = useMlApi()
?
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 (also gave each page a quick visual test)
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
Addresses the comment from the description of this PR:
We have a bit of a mix of naming: ml, mlApiServices, useMlApiContext() for the same thing
Renames:
useMlApiContext
->useMlApi
ml
->mlApi
mlApiServices
->mlApi
MlApiServices
->MlApi
E.g. we can now use
const mlApi = useMlApi();
Rather than:
const ml = useMlApiContext();
or
const mlServices = useMlApiContext();
or