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

feat: Add make update cmd #14652

Merged
merged 3 commits into from
May 20, 2021
Merged

feat: Add make update cmd #14652

merged 3 commits into from
May 20, 2021

Conversation

hughhhh
Copy link
Member

@hughhhh hughhhh commented May 16, 2021

SUMMARY

Command that reinstalls all your python and js dependencies

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TEST PLAN

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@codecov
Copy link

codecov bot commented May 16, 2021

Codecov Report

Merging #14652 (d7923af) into master (4f5c537) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #14652   +/-   ##
=======================================
  Coverage   77.54%   77.54%           
=======================================
  Files         958      958           
  Lines       48541    48541           
  Branches     5702     5702           
=======================================
  Hits        37640    37640           
  Misses      10700    10700           
  Partials      201      201           
Flag Coverage Δ
hive 81.10% <ø> (ø)
javascript 72.51% <ø> (ø)
mysql 81.37% <ø> (ø)
postgres 81.39% <ø> (ø)
presto 81.09% <ø> (ø)
python 81.92% <ø> (ø)
sqlite 81.01% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out 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 4f5c537...d7923af. Read the comment docs.

Makefile Outdated
@@ -38,6 +38,22 @@ superset:
# Load some data to play with
superset load-examples

update:
Copy link
Member

Choose a reason for hiding this comment

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

Maybe name this something like update-npm and then only do the final step, as the install will bump versions in the lockfile:

cd superset-frontend
npm install

Copy link
Contributor

@benjreinhart benjreinhart May 17, 2021

Choose a reason for hiding this comment

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

I believe npm install will only install what's in the lockfile (when given no args). npm update will bump versions.

(to be clear I do not think we should be running npm update)

Copy link
Contributor

Choose a reason for hiding this comment

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

I would consider splitting FE and BE related functionality into different commands that can be run independent of one another. Then, we can also have a command that runs both commands, e.g., update-all: update-be update-fe.

Copy link
Member

@craig-rueda craig-rueda May 17, 2021

Choose a reason for hiding this comment

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

npm ci will only install what's in the lockfile. install will bump patches. At least it touches the lockfile :)

Copy link
Member

Choose a reason for hiding this comment

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

npm ci will reinstall everything in the lockfile (essentially wiping node_modules and then installing fresh packages). npm install will instal the missing dependencies in node_modules, if there's no lockfile one will be created, if there is a lockfile it will be adhered to.

Copy link
Member

Choose a reason for hiding this comment

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

Though, reading through the issue it appears this behavior has been patched in recent versions of npm@^5.4.2 and it behaves as I have described above
npm/npm#17979 (comment)

Copy link
Member

Choose a reason for hiding this comment

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

Ha ha.. so I've still been seeing updated package-lock.json files in PRs that shouldn't be there, but.. I tested it out with v 7.6.0 and pulled Superset 1.0.0 and ran npm install and it updated the lockfile. :(
Either way, we can leave this as is, but if we do, I think we should be extra vigilant about sneaky tailgaiting package-lock files in PRs. Technically it should do no harm to have them updated, if the package is using semver correctly, but it just creates more ambiguity and room for potential bugs if it's there for no seemingly good reason.

Copy link
Member

Choose a reason for hiding this comment

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

I'll still continue to recommend that people use npm ci when updating.

Copy link
Member

Choose a reason for hiding this comment

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

I've seen the same but I think that's due to slight differences in npm version. I haven't seen actual package version changes in the lockfile, it seems like it's usually formatting changes or updates to the integrity sha. I think it would be valuable to lock down the version of node & npm we are all using to a specific version and update these scripts to ensure the correct version of node/npm is being used.

Copy link
Member

Choose a reason for hiding this comment

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

Or just use npm ci :)

@hughhhh hughhhh requested review from craig-rueda and nytai May 19, 2021 01:50
@hughhhh hughhhh merged commit dbebaf2 into master May 20, 2021
cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
* setup of makefile

* lit

* update makefile
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
* setup of makefile

* lit

* update makefile
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
* setup of makefile

* lit

* update makefile
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.3.0 labels Mar 12, 2024
@mistercrunch mistercrunch deleted the makefile-update branch March 26, 2024 16:15
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 size/S 🚢 1.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants