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: Move ML "Data Frame Transforms" to Kibana management section "Transforms". #45880

Merged
merged 55 commits into from
Oct 9, 2019

Conversation

walterra
Copy link
Contributor

@walterra walterra commented Sep 17, 2019

Summary

Part of #45352.

Moves "Data frame transforms" from the ML plugin to its own "transform" plugin within the Kibana management section.

image

Review hints:

  • The new plugins lives in x-pack/legacy/plugins/transform.
  • The overall wrapping code of the plugin is based on the snapshot/restore-plugin. This includes the plugin setup, shims, react-router, cluster priviliges checks, breadcrumbs.
  • snapshot/restores cluster privileges checks have been extended with the capabilities approach (e.g. canCreateTransform) used in ML. The cluster privileges checks are used to check general access to sections (like TransformManagement or CreateTransform). The capabilities are used to enable/disable actions within sections (e.g. Create transform button on transform list page).
  • References to data frame/data_frame/dataFrame etc. have been removed or renamed to transform*.
  • Data frame transform related menu items have been removed from the ML plugin.
  • Some code pieces like required utilities or previously shared components have been copied from ML code (e.g. StatsBar, JobIcon).
  • pages from the ML plugin have been renamed to sections.
  • UI Metric constants are defined for client based telemetry based on the snapshot/restore plugin, but the actual tracking will be implemented in a follow up.
  • DocumentationLinksService and DocTitleService have been brought over from snapshot/restore but are not in use yet.
  • There's now httpService brought over from snapshot/restore which is used for license and privileges checks based on snapshot/restore code. However, there's also http_service.ts brought over from ML to handle the transform API. This should be unified/cleaned-up in a follow up.
  • x-pack/legacy/plugins/transform/public/shared_imports.ts is used to reference cross-plugin imports (some brought over as is from snapshot/restore, some from ML plugin)

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elastic elastic deleted a comment from elasticmachine Sep 30, 2019
Copy link
Contributor

@alisonelizabeth alisonelizabeth left a comment

Choose a reason for hiding this comment

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

nice work @walterra!

I took a quick look through the code and overall LGTM. I mainly reviewed the UX and noted some things that I think could be changed to better align with our other ES management apps. (Suggestions only.)

Transforms table view

  • Keep all app content within EuiPageContent.

  • Create/reload buttons we generally keep to the right of the search bar

  • Nice to have: link to the transform documentation

  • Table bulk actions we generally use EuiContextMenu
    Example:
    Screen Shot 2019-10-08 at 2 55 46 PM

  • Row actions we generally only render an icon with tooltip
    Example:
    Screen Shot 2019-10-08 at 2 54 25 PM

  • For the stats bar, consider using EuiPanel and EuiStat components.

    Some similar examples in our existing apps:

    Screen Shot 2019-10-08 at 8 48 23 AM Screen Shot 2019-10-02 at 2 18 43 PM
  • The icon to expand rows is generally within the Actions column. This seems to be the case within the EUI table documentation example as well.

Transforms empty prompt

  • I think you could probably remove the horizontal rule at the top and change the link to a button.

    Example:
    Screen Shot 2019-10-08 at 1 54 08 PM

Create transforms wizard

  • I think it might make sense to put the content within EuiPageContent as well. At first, I thought some fields were disabled due to the gray background.

    download

  • We've tended to use horizontal steps (rather than vertical) in our wizards. Not sure it makes sense to change here, but just wanted to note.

  • It seemed a little strange to me that we don't redirect back to the list view after creating a new transform. Is there a reason for that?

    Screen Shot 2019-10-08 at 1 52 23 PM
  • I ran into this error scenario. Do you think it might make more sense to render a callout on the page and maintain the wizard contents?

    Screen Shot 2019-10-08 at 1 48 48 PM

    Example:
    Screen Shot 2019-10-08 at 2 52 17 PM


Errors while testing

I noticed this error when starting kibana:

MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 21 change listeners added. Use emitter.setMaxListeners() to increase limit

It looks like the same error mentioned here: #46448 (comment)

I also noticed this warning in the browser console when entering the transform wizard:

Warning: State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect().

!capabilities.canStartStopTransform;

const createTransformButton = (
<>
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: i don't think you need to use fragments here

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 1b34e00.

return `${this.esPluginDocBasePath}${TRANSFORM_DOC_PATHS.plugins}`;
}

public getSnapshotDocUrl() {
Copy link
Contributor

Choose a reason for hiding this comment

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

i don't think this is being used - copy/paste mistake?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right of course! Fixed in 1b34e00.

@walterra
Copy link
Contributor Author

walterra commented Oct 9, 2019

@peteharverson I fixed the width of the JSON tab in expanded rows for both the transform plugin and the data frame analytics jobs list in be3a66c. I'll look into updating the layout in a follow up together with the feedback from Elasticsearch UI team.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💔 Build Failed

@walterra
Copy link
Contributor Author

walterra commented Oct 9, 2019

@alisonelizabeth I checked with the platform team and pushed a fix for the MaxListenersExceededWarning you were seeing in 2f6848a.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@walterra
Copy link
Contributor Author

walterra commented Oct 9, 2019

@alisonelizabeth I was able to fix the React hooks related error you were seeing in 89d3398 - the root cause was that I passed on a hook's set function as a callback to another component which was called with two arguments, thanks for pointing it out!

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.

Tested latest edits and LGTM

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@walterra walterra merged commit bcf9ec3 into elastic:master Oct 9, 2019
@walterra walterra deleted the transform-plugin branch October 9, 2019 18:13
walterra added a commit to walterra/kibana that referenced this pull request Oct 9, 2019
…ion "Transforms". (elastic#45880)

Moves "Data frame transforms" from the ML plugin to its own "transform" plugin within the Kibana management section.
walterra added a commit that referenced this pull request Oct 9, 2019
…ion "Transforms". (#45880) (#47745)

Moves "Data frame transforms" from the ML plugin to its own "transform" plugin within the Kibana management section.
@walterra walterra changed the title [transform] Move ML "Data Frame Transforms" to Kibana management section "Transforms". [ML] Transforms: Move ML "Data Frame Transforms" to Kibana management section "Transforms". Oct 22, 2019
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants