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

chore: upgrade to npm 7 and superset-ui 0.17.9 #13100

Merged
merged 4 commits into from
Feb 15, 2021
Merged

Conversation

ktmud
Copy link
Member

@ktmud ktmud commented Feb 12, 2021

SUMMARY

Closes #13067

#13079 upgraded package-lock.json to npm 7 format (lockfileversion: 2), which breaks the current workflow with npm link (although #13058 has downgraded it to lockfileversion: 1 again):

  1. Now you have to manually run npm install in each package you linked
  2. A simple npm install will fail because of peer dependency resolution. You should use npm install --legacy-peer-deps until we resolve the peer dependency conflicts (seems solvable by upgrading to React 17).

Instead of reverting, let's see what else we need to do to make the Superset codebase work with npm 7.

This PR updates the following:

  1. Lock package.json engines to npm 7
  2. Upgrade Superset UI packages to the latest, including @superset-ui/legacy-plugin-chart-map-box which was left out of recent upgrades for a while... This brings in a couple of new commits in Superset UI:
    apache-superset/superset-ui@v0.17.8...v0.17.9
    which adds a "sort by metric" checkbox for charts with single metric.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A

TEST PLAN

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 ready for review February 13, 2021 21:50
@codecov-io
Copy link

codecov-io commented Feb 13, 2021

Codecov Report

Merging #13100 (5077f6e) into master (2ce7982) will decrease coverage by 4.93%.
The diff coverage is 37.79%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #13100      +/-   ##
==========================================
- Coverage   53.06%   48.12%   -4.94%     
==========================================
  Files         489      492       +3     
  Lines       17314    17335      +21     
  Branches     4482     4486       +4     
==========================================
- Hits         9187     8343     -844     
- Misses       8127     8992     +865     
Flag Coverage Δ
cypress 48.12% <37.79%> (-4.94%) ⬇️

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

Impacted Files Coverage Δ
...end/src/SqlLab/components/RunQueryActionButton.tsx 52.77% <ø> (ø)
superset-frontend/src/chart/ChartContainer.jsx 100.00% <ø> (ø)
superset-frontend/src/chart/ChartRenderer.jsx 75.67% <0.00%> (-1.04%) ⬇️
...perset-frontend/src/common/components/Dropdown.tsx 50.00% <ø> (ø)
...rontend/src/components/ListView/CardSortSelect.tsx 78.94% <ø> (ø)
...ontend/src/components/ListViewCard/ImageLoader.tsx 75.00% <0.00%> (ø)
...set-frontend/src/components/URLShortLinkButton.jsx 100.00% <ø> (ø)
...rset-frontend/src/components/URLShortLinkModal.tsx 77.77% <ø> (ø)
...src/dashboard/components/HeaderActionsDropdown.jsx 64.38% <ø> (-3.19%) ⬇️
...end/src/dashboard/components/StickyVerticalBar.tsx 100.00% <ø> (ø)
... and 128 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 5b669b3...5077f6e. Read the comment docs.

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

LGTM and tested on node v12.20.2 + npm 7.5.4. It seems the node:12 docker image is still on npm 6, as I'm getting this when running docker-compose: "npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!"

@ktmud
Copy link
Member Author

ktmud commented Feb 14, 2021

@villebro Let me update the Dockerfile in this PR, too.

@ktmud ktmud force-pushed the upgrade-npm branch 3 times, most recently from 5077f6e to 8d9e2ab Compare February 15, 2021 08:58
@ktmud
Copy link
Member Author

ktmud commented Feb 15, 2021

Apparently #13058 has downgraded the lockfile to npm 6 format again. To avoid future flip flops, I added some instructions in CONTRIBUTING.md. @villebro could you take another look?

- [Capitalization guidelines](#capitalization-guidelines)
- [Sentence case](#sentence-case)
- [How to refer to UI elements](#how-to-refer-to-ui-elements)
- [\*\*Exceptions to sentence case:](#exceptions-to-sentence-case)
Copy link
Member Author

Choose a reason for hiding this comment

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

Updates from Markdown formatter

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

LGTM, minor comment about Node.js name

CONTRIBUTING.md Outdated
@@ -464,7 +473,7 @@ Frontend assets (TypeScript, JavaScript, CSS, and images) must be compiled in or

##### nvm and node

First, be sure you are using recent versions of NodeJS and npm. We recommend using [nvm](https://github.com/nvm-sh/nvm) to manage your node environment:
First, be sure you are using recent versions of node.js and npm. We recommend using [nvm](https://github.com/nvm-sh/nvm) to manage your node environment:
Copy link
Member

Choose a reason for hiding this comment

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

I did some quick googling, and it appears the commonly used name is Node.js with a capital N: https://en.wikipedia.org/wiki/Node.js

@michael-s-molina
Copy link
Member

@ktmud Thanks for upgrading to NPM 7! I didn't noticed that change in #13079.

@ktmud ktmud merged commit c9f76d5 into apache:master Feb 15, 2021
@ktmud ktmud deleted the upgrade-npm branch February 15, 2021 22:43
This was referenced Feb 19, 2021
@villebro villebro mentioned this pull request Sep 20, 2021
9 tasks
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.2.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 🚢 1.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TODO] Upgrade to npm 7
5 participants