Skip to content
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: Adds reset action to transforms management. #123735

Merged
merged 11 commits into from
Feb 1, 2022

Conversation

walterra
Copy link
Contributor

@walterra walterra commented Jan 25, 2022

Summary

Fixes #118405.

Adds reset action to transforms management. Supports bulk resetting multiple transforms.

transform-reset-0002

Checklist

@walterra walterra mentioned this pull request Jan 26, 2022
13 tasks
@walterra walterra marked this pull request as ready for review January 26, 2022 13:40
@walterra walterra requested a review from a team as a code owner January 26, 2022 13:40
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

if (results.hasOwnProperty(transformId)) {
const status = results[transformId];

// if we are only deleting one transform, show the success toast messages
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super duper nit: think the deleting in the comment here and below meant to be resetting

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 044b4da.

): arg is ResetTransformsResponseSchema => {
return (
isPopulatedObject(arg) &&
Object.values(arg).every((d) => isPopulatedObject(d, ['transformReset']))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will there ever be a case a response has a mix of transformReset and something else? Can we use .some here? Just curious not a suggestion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current APIs we have don't allow these combinations at the moment. Depending on the endpoint, this attribute is hard coded for example like transformDeleted or transformReset.

@qn895
Copy link
Member

qn895 commented Jan 26, 2022

Tested (normal and managed transforms) and functionally LGTM 🎉 . Just had a nit comment.

const bulkResetButtonDisabledText = i18n.translate(
'xpack.transform.transformList.resetBulkActionDisabledToolTipContent',
{
defaultMessage: 'One or more selected transforms must be stopped in order to be reseted.',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo reseted. Maybe One or more selected transforms must be stopped in order to be reset ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can make it a bit shorter and it might also sound better.

Suggested change
defaultMessage: 'One or more selected transforms must be stopped in order to be reseted.',
defaultMessage: 'One or more selected transforms must be stopped to be reset.',

disabled,
isBulkAction,
}) => {
const bulkResetButtonDisabledText = i18n.translate(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For a running transform, these bulk action items aren't being disabled correctly. Here, I think only the Stop action should actually be enabled:

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, I will look into this in a follow up since it's not only affecting the new reset functionality.

const bulkResetButtonDisabledText = i18n.translate(
'xpack.transform.transformList.resetBulkActionDisabledToolTipContent',
{
defaultMessage: 'One or more selected transforms must be stopped in order to be reseted.',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
defaultMessage: 'One or more selected transforms must be stopped in order to be reseted.',
defaultMessage: 'Stop one or more selected transforms to reset them.',

Copy link
Contributor Author

@walterra walterra Jan 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed as part of ab14042.

@walterra
Copy link
Contributor Author

walterra commented Feb 1, 2022

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

expected head sha didn’t match current head ref.

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Test Failures

  • [job] [logs] Default CI Group #10 / Uptime app with generated data certificates with certs page "before each" hook for "displays specific certificates"

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
transform 293 298 +5

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
transform 365.8KB 371.2KB +5.4KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @walterra

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latest code changes LGTM

@walterra walterra merged commit fd82fea into elastic:main Feb 1, 2022
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Feb 1, 2022
@walterra walterra deleted the ml-transform-reset branch February 1, 2022 11:44
@peteharverson peteharverson added release_note:feature Makes this part of the condensed release notes and removed release_note:enhancement labels Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Transforms ML transforms :ml release_note:feature Makes this part of the condensed release notes v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ML] Transforms: Add reset action
7 participants