-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Use Yarn instead of NPM #5541
Merged
Merged
Use Yarn instead of NPM #5541
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
FROM cypress/browsers:node14.0.0-chrome84 | ||
FROM cypress/browsers:node14.17.0-chrome91-ff89 | ||
|
||
ENV APP /usr/src/app | ||
WORKDIR $APP | ||
|
||
COPY package.json package-lock.json $APP/ | ||
COPY package.json yarn.lock .yarnrc $APP/ | ||
COPY viz-lib $APP/viz-lib | ||
RUN npm ci > /dev/null | ||
RUN npm install [email protected] -g && yarn --frozen-lockfile --network-concurrency 1 > /dev/null | ||
|
||
COPY . $APP | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,15 +2,17 @@ version: 2.0 | |
|
||
build-docker-image-job: &build-docker-image-job | ||
docker: | ||
- image: circleci/node:12 | ||
- image: circleci/node:14.17 | ||
steps: | ||
- setup_remote_docker | ||
- setup_remote_docker: | ||
version: 19.03.13 | ||
- checkout | ||
- run: sudo apt update | ||
- run: sudo apt install python3-pip | ||
- run: sudo pip3 install -r requirements_bundles.txt | ||
- run: .circleci/update_version | ||
- run: npm run bundle | ||
- run: sudo npm install --global --force [email protected] | ||
- run: yarn bundle | ||
- run: .circleci/docker_build | ||
jobs: | ||
backend-lint: | ||
|
@@ -27,7 +29,8 @@ jobs: | |
docker: | ||
- image: circleci/buildpack-deps:xenial | ||
steps: | ||
- setup_remote_docker | ||
- setup_remote_docker: | ||
version: 19.03.13 | ||
- checkout | ||
- run: | ||
name: Build Docker Images | ||
|
@@ -61,34 +64,36 @@ jobs: | |
CYPRESS_INSTALL_BINARY: 0 | ||
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1 | ||
docker: | ||
- image: circleci/node:12 | ||
- image: circleci/node:14.17 | ||
steps: | ||
- checkout | ||
- run: mkdir -p /tmp/test-results/eslint | ||
- run: npm ci | ||
- run: npm run lint:ci | ||
- run: sudo npm install --global --force [email protected] | ||
- run: yarn cache clean && yarn --frozen-lockfile --network-concurrency 1 | ||
- run: yarn lint:ci | ||
- store_test_results: | ||
path: /tmp/test-results | ||
frontend-unit-tests: | ||
environment: | ||
CYPRESS_INSTALL_BINARY: 0 | ||
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1 | ||
docker: | ||
- image: circleci/node:12 | ||
- image: circleci/node:14.17 | ||
steps: | ||
- checkout | ||
- run: sudo apt update | ||
- run: sudo apt install python3-pip | ||
- run: sudo pip3 install -r requirements_bundles.txt | ||
- run: npm ci | ||
- run: npm run bundle | ||
- run: sudo npm install --global --force [email protected] | ||
- run: yarn cache clean && yarn --frozen-lockfile --network-concurrency 1 | ||
- run: yarn bundle | ||
- run: | ||
name: Run App Tests | ||
command: npm test | ||
command: yarn test | ||
- run: | ||
name: Run Visualizations Tests | ||
command: (cd viz-lib && npm test) | ||
- run: npm run lint | ||
command: (cd viz-lib && yarn test) | ||
- run: yarn lint | ||
frontend-e2e-tests: | ||
environment: | ||
COMPOSE_FILE: .circleci/docker-compose.cypress.yml | ||
|
@@ -99,9 +104,10 @@ jobs: | |
CYPRESS_INSTALL_BINARY: 0 | ||
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1 | ||
docker: | ||
- image: circleci/node:12 | ||
- image: circleci/node:14.17 | ||
steps: | ||
- setup_remote_docker | ||
- setup_remote_docker: | ||
version: 19.03.13 | ||
- checkout | ||
- run: | ||
name: Enable Code Coverage report for master branch | ||
|
@@ -110,19 +116,19 @@ jobs: | |
echo 'export CODE_COVERAGE=true' >> $BASH_ENV | ||
source $BASH_ENV | ||
fi | ||
- run: sudo npm install --global --force [email protected] | ||
- run: | ||
name: Install npm dependencies | ||
command: | | ||
npm ci | ||
name: Install frontend dependencies | ||
command: yarn cache clean && yarn --frozen-lockfile --network-concurrency 1 | ||
- run: | ||
name: Setup Redash server | ||
command: | | ||
npm run cypress build | ||
npm run cypress start -- --skip-db-seed | ||
docker-compose run cypress npm run cypress db-seed | ||
yarn cypress build | ||
yarn cypress start -- --skip-db-seed | ||
docker-compose run cypress yarn cypress db-seed | ||
- run: | ||
name: Execute Cypress tests | ||
command: npm run cypress run-ci | ||
command: yarn cypress run-ci | ||
- run: | ||
name: "Failure: output container logs to console" | ||
command: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v14.16.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* | ||
!.gitignore |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
FROM node:12 as frontend-builder | ||
FROM node:14.17 as frontend-builder | ||
|
||
RUN npm install --global --force [email protected] | ||
|
||
# Controls whether to build the frontend assets | ||
ARG skip_frontend_build | ||
|
@@ -10,18 +12,19 @@ RUN useradd -m -d /frontend redash | |
USER redash | ||
|
||
WORKDIR /frontend | ||
COPY --chown=redash package.json package-lock.json /frontend/ | ||
COPY --chown=redash package.json yarn.lock .yarnrc /frontend/ | ||
COPY --chown=redash viz-lib /frontend/viz-lib | ||
|
||
# Controls whether to instrument code for coverage information | ||
ARG code_coverage | ||
ENV BABEL_ENV=${code_coverage:+test} | ||
|
||
RUN if [ "x$skip_frontend_build" = "x" ] ; then npm ci --unsafe-perm; fi | ||
RUN if [ "x$skip_frontend_build" = "x" ] ; then yarn --frozen-lockfile --network-concurrency 1; fi | ||
|
||
COPY --chown=redash client /frontend/client | ||
COPY --chown=redash webpack.config.js /frontend/ | ||
RUN if [ "x$skip_frontend_build" = "x" ] ; then npm run build; else mkdir -p /frontend/client/dist && touch /frontend/client/dist/multi_org.html && touch /frontend/client/dist/index.html; fi | ||
RUN if [ "x$skip_frontend_build" = "x" ] ; then yarn build; else mkdir -p /frontend/client/dist && touch /frontend/client/dist/multi_org.html && touch /frontend/client/dist/index.html; fi | ||
|
||
FROM python:3.7-slim | ||
|
||
EXPOSE 5000 | ||
|
@@ -57,7 +60,7 @@ RUN apt-get update && \ | |
libsasl2-dev \ | ||
unzip \ | ||
libsasl2-modules-gssapi-mit && \ | ||
# MSSQL ODBC Driver: | ||
# MSSQL ODBC Driver: | ||
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \ | ||
curl https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list && \ | ||
apt-get update && \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
[build] | ||
base = "client" | ||
publish = "client/dist" | ||
command = "npm ci && npm run build" | ||
# Netlify doesn't seem to install Yarn even though NETLIFY_USE_YARN is set below | ||
# command = "cd ../ && npm i -g [email protected] && yarn --frozen-lockfile --force && cd viz-lib && yarn build:babel && cd .. && rm -r ./node_modules/@redash/viz && cp -r ./viz-lib/. ./node_modules/@redash/viz && yarn build && cd ./client" | ||
command = "cd ../ && npm i -g [email protected] && yarn cache clean && yarn --frozen-lockfile --network-concurrency 1 && yarn build && cd ./client" | ||
|
||
[build.environment] | ||
NODE_VERSION = "12.18.4" | ||
NODE_VERSION = "14.16.1" | ||
NETLIFY_USE_YARN = "true" | ||
YARN_VERSION = "1.22.10" | ||
CYPRESS_INSTALL_BINARY = "0" | ||
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD = "1" | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't node docker images come with yarn? (Same for the circleci one)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They do, but with older version (different in both cases). For consistency, I'm upgrading it everywhere