diff --git a/.github/workflows/test-and-ci.yml b/.github/workflows/test-and-ci.yml index 07473ffa31..8b48c3a0d4 100644 --- a/.github/workflows/test-and-ci.yml +++ b/.github/workflows/test-and-ci.yml @@ -15,7 +15,7 @@ jobs: working-directory: ./client steps: - uses: actions/checkout@v3 - - name: Set up node ${{ matrix.node-version }} + - name: Set up node LTS uses: actions/setup-node@v3 with: node-version: "18.17.1" @@ -43,7 +43,7 @@ jobs: working-directory: ./server steps: - uses: actions/checkout@v3 - - name: Set up node ${{ matrix.node-version }} + - name: Set up node LTS uses: actions/setup-node@v3 with: node-version: "18.17.1" @@ -86,7 +86,7 @@ jobs: working-directory: ./tests steps: - uses: actions/checkout@v3 - - name: Set up node ${{ matrix.node-version }} + - name: Set up node LTS uses: actions/setup-node@v3 with: node-version: "18.17.1" @@ -152,3 +152,31 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.RENKUBOT_GITHUB_TOKEN }} COMPONENT_NAME: renku-ui + + # upload-source-maps: + # needs: [publish-images] + # runs-on: ubuntu-22.04 + # if: "startsWith(github.ref, 'refs/tags/')" + # defaults: + # run: + # working-directory: ./client + # steps: + # - uses: actions/checkout@v3 + # - name: Set up node LTS + # uses: actions/setup-node@v3 + # with: + # node-version: "18.17.1" + # - name: Install client dependencies + # run: npm clean-install + # env: + # NODE_OPTIONS: "--max-old-space-size=4096" + # - name: Set up environment variables + # run: echo "CHART_TAG=$(echo "${GITHUB_REF}" | cut -d/ -f3)" >> $GITHUB_ENV + # - name: Pull Docker image + # run: docker pull renku/renku-ui:$CHART_TAG + # - name: Create container + # run: docker create --name renku-ui-container renku/renku-ui:$CHART_TAG + # - name: Pull out build files + # run: docker cp renku-ui-container:/usr/share/nginx/html ./build + # - name: Send build files to Sentry + # run: npx sentry-cli sourcemaps upload --release=$CHART_TAG ./build diff --git a/client/Dockerfile b/client/Dockerfile index 3550d28313..47653a8f47 100644 --- a/client/Dockerfile +++ b/client/Dockerfile @@ -14,17 +14,14 @@ ENV NODE_OPTIONS="--max-old-space-size=4096" ARG SHORT_SHA ENV RENKU_UI_SHORT_SHA=$SHORT_SHA -# Delete this after reactstrap is released -RUN apk update && apk upgrade && \ - apk add --no-cache git - # There is some incompatibility between craco and react-scripts >4 # that causes problems with linting. Lint errors should have been # caught before we get here, so we can turn this off. # But look into https://github.com/gsoft-inc/craco/pull/219 for a better fix ENV DISABLE_ESLINT_PLUGIN=true RUN npm ci && \ - npm run-script build + npm run-script build && \ + npm run-script build:sentry COPY .storybook /app/.storybook diff --git a/client/package-lock.json b/client/package-lock.json index f1b92a28f5..8ed70a7d54 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -87,6 +87,7 @@ "@babel/preset-typescript": "^7.16.7", "@craco/craco": "^7.0.0", "@rtk-query/codegen-openapi": "^1.0.0", + "@sentry/cli": "^2.21.2", "@storybook/addon-actions": "~7.2.0", "@storybook/addon-essentials": "~7.2.0", "@storybook/addon-interactions": "~7.2.0", @@ -6873,6 +6874,41 @@ "node": ">=8" } }, + "node_modules/@sentry/cli": { + "version": "2.21.2", + "resolved": "https://registry.npmjs.org/@sentry/cli/-/cli-2.21.2.tgz", + "integrity": "sha512-X1nye89zl+QV3FSuQDGItfM51tW9PQ7ce0TtV/12DgGgTVEgnVp5uvO3wX5XauHvulQzRPzwUL3ZK+yS5bAwCw==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "https-proxy-agent": "^5.0.0", + "node-fetch": "^2.6.7", + "progress": "^2.0.3", + "proxy-from-env": "^1.1.0", + "which": "^2.0.2" + }, + "bin": { + "sentry-cli": "bin/sentry-cli" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@sentry/cli/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/@sentry/core": { "version": "7.64.0", "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.64.0.tgz", @@ -53732,6 +53768,30 @@ "tslib": "^2.4.1 || ^1.9.3" } }, + "@sentry/cli": { + "version": "2.21.2", + "resolved": "https://registry.npmjs.org/@sentry/cli/-/cli-2.21.2.tgz", + "integrity": "sha512-X1nye89zl+QV3FSuQDGItfM51tW9PQ7ce0TtV/12DgGgTVEgnVp5uvO3wX5XauHvulQzRPzwUL3ZK+yS5bAwCw==", + "dev": true, + "requires": { + "https-proxy-agent": "^5.0.0", + "node-fetch": "^2.6.7", + "progress": "^2.0.3", + "proxy-from-env": "^1.1.0", + "which": "^2.0.2" + }, + "dependencies": { + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, "@sentry/core": { "version": "7.64.0", "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.64.0.tgz", diff --git a/client/package.json b/client/package.json index 86d931df84..916b031388 100644 --- a/client/package.json +++ b/client/package.json @@ -79,6 +79,7 @@ "start": "react-scripts start", "build": "REACT_APP_UI_DEV_MODE=false craco --max_old_space_size=4096 build", "build:analyze": "REACT_APP_UI_DEV_MODE=false craco --max_old_space_size=4096 build --analyze", + "build:sentry": "sentry-cli sourcemaps inject build", "test": "craco test", "eject": "craco eject", "lint": "eslint --max-warnings=0 src/", @@ -102,6 +103,7 @@ "@babel/preset-typescript": "^7.16.7", "@craco/craco": "^7.0.0", "@rtk-query/codegen-openapi": "^1.0.0", + "@sentry/cli": "^2.21.2", "@storybook/addon-actions": "~7.2.0", "@storybook/addon-essentials": "~7.2.0", "@storybook/addon-interactions": "~7.2.0",