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

[NP] Move visTypeVislib into NP #63963

Merged
merged 17 commits into from
Apr 28, 2020
Merged

Conversation

sulemanof
Copy link
Contributor

@sulemanof sulemanof commented Apr 20, 2020

Summary

Moving the vis_type_vislib into NP.
All possible unit tests were moved to jest setup, other were moved into src/legacy/core_plugins/kibana/public/__tests__/vis_type_vislib to be run via karma setup.

src/legacy/core_plugins/kibana/public/__tests__/**/* path was included to be ignored in .eslintrc.js for the @kbn/eslint/no-restricted-paths rule. So that it's applicable for all the next tests which will be move to that folder and which will import files from migrated to NP plugins

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@sulemanof sulemanof marked this pull request as ready for review April 21, 2020 11:58
@sulemanof sulemanof requested a review from a team April 21, 2020 11:58
@sulemanof sulemanof requested review from a team as code owners April 21, 2020 11:58
@sulemanof sulemanof added Feature:NP Migration Feature:Vislib Vislib chart implementation release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.8.0 v8.0.0 labels Apr 21, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@flash1293 flash1293 mentioned this pull request Apr 21, 2020
69 tasks
Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

Tested and looks mostly good to me, just left two comments about the separation of legacy tests.

@@ -20,13 +20,20 @@
import _ from 'lodash';
Copy link
Contributor

@flash1293 flash1293 Apr 22, 2020

Choose a reason for hiding this comment

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

It seems like most of this file is only used in the legacy tests, can we move it over there? The only thing used in NP jest tests as well is the getMockUiState function, looks like it makes sense to move that one into a separate file so we don't have to import things deeply from within other plugins and mess with jquery in the new platform (and keep it in the legacy world instead).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, done

.eslintignore Outdated
@@ -10,7 +10,7 @@ bower_components
/html_docs
/src/plugins/data/common/es_query/kuery/ast/_generated_/**
/src/plugins/vis_type_timelion/public/_generated_/**
src/legacy/core_plugins/vis_type_vislib/public/vislib/__tests__/lib/fixtures/mock_data
/src/plugins/vis_type_vislib/public/fixtures/mock_data
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be a good opportunity to fix the formatting in these files

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, I've done it in a separate commit in case of any concerns (the diff has increased significantly)

Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

Checked the diff and testing worlds are nicely separated now. LGTM

Copy link
Member

@jgowdyelastic jgowdyelastic left a comment

Choose a reason for hiding this comment

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

ML changes LGTM

Copy link
Member

@mistic mistic left a comment

Choose a reason for hiding this comment

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

The changes in the files under operations team code owners LGTM

@import 'src/legacy/core_plugins/vis_type_vislib/public/index';
// vis_type_vislib UI styles are imported here for running karma Browser tests
// should be somehow included through the "vis_type_vislib" plugin initialization
@import '../../../../plugins/vis_type_vislib/public/index';
Copy link
Contributor

Choose a reason for hiding this comment

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

Since you have this imported here and in the plugin, doesn't it duplicate the compiled styles?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it's duplicated temporary. We'll get rid of this legacy compilation for public code and will only use this for testing.

Copy link
Contributor

Choose a reason for hiding this comment

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

@sulemanof For now we can comment out the import in the plugin because the chart will always render in the legacy platform. When cutting over visualize and dashboard to the new platform we can revisit this again.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @flash1293 That's what I'd suggest as well. We really want to avoid duplicate styles

Copy link
Contributor

@flash1293 flash1293 Apr 24, 2020

Choose a reason for hiding this comment

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

@sulemanof I found a workaround we can use here. The tests_bundle is stripped out for the production build, but it's loaded in karma tests. We can put the "duplicated" styles there, so we don't pollute anything and won't have problems when doing the cutover. PR: sulemanof#2

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@flash1293 thanks for your effort! I think it's the best solution!
Merged into current branch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cchaos are you OK with the changes?

Comment on lines 3 to 9
// vis_type_vislib UI styles are imported here for running karma Browser tests
// should be somehow included through the "vis_type_vislib" plugin initialization
@import '../../../../plugins/vis_type_vislib/public/index';

// Visualization styles are imported here for running karma Browser tests
// should be somehow included through the "visualizations" plugin initialization
@import '../../../../plugins/visualizations/public/index';
Copy link
Contributor

Choose a reason for hiding this comment

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

This is fine, though you probably don't have to repeat this same comment. Just add one at the very top of the file that explains the necessity of the file itself.

Copy link
Contributor

Choose a reason for hiding this comment

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

@cchaos you are right, done.

@flash1293
Copy link
Contributor

@elasticmachine merge upstream

@flash1293
Copy link
Contributor

Jenkins, test this.

@flash1293
Copy link
Contributor

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💛 Build succeeded, but was flaky

History

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

Copy link
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

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

SASS is good

@flash1293 flash1293 merged commit da89856 into elastic:master Apr 28, 2020
flash1293 pushed a commit to flash1293/kibana that referenced this pull request Apr 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:NP Migration Feature:Vislib Vislib chart implementation release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.8.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants