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

refactor: merge/upgrade superset-ui packages #10790

Merged
merged 3 commits into from
Sep 9, 2020

Conversation

ktmud
Copy link
Member

@ktmud ktmud commented Sep 4, 2020

SUMMARY

Merge core @superset-ui/* packages into one single package. For details, see: apache-superset/superset-ui#768

This PR does two things and two things only:

  1. Bump dependency versions for @superset-ui/core, @superset-ui/chart-controls and all the viz plugins.
  2. Update the corresponding import paths.

Any changes not related to this two should be called out. Everything should work exactly like before.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TEST PLAN

CI + Manual verification on major visualization related pages.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

@ktmud ktmud marked this pull request as draft September 4, 2020 04:09
@ktmud ktmud marked this pull request as ready for review September 9, 2020 01:13
@@ -22,6 +22,8 @@
"prettier-check": "prettier --check '{src,stylesheets}/**/*.{css,less,sass,scss}'",
"lint-fix": "eslint --fix --ignore-path=.eslintignore --ext .js,.jsx,.ts,tsx . && npm run clean-css && npm run type",
"clean-css": "prettier --write '{src,stylesheets}/**/*.{css,less,sass,scss}'",
"format": "prettier --write './{src,spec,stylesheets,cypress-base}/**/*{.js,.jsx,.ts,.tsx,.css,.less,.scss,.sass}'",
"prettier": "npm run format",
Copy link
Member Author

Choose a reason for hiding this comment

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

Adding a shortcut command to format files with Prettier, to be consistent with superset-ui

@@ -118,6 +108,7 @@
"dnd-core": "^2.6.0",
"dom-to-image": "^2.6.0",
"geolib": "^2.0.24",
"global-box": "^1.2.0",
Copy link
Member Author

Choose a reason for hiding this comment

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

A new peerDependency from the updated encodable, which is a dependency of preset-chart-xy.

@@ -149,6 +140,7 @@
"react-hot-loader": "^4.12.20",
"react-json-tree": "^0.11.2",
"react-jsonschema-form": "^1.2.0",
"react-loadable": "^5.5.0",
Copy link
Member Author

Choose a reason for hiding this comment

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

Previously a dependency of @superset-ui/chart, adding it here because it was moved to peerDependencies of @superset-ui/core.

@codecov-commenter
Copy link

codecov-commenter commented Sep 9, 2020

Codecov Report

Merging #10790 into master will decrease coverage by 0.02%.
The diff coverage is 87.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10790      +/-   ##
==========================================
- Coverage   61.30%   61.27%   -0.03%     
==========================================
  Files         802      802              
  Lines       37870    37845      -25     
  Branches     3561     3561              
==========================================
- Hits        23215    23190      -25     
  Misses      14469    14469              
  Partials      186      186              
Flag Coverage Δ
#javascript 61.58% <87.50%> (-0.07%) ⬇️
#python 61.09% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
superset-frontend/src/SqlLab/App.jsx 0.00% <ø> (ø)
superset-frontend/src/SqlLab/actions/sqlLab.js 59.61% <ø> (ø)
superset-frontend/src/SqlLab/components/App.jsx 77.77% <ø> (ø)
.../src/SqlLab/components/EstimateQueryCostButton.jsx 17.39% <ø> (ø)
...src/SqlLab/components/ExploreCtasResultsButton.jsx 13.33% <ø> (ø)
...end/src/SqlLab/components/ExploreResultsButton.jsx 74.07% <ø> (ø)
...-frontend/src/SqlLab/components/HighlightedSql.jsx 90.00% <ø> (ø)
...rontend/src/SqlLab/components/QueryAutoRefresh.jsx 65.90% <ø> (ø)
...et-frontend/src/SqlLab/components/QueryHistory.jsx 83.33% <ø> (ø)
...set-frontend/src/SqlLab/components/QuerySearch.jsx 57.54% <ø> (ø)
... and 205 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 50672bb...a3ce1e4. Read the comment docs.

Comment on lines +19 to +26
import airbnb from '@superset-ui/core/esm/color/colorSchemes/categorical/airbnb';
import categoricalD3 from '@superset-ui/core/esm/color/colorSchemes/categorical/d3';
import echarts from '@superset-ui/core/esm/color/colorSchemes/categorical/echarts';
import google from '@superset-ui/core/esm/color/colorSchemes/categorical/google';
import lyft from '@superset-ui/core/esm/color/colorSchemes/categorical/lyft';
import preset from '@superset-ui/core/esm/color/colorSchemes/categorical/preset';
import sequentialCommon from '@superset-ui/core/esm/color/colorSchemes/sequential/common';
import sequentialD3 from '@superset-ui/core/esm/color/colorSchemes/sequential/d3';
Copy link
Member

Choose a reason for hiding this comment

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

Not that this behavior is being changed, but is there some reason these have to be pulled in from /esm/ and aren't exported like the other components in superset-ui/core? It feels like these should be exported as categoricalColorSchemes.* and sequentialColorSchemes.* or similar.

Copy link
Member Author

@ktmud ktmud Sep 9, 2020

Choose a reason for hiding this comment

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

I don't feel like doing additional refactor in this already humongous PR. For this specific case, I almost feel these colors should probably be move out of the @superset-ui/core package and placed under incubator-superset instead so that adding a new color wouldn't require publishing the package and custom Superset installations can also opt out colors more thoroughly.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, moving these to incubator-superset probably makes more sense. Also not recommending changing this now, this was mostly a question and proposal for future changes post merge.

Copy link
Contributor

Choose a reason for hiding this comment

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

we could also add the export from index and get rid of deep import later.
Agree not doing it in this humongous PR

@@ -43,7 +43,7 @@ describe('Visualization > Big Number with Trendline', () => {
cy.visitChartByParams(JSON.stringify(formData));
cy.verifySliceSuccess({
waitAlias: '@getJson',
chartSelector: '.big_number',
chartSelector: '.superset-legacy-chart-big-number',
Copy link
Member Author

Choose a reason for hiding this comment

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

SupersetChart may render before the chart content is rendered, so Cypress will find an empty div.big_number (the wrapper of the actual chart), breaking the test.

@@ -30,12 +30,12 @@ describe('AdhocFilters', () => {

cy.get('[data-test=adhoc_filters]').within(() => {
cy.get('.Select__control').click();
cy.get('input[type=text]').type('name{enter}');
cy.get('input[type=text]').focus().type('name{enter}');
Copy link
Member Author

Choose a reason for hiding this comment

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

Fixing an input is covered by "Choose a metric..." placeholder error.

@ktmud
Copy link
Member Author

ktmud commented Sep 9, 2020

@kristw @evans @villebro This is ready for review, even though an unrelated python test was failing for no reason.

Copy link
Contributor

@kristw kristw left a comment

Choose a reason for hiding this comment

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

even though an unrelated python test was failing for no reason.

CI is green now. Is it just flaky test?

@ktmud
Copy link
Member Author

ktmud commented Sep 9, 2020

even though an unrelated python test was failing for no reason.

CI is green now. Is it just flaky test?

I think so

@ktmud ktmud merged commit 9a59bdd into apache:master Sep 9, 2020
@ktmud ktmud deleted the upgrade-superset-ui branch September 9, 2020 20:19
@villebro villebro added v0.38 and removed v0.38 labels Sep 10, 2020
auxten pushed a commit to auxten/incubator-superset that referenced this pull request Nov 20, 2020
* refactor: merge/upgrade superset-ui packages

* Fix flaky big number test

* Fix Flaky AdhocFilters test
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.38.0 labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.38.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants