-
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] Moving file data vizualizer to its own plugin #96408
[ML] Moving file data vizualizer to its own plugin #96408
Conversation
@elasticmachine merge upstream |
@elasticmachine merge upstream |
retest |
@elasticmachine merge upstream |
…f github.com:jgowdyelastic/kibana into moving-file-data-visualizer-UI-to-file-upload-plugin
@elasticmachine merge upstream |
⏳ Build in-progress, with failures
Failed CI StepsHistory
To update your PR or re-run it, just comment with: |
@elasticmachine merge upstream |
⏳ Build in-progress, with failures
Failed CI StepsHistory
To update your PR or re-run it, just comment with: |
⏳ Build in-progress, with failures
Failed CI StepsHistory
To update your PR or re-run it, just comment with: |
Code 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.
Tested and LGTM.
Would be good to get the boolean type preview chart showing up in the collapsed row, but happy for that to be done in a separate PR.
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 lot of duplicated components between file data visualizer and index pattern visualizer. Should fileDataVisualizer expose these components so they can then be used in ML for the index pattern visualizer? Or would it make sense to move index pattern visualizer into this plugin as well?
@@ -10,7 +10,7 @@ import React, { FC } from 'react'; | |||
|
|||
import { EuiTitle, EuiSpacer } from '@elastic/eui'; | |||
|
|||
import { MLJobEditor, ML_EDITOR_MODE } from '../../../../jobs/jobs_list/components/ml_job_editor'; | |||
import { MLJobEditor, ML_EDITOR_MODE } from '../ml_job_editor'; |
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.
Should these loose the ML prefix?
|
||
import { i18n } from '@kbn/i18n'; | ||
|
||
import { getMLJobTypeAriaLabel } from '../../util/field_types_utils'; |
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.
Should getMLJobTypeAriaLabel lose the ML prefix?
this.maxFileUploadBytes = getFileUpload().getMaxBytes(); | ||
|
||
this.savedObjectsClient = props.savedObjectsClient; | ||
this.maxFileUploadBytes = this.props.fileUpload.getMaxBytes(); |
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.
Nit: use 'props' instead of 'this.props' to be consistent with line above
@@ -0,0 +1,8 @@ | |||
.mlEmbeddedMapContent { |
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.
Should ml prefix be removed?
} from '../../../../../../../src/plugins/embeddable/public'; | ||
import { useFileDataVisualizerKibana } from '../../kibana_context'; | ||
|
||
export function MlEmbeddedMapComponent({ |
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.
Should this just be called EmbeddedMapComponent?
statusCode: number; | ||
error: string; | ||
message: string; | ||
attributes?: any; |
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.
How about replacing any with a type definition?
): Promise<boolean> { | ||
const body = JSON.stringify({ index }); | ||
const fileUploadModules = await lazyLoadModules(); | ||
return await fileUploadModules.getHttp().fetch<any>({ |
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.
How about replacing any with a type definition for check upload resposne?
}); | ||
} | ||
|
||
export async function getTimeFieldRange(index: string, query: any, timeFieldName?: string) { |
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.
Can query be unknown instead of any?
client: IScopedClusterClient, | ||
index: string[] | string, | ||
timeFieldName: string, | ||
query: any |
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.
Can query be unknown instead of any?
* 2.0. | ||
*/ | ||
import { IScopedClusterClient } from 'kibana/server'; | ||
export async function getTimeFieldRange( |
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 getTimeFieldRange endpoint even needed? Why not just use already exposed ES search endpoint and have a client function that contains this logic?
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 i agree, the original ML version of this function takes more arguments and so I think justifies having it's own endpoint. i've stripped most of these out for the file_upload version as they're not needed.
I'll move this search to the client side in a follow up PR.
Seeing as this new plugin is decoupled from the file upload process, it might make sense to move the index data visualizer in here too. |
@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.
Thanks for moving file data visualizer into its own plugin. This is a great first step to integrating in other Kibana plugins.
LGTM
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Page load bundle
Unknown metric groupsAPI count
API count missing comments
API count with any type
async chunk count
History
To update your PR or re-run it, just comment with: |
* [ML] Moving file data vizualizer to file upload plugin * removing maps plug dependency * fixing imports * small refactor * adding missing endpoints * fixing translations * fxing table controls * fixing types and disabling geo point test * actually disabling geo point test * making endpoints internal * moving UI code to separate plugin * enabling maps integration * cleaning up dependencies * fixing translation ids * moving analyze file endpoint out of file upload plugin * fixing transtations issues * refactor for lazy loading of component * updating limits * updating plugin asciidoc * code clean up * further clean up * adding comment * fixing really obvious CI error * removing commented out include * reenabling geo point test * fixing incorrectly changed import * removing ml from labels and identifiers * renaming function * moving analyse file endpoint to file upload plugin * reverting import path changes * adding esUiShared back in * fixing navigation tabs alignment in basic license * adding key to tab wrapper * reverting test label * further removal of ml references * removing ml label from more identifiers * fixing tests Co-authored-by: Kibana Machine <[email protected]>
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
* [ML] Moving file data vizualizer to file upload plugin * removing maps plug dependency * fixing imports * small refactor * adding missing endpoints * fixing translations * fxing table controls * fixing types and disabling geo point test * actually disabling geo point test * making endpoints internal * moving UI code to separate plugin * enabling maps integration * cleaning up dependencies * fixing translation ids * moving analyze file endpoint out of file upload plugin * fixing transtations issues * refactor for lazy loading of component * updating limits * updating plugin asciidoc * code clean up * further clean up * adding comment * fixing really obvious CI error * removing commented out include * reenabling geo point test * fixing incorrectly changed import * removing ml from labels and identifiers * renaming function * moving analyse file endpoint to file upload plugin * reverting import path changes * adding esUiShared back in * fixing navigation tabs alignment in basic license * adding key to tab wrapper * reverting test label * further removal of ml references * removing ml label from more identifiers * fixing tests Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: James Gowdy <[email protected]>
Adds versioning to all of the file upload APIs. Versions are added to the server side routes and to the client side functions which call the routes. Updates API tests to add the API version to the request headers. All of the APIs are internal and have been given the version '1'. Also renames `/internal/file_data_visualizer/analyze_file` to `/internal/file_upload/analyze_file` It appears this was a mistake from when the route was moved from the data visualiser plugin midway through development on [this PR](#96408). **Internal APIs** `/internal/file_upload/analyze_file` `/internal/file_upload/has_import_permission` `/internal/file_upload/index_exists` `/internal/file_upload/time_field_range` --------- Co-authored-by: kibanamachine <[email protected]>
Moves ML's file data visualizer component into it's own plugin
fileDataVisualizer
and then imports it back into ML for use in the Data Visualizer section of the app.Note, very little new code has been added, all UI code in this PR has just been moved or copied from the ML plugin.
The file data visualizer component relies on a decent amount of code shared with the index data visualizer which has had to be duplicated into the new plugin, along with some common ML utility functions and types.
The feature should function as before with some exceptions.
Also adds
index_exists
andtime_field_range
endpoints to thefileUpload
plugin to assist with importing data, moves theanalyze_file
endpoint fromfileUpload
tofileDataVisualizer
Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
Documentation was added for features that require explanation or tutorials
Unit or functional tests were updated or added to match the most common scenarios
This was checked for breaking API changes and was labeled appropriately