Skip to content

Commit

Permalink
say PLEASE to npx when running yarn-deduplicate
Browse files Browse the repository at this point in the history
because simply asking it to run yarn-deduplicate is no longer good
enough, you must now be polite when doing it[1]:

    To prevent security and user-experience problems from mistyping
    package names, npx prompts before installing anything. Suppress
    this prompt with the -y or --yes option.

we will also be updating npm to the latest to catch such issues in the
future

== test plan

running "rake canvas:compile_assets" using npm > 7 completes
without hanging indefinitely at the "install dependencies" stage

[1]: https://docs.npmjs.com/cli/v7/commands/npx#compatibility-with-older-npx-versions

Change-Id: I81e044d20143991cf6103084f44ce8d4c9011f5b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/259662
Tested-by: Service Cloud Jenkins <[email protected]>
Reviewed-by: Aaron Ogata <[email protected]>
QA-Review: Ahmad Amireh <[email protected]>
Product-Review: Ahmad Amireh <[email protected]>
  • Loading branch information
amireh committed Mar 2, 2021
1 parent 7135555 commit 6684592
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ RUN if [ -e /var/lib/gems/$RUBY_MAJOR.0/gems/bundler-* ]; then BUNDLER_INSTALL="
&& gem uninstall --all --ignore-dependencies --force $BUNDLER_INSTALL bundler \
&& gem install bundler --no-document -v $BUNDLER_VERSION \
&& find $GEM_HOME ! -user docker | xargs chown docker:docker
RUN npm install -g npm@latest && npm cache clean --force

USER docker

Expand Down
1 change: 1 addition & 0 deletions Dockerfile.jenkins
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ RUN if [ -e /var/lib/gems/$RUBY_MAJOR.0/gems/bundler-* ]; then BUNDLER_INSTALL="
&& gem uninstall --all --ignore-dependencies --force $BUNDLER_INSTALL bundler \
&& gem install bundler --no-document -v $BUNDLER_VERSION \
&& find $GEM_HOME ! -user docker | xargs chown docker:docker
RUN npm install -g npm@latest && npm cache clean --force

USER docker

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.package-translations
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN apt-get update \
&& apt-get install -y jq python openssh-client \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/

RUN npm install -g npm@latest && npm cache clean --force

# do this first so yarn install can be cached if package.json has not changed
COPY --chown=docker:docker package.json yarn.lock babel.config.js /usr/src/app/
Expand Down
1 change: 1 addition & 0 deletions build/Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ RUN if [ -e /var/lib/gems/$RUBY_MAJOR.0/gems/bundler-* ]; then BUNDLER_INSTALL="
&& gem uninstall --all --ignore-dependencies --force $BUNDLER_INSTALL bundler \
&& gem install bundler --no-document -v $BUNDLER_VERSION \
&& find $GEM_HOME ! -user docker | xargs chown docker:docker
RUN npm install -g npm@latest && npm cache clean --force

USER docker

Expand Down
1 change: 1 addition & 0 deletions build/ubuntu.Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ RUN if [ -e /var/lib/gems/$RUBY_MAJOR.0/gems/bundler-* ]; then BUNDLER_INSTALL="
&& gem uninstall --all --ignore-dependencies --force $BUNDLER_INSTALL bundler \
&& gem install bundler --no-document -v 2.2.11 \
&& find $GEM_HOME ! -user docker | xargs chown docker:docker
RUN npm install -g npm@latest && npm cache clean --force

<% if development? -%>
# We will need sfnt2woff in order to build fonts
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@
"a11y-report": "./spec/jspec.sh --a11y",
"upgrade-and-dedupe": "rm -rf yarn.lock node_modules && yes 1 | yarn install --flat --production --ignore-scripts && git checkout package.json && yarn install && git add yarn.lock",
"upgrade-instructure-ui": "script/upgrade-instructure-ui",
"dedupe-yarn": "npx yarn-deduplicate",
"dedupe-yarn": "npx --yes yarn-deduplicate",
"clean": "yarn workspace-run-serial clean",
"storybook": "start-storybook -p 6006 --no-dll =s ../public/javascripts",
"test-storybook": "yarn jest --roots .storybook --testMatch **/storybook.test.js"
Expand Down
1 change: 1 addition & 0 deletions ubuntu.development.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ RUN if [ -e /var/lib/gems/$RUBY_MAJOR.0/gems/bundler-* ]; then BUNDLER_INSTALL="
&& gem uninstall --all --ignore-dependencies --force $BUNDLER_INSTALL bundler \
&& gem install bundler --no-document -v $BUNDLER_VERSION \
&& find $GEM_HOME ! -user docker | xargs chown docker:docker
RUN npm install -g npm@latest && npm cache clean --force

# We will need sfnt2woff in order to build fonts
COPY --chown=docker:docker build/vendor/woff-code-latest.zip ./
Expand Down
2 changes: 1 addition & 1 deletion ubuntu.production.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ RUN if [ -e /var/lib/gems/$RUBY_MAJOR.0/gems/bundler-* ]; then BUNDLER_INSTALL="
&& gem uninstall --all --ignore-dependencies --force $BUNDLER_INSTALL bundler \
&& gem install bundler --no-document -v $BUNDLER_VERSION \
&& find $GEM_HOME ! -user docker | xargs chown docker:docker

RUN npm install -g npm@latest && npm cache clean --force

WORKDIR $APP_HOME

Expand Down

0 comments on commit 6684592

Please sign in to comment.