-
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] Transforms: Fixes missing number of transform nodes and error reporting in stats bar. #93956
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.
Unblocking Core's CODEOWNERS review
}); | ||
|
||
let count = 0; | ||
if (typeof body.nodes === 'object') { |
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.
Would this ever be null
?
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.
Ah yes, I copied that over from older ML code. Updated in bc3e236.
Update in bc3e236:
|
isPopulatedObject(node) && | ||
{}.hasOwnProperty.call(node, 'attributes') && | ||
isPopulatedObject(node.attributes) && | ||
{}.hasOwnProperty.call(node.attributes, 'transform.node') |
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.
i think this check is too strict, transform.node
may be missing entirely from one of the nodes, in which case the whole check will fail and count will be returned as 0
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.
Good catch and thinking about multiple nodes! I fixed the type guard and added a unit test in cf49a77.
@elasticmachine merge upstream |
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 and LGTM
@elasticmachine merge upstream |
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
The tests caught something I missed: The code was based on the legacy format to identify transform nodes via |
💚 Build Succeeded
Metrics [docs]Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: cc @walterra |
…porting in stats bar. (elastic#93956) - Adds a Kibana API endpoint transforms/_nodes - Adds number of nodes to the stats bar in the transforms list. - Shows a callout when no transform nodes are available. - Disable all actions except delete when no transform nodes are available. - Disables the create button when no transform nodes are available.
…porting in stats bar. (#93956) (#94677) - Adds a Kibana API endpoint transforms/_nodes - Adds number of nodes to the stats bar in the transforms list. - Shows a callout when no transform nodes are available. - Disable all actions except delete when no transform nodes are available. - Disables the create button when no transform nodes are available.
…porting in stats bar. (elastic#93956) - Adds a Kibana API endpoint transforms/_nodes - Adds number of nodes to the stats bar in the transforms list. - Shows a callout when no transform nodes are available. - Disable all actions except delete when no transform nodes are available. - Disables the create button when no transform nodes are available. # Conflicts: # x-pack/plugins/transform/common/api_schemas/type_guards.ts
…rror reporting in stats bar. (#93956) (#95754) - Adds a Kibana API endpoint transforms/_nodes - Adds number of nodes to the stats bar in the transforms list. - Shows a callout when no transform nodes are available. - Disable all actions except delete when no transform nodes are available. - Disables the create button when no transform nodes are available.
Summary
Fixes #92227
transforms/_nodes
To test this, add the following to
elasticsearch.yml
of your single node cluster (that's the default node roles taken from here and the transform role commented out):Checklist
For maintainers