From 0cd13b77e4b7996b3994a462c64a9fb20e58ad22 Mon Sep 17 00:00:00 2001 From: Sampo Tawast Date: Thu, 4 May 2023 09:22:33 +0300 Subject: [PATCH 01/11] Upgrade to Node v18 --- .github/workflows/audit.yml | 2 +- .github/workflows/bf-applicant-frontend-tests.yml | 4 ++-- .github/workflows/bf-handler-frontend-tests.yml | 4 ++-- .github/workflows/bf-review.yml | 2 +- .github/workflows/bf-shared-frontend-tests.yml | 2 +- .github/workflows/ks-empl-frontend-tests.yml | 4 ++-- .github/workflows/ks-handler-frontend-tests.yml | 4 ++-- .github/workflows/ks-review.yml | 2 +- .github/workflows/ks-shared-frontend-tests.yml | 2 +- .github/workflows/ks-youth-frontend-tests.yml | 4 ++-- .github/workflows/shared-frontend-tests.yml | 2 +- .github/workflows/te-admn-frontend-tests.yml | 4 ++-- .github/workflows/te-review.yml | 2 +- .github/workflows/te-shared-frontend-tests.yml | 2 +- .github/workflows/te-yout-frontend-tests.yml | 4 ++-- .github/workflows/yarn-audit-scheduled.yml | 2 +- README.md | 2 +- frontend/README.md | 4 ++-- frontend/benefit/README.md | 6 +++--- frontend/kesaseteli/README.md | 4 ++-- frontend/package.json | 4 ++-- package.json | 2 +- 22 files changed, 34 insertions(+), 34 deletions(-) diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index c8eb3d452c..7a9b75d3d3 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -17,7 +17,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '16' + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" diff --git a/.github/workflows/bf-applicant-frontend-tests.yml b/.github/workflows/bf-applicant-frontend-tests.yml index 251c268d96..c4d28edb66 100644 --- a/.github/workflows/bf-applicant-frontend-tests.yml +++ b/.github/workflows/bf-applicant-frontend-tests.yml @@ -25,7 +25,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: "16" + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" @@ -52,7 +52,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: "16" + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" diff --git a/.github/workflows/bf-handler-frontend-tests.yml b/.github/workflows/bf-handler-frontend-tests.yml index 0c50506891..c8e1103c96 100644 --- a/.github/workflows/bf-handler-frontend-tests.yml +++ b/.github/workflows/bf-handler-frontend-tests.yml @@ -25,7 +25,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: "16" + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" @@ -52,7 +52,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: "16" + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" diff --git a/.github/workflows/bf-review.yml b/.github/workflows/bf-review.yml index 8ef45cf3a7..bcb6647e5e 100644 --- a/.github/workflows/bf-review.yml +++ b/.github/workflows/bf-review.yml @@ -238,7 +238,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: "16" + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" diff --git a/.github/workflows/bf-shared-frontend-tests.yml b/.github/workflows/bf-shared-frontend-tests.yml index 03f5dfa07d..6cfa4d0f96 100644 --- a/.github/workflows/bf-shared-frontend-tests.yml +++ b/.github/workflows/bf-shared-frontend-tests.yml @@ -24,7 +24,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: "16" + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" diff --git a/.github/workflows/ks-empl-frontend-tests.yml b/.github/workflows/ks-empl-frontend-tests.yml index dfb9bc36fb..d3dc1ecb88 100644 --- a/.github/workflows/ks-empl-frontend-tests.yml +++ b/.github/workflows/ks-empl-frontend-tests.yml @@ -25,7 +25,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '16' + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" @@ -63,7 +63,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '16' + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" diff --git a/.github/workflows/ks-handler-frontend-tests.yml b/.github/workflows/ks-handler-frontend-tests.yml index d15e7da6a3..f91a288813 100644 --- a/.github/workflows/ks-handler-frontend-tests.yml +++ b/.github/workflows/ks-handler-frontend-tests.yml @@ -25,7 +25,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '16' + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" @@ -63,7 +63,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '16' + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" diff --git a/.github/workflows/ks-review.yml b/.github/workflows/ks-review.yml index 49151e01d6..a4588457b2 100644 --- a/.github/workflows/ks-review.yml +++ b/.github/workflows/ks-review.yml @@ -256,7 +256,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '16' + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" diff --git a/.github/workflows/ks-shared-frontend-tests.yml b/.github/workflows/ks-shared-frontend-tests.yml index 272e4af157..39341ccd38 100644 --- a/.github/workflows/ks-shared-frontend-tests.yml +++ b/.github/workflows/ks-shared-frontend-tests.yml @@ -24,7 +24,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '16' + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" diff --git a/.github/workflows/ks-youth-frontend-tests.yml b/.github/workflows/ks-youth-frontend-tests.yml index 1bc22fb856..d6da1681db 100644 --- a/.github/workflows/ks-youth-frontend-tests.yml +++ b/.github/workflows/ks-youth-frontend-tests.yml @@ -25,7 +25,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '16' + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" @@ -63,7 +63,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '16' + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" diff --git a/.github/workflows/shared-frontend-tests.yml b/.github/workflows/shared-frontend-tests.yml index 1b6faeeaf0..45317f81bc 100644 --- a/.github/workflows/shared-frontend-tests.yml +++ b/.github/workflows/shared-frontend-tests.yml @@ -23,7 +23,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '16' + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" diff --git a/.github/workflows/te-admn-frontend-tests.yml b/.github/workflows/te-admn-frontend-tests.yml index 227d992fcf..ecee92a43c 100644 --- a/.github/workflows/te-admn-frontend-tests.yml +++ b/.github/workflows/te-admn-frontend-tests.yml @@ -24,7 +24,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '16' + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" @@ -62,7 +62,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '16' + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" diff --git a/.github/workflows/te-review.yml b/.github/workflows/te-review.yml index a1fee5245a..da23cec1e2 100644 --- a/.github/workflows/te-review.yml +++ b/.github/workflows/te-review.yml @@ -247,7 +247,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '16' + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" diff --git a/.github/workflows/te-shared-frontend-tests.yml b/.github/workflows/te-shared-frontend-tests.yml index 1a38d7038e..6700d9c690 100644 --- a/.github/workflows/te-shared-frontend-tests.yml +++ b/.github/workflows/te-shared-frontend-tests.yml @@ -24,7 +24,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '16' + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" diff --git a/.github/workflows/te-yout-frontend-tests.yml b/.github/workflows/te-yout-frontend-tests.yml index 65592e4390..2bee662baa 100644 --- a/.github/workflows/te-yout-frontend-tests.yml +++ b/.github/workflows/te-yout-frontend-tests.yml @@ -24,7 +24,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '16' + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" @@ -62,7 +62,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '16' + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" diff --git a/.github/workflows/yarn-audit-scheduled.yml b/.github/workflows/yarn-audit-scheduled.yml index 0c567a606c..ad180fb4b5 100644 --- a/.github/workflows/yarn-audit-scheduled.yml +++ b/.github/workflows/yarn-audit-scheduled.yml @@ -20,7 +20,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '16' + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" diff --git a/README.md b/README.md index 069b3659cf..d0c542523d 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ This monorepo contains code for four different employment services: ## Requirements * Docker@^19.03.0 (or higher) -* NodeJS@^16.19.0 +* NodeJS@^18.16.0 * Yarn@^1.22 --- diff --git a/frontend/README.md b/frontend/README.md index 4449b17cdd..995cf0c4dc 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -9,14 +9,14 @@ Project is automatically deployed to testing environment when pushing to develop ## Requirements -- Node 16.x (match with dockerfile: helsinkitest/node:16-slim) +- Node 18.x (match with dockerfile: helsinkitest/node:16-slim) - Yarn - Git - Docker ### install node with nvm - nvm install 16 --lts + nvm install 18 --lts ## Available Scripts diff --git a/frontend/benefit/README.md b/frontend/benefit/README.md index 1195083cea..8c5e20efe5 100644 --- a/frontend/benefit/README.md +++ b/frontend/benefit/README.md @@ -9,7 +9,7 @@ Project is automatically deployed to testing environment when pushing to develop ## Requirements -- Node 16.x +- Node 18.x - Lerna - Yarn - Git @@ -18,8 +18,8 @@ Project is automatically deployed to testing environment when pushing to develop ### Install NodeJS # Use node manager (n or nvm, for example) - n 16 - nvm install 16 --lts + n 18 + nvm install 18 --lts # Alternative methods https://nodejs.org/dist/ https://nodejs.org/en/download/package-manager diff --git a/frontend/kesaseteli/README.md b/frontend/kesaseteli/README.md index 9b0c8aaa8c..4819339fa1 100644 --- a/frontend/kesaseteli/README.md +++ b/frontend/kesaseteli/README.md @@ -19,7 +19,7 @@ Project is automatically deployed to testing environment when pushing to develop ## Requirements -- Node 16.x +- Node 18.x - Lerna - Yarn - Git @@ -27,7 +27,7 @@ Project is automatically deployed to testing environment when pushing to develop ### install node with nvm - nvm install 16 --lts + nvm install 18 --lts ## Available Scripts diff --git a/frontend/package.json b/frontend/package.json index b347873500..762a5ff76f 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -11,7 +11,7 @@ "shared" ], "engines" : { - "node" : ">=16.19.0 <17.0.0" + "node" : ">=18.16.0 <19.0.0" }, "scripts": { "audit": "npx lerna-audit --level=high --groups=dependencies", @@ -82,7 +82,7 @@ "@types/jest": "^27.4.0", "@types/jest-axe": "^3.5.3", "@types/leaflet": "^1.7.9", - "@types/node": "^17.0.43", + "@types/node": "^18.16.0", "@types/pretty": "^2.0.1", "@types/react-input-mask": "2.0.5", "@types/react-leaflet": "^2.8.2", diff --git a/package.json b/package.json index 484b0a4420..5ee113596b 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "husky": "^8.0.3" }, "engines" : { - "node" : ">=16.19.0 <17.0.0" + "node" : ">=18.16.0 <17.0.0" }, "scripts": { "prepare": "husky install", From 3290d9de9ca6609c7f34c0b5dbdc9e2f14403e9d Mon Sep 17 00:00:00 2001 From: Sampo Tawast Date: Thu, 4 May 2023 09:25:16 +0300 Subject: [PATCH 02/11] Bump docker images to Node v18 --- frontend/Dockerfile | 4 ++-- frontend/README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/Dockerfile b/frontend/Dockerfile index e3efeefc75..aab2783340 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,5 +1,5 @@ # ======================================= -FROM helsinkitest/node:16-slim as appbase +FROM helsinkitest/node:18-slim as appbase # ======================================= # Install ca-certificates so that Sentry can upload source maps @@ -99,7 +99,7 @@ RUN rm -rf node_modules RUN yarn cache clean # ========================================== -FROM helsinkitest/node:16-slim AS production +FROM helsinkitest/node:18-slim AS production # ========================================== ARG PORT diff --git a/frontend/README.md b/frontend/README.md index 995cf0c4dc..bdb33d3ef5 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -9,7 +9,7 @@ Project is automatically deployed to testing environment when pushing to develop ## Requirements -- Node 18.x (match with dockerfile: helsinkitest/node:16-slim) +- Node 18.x (match with dockerfile: helsinkitest/node:18-slim) - Yarn - Git - Docker From e8c3e597c50538f964173334a8c0be5d3292d7d0 Mon Sep 17 00:00:00 2001 From: Sampo Tawast Date: Thu, 4 May 2023 09:27:05 +0300 Subject: [PATCH 03/11] Update yarn.lock --- frontend/yarn.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 4fde9cd69e..791e21d04f 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -3336,10 +3336,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.47.tgz#ca9237d51f2a2557419688511dab1c8daf475188" integrity sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg== -"@types/node@^17.0.43": - version "17.0.43" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.43.tgz#7f16898cdd791c9d64069000ad448b47b3ca8353" - integrity sha512-jnUpgw8fL9kP2iszfIDyBQtw5Mf4/XSqy0Loc1J9pI14ejL83XcCEvSf50Gs/4ET0I9VCCDoOfufQysj0S66xA== +"@types/node@^18.16.0": + version "18.16.3" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.16.3.tgz#6bda7819aae6ea0b386ebc5b24bdf602f1b42b01" + integrity sha512-OPs5WnnT1xkCBiuQrZA4+YAV4HEJejmHneyraIaxsbev5yCEr6KMwINNFP9wQeFIw8FWcoTqF3vQsa5CDaI+8Q== "@types/normalize-package-data@^2.4.0": version "2.4.1" From d5b19cee4358e43ec9e3ba60eee56f58e48b3ba8 Mon Sep 17 00:00:00 2001 From: Sampo Tawast Date: Thu, 4 May 2023 09:27:51 +0300 Subject: [PATCH 04/11] Fix 'node smaller than 17' issue --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5ee113596b..45b1917ac5 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "husky": "^8.0.3" }, "engines" : { - "node" : ">=18.16.0 <17.0.0" + "node" : ">=18.16.0 <19.0.0" }, "scripts": { "prepare": "husky install", From 489d31dd109116c6b73ce3dc035979bbfb2e06c6 Mon Sep 17 00:00:00 2001 From: Sampo Tawast Date: Fri, 19 May 2023 15:03:19 +0300 Subject: [PATCH 05/11] Fix builds by using webpack with --openssl-legacy-provider --- frontend/Dockerfile | 2 +- frontend/package.json | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/frontend/Dockerfile b/frontend/Dockerfile index aab2783340..beb351fee0 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -92,7 +92,7 @@ COPY --chown=appuser:appuser . . # Build application WORKDIR /app/$PROJECT/$FOLDER/ -RUN yarn build +RUN NODE_OPTIONS=--openssl-legacy-provider yarn build # Clean all dependencies (this should avoid caching + missing /pages directory problem) RUN rm -rf node_modules diff --git a/frontend/package.json b/frontend/package.json index 762a5ff76f..67bfa1c2b6 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -16,11 +16,11 @@ "scripts": { "audit": "npx lerna-audit --level=high --groups=dependencies", "build": "npx lerna run build", - "ks-empl:build": "npx lerna run --scope @frontend/employer --stream build", - "ks-hdlr:build": "npx lerna run --scope @frontend/ks-handler --stream build", - "ks-youth:build": "npx lerna run --scope @frontend/youth --stream build", - "bf-appl:build": "npx lerna run --scope @frontend/applicant --stream build", - "bf-hdlr:build": "npx lerna run --scope @frontend/bf-handler --stream build", + "ks-empl:build": "cross-env NODE_OPTIONS=--openssl-legacy-provider npx lerna run --scope @frontend/employer --stream build", + "ks-hdlr:build": "cross-env NODE_OPTIONS=--openssl-legacy-provider npx lerna run --scope @frontend/ks-handler --stream build", + "ks-youth:build": "cross-env NODE_OPTIONS=--openssl-legacy-provider npx lerna run --scope @frontend/youth --stream build", + "bf-appl:build": "cross-env NODE_OPTIONS=--openssl-legacy-provider npx lerna run --scope @frontend/applicant --stream build", + "bf-hdlr:build": "cross-env NODE_OPTIONS=--openssl-legacy-provider npx lerna run --scope @frontend/bf-handler --stream build", "ks-empl:dev": "npx lerna run --scope @frontend/employer --stream dev", "ks-hdlr:dev": "npx lerna run --scope @frontend/ks-handler --stream dev", "ks-youth:dev": "npx lerna run --scope @frontend/youth --stream dev", @@ -50,13 +50,13 @@ "ks-youth:browser-test:ci": "yarn --cwd kesaseteli/youth browser-test:ci", "shared:test": " yarn --cwd shared test", "ks-shared:test": " yarn --cwd kesaseteli/shared test", - "te-admin:build": "npx lerna run --scope @frontend/te-admin --stream build", + "te-admin:build": "cross-env NODE_OPTIONS=--openssl-legacy-provider npx lerna run --scope @frontend/te-admin --stream build", "te-admin:dev": "npx lerna run --scope @frontend/te-admin --stream dev", "te-admin:start": "npx lerna run --scope @frontend/te-admin --stream start", "te-admin:test": " yarn --cwd tet/admin test", "te-admin:browser-test": "yarn --cwd tet/admin browser-test", "te-admin:browser-test:ci": "yarn --cwd tet/admin browser-test:ci", - "te-youth:build": "npx lerna run --scope @frontend/te-youth --stream build", + "te-youth:build": "cross-env NODE_OPTIONS=--openssl-legacy-provider npx lerna run --scope @frontend/te-youth --stream build", "te-youth:dev": "npx lerna run --scope @frontend/te-youth --stream dev", "te-youth:start": "npx lerna run --scope @frontend/te-youth --stream start", "te-youth:test": " yarn --cwd tet/youth test", From 62d06fafe28d8bd6ba8bb7d2495613efc69b8740 Mon Sep 17 00:00:00 2001 From: Sampo Tawast Date: Fri, 19 May 2023 15:08:44 +0300 Subject: [PATCH 06/11] Use webpack's --openssl-legacy-provider option in GH actions --- .github/workflows/bf-applicant-frontend-tests.yml | 2 +- .github/workflows/bf-handler-frontend-tests.yml | 2 +- .github/workflows/ks-empl-frontend-tests.yml | 14 +++++++------- .github/workflows/ks-handler-frontend-tests.yml | 14 +++++++------- .github/workflows/ks-youth-frontend-tests.yml | 14 +++++++------- .github/workflows/te-admn-frontend-tests.yml | 12 ++++++------ .github/workflows/te-yout-frontend-tests.yml | 12 ++++++------ 7 files changed, 35 insertions(+), 35 deletions(-) diff --git a/.github/workflows/bf-applicant-frontend-tests.yml b/.github/workflows/bf-applicant-frontend-tests.yml index c4d28edb66..6c3326332f 100644 --- a/.github/workflows/bf-applicant-frontend-tests.yml +++ b/.github/workflows/bf-applicant-frontend-tests.yml @@ -68,4 +68,4 @@ jobs: - name: Check that building dev application works env: NEXTJS_DISABLE_SENTRY: true - run: yarn build + run: NODE_OPTIONS=--openssl-legacy-provider yarn build diff --git a/.github/workflows/bf-handler-frontend-tests.yml b/.github/workflows/bf-handler-frontend-tests.yml index c8e1103c96..9596a69797 100644 --- a/.github/workflows/bf-handler-frontend-tests.yml +++ b/.github/workflows/bf-handler-frontend-tests.yml @@ -68,4 +68,4 @@ jobs: - name: Check that building dev application works env: NEXTJS_DISABLE_SENTRY: true - run: yarn build + run: NODE_OPTIONS=--openssl-legacy-provider yarn build diff --git a/.github/workflows/ks-empl-frontend-tests.yml b/.github/workflows/ks-empl-frontend-tests.yml index d3dc1ecb88..b6e75f0e5a 100644 --- a/.github/workflows/ks-empl-frontend-tests.yml +++ b/.github/workflows/ks-empl-frontend-tests.yml @@ -2,14 +2,14 @@ name: (KS Employer) Frontend Lint, Unit and Component tests on: push: - branches: [ develop, main ] + branches: [develop, main] pull_request: paths: - - 'frontend/shared/**' - - 'frontend/kesaseteli/shared/**' - - 'frontend/kesaseteli/employer/**' - - 'frontend/*' - - '.github/workflows/ks-empl-frontend-tests.yml' + - "frontend/shared/**" + - "frontend/kesaseteli/shared/**" + - "frontend/kesaseteli/employer/**" + - "frontend/*" + - ".github/workflows/ks-empl-frontend-tests.yml" - "!**/browser-tests/**" - "!**/README.md" workflow_dispatch: @@ -79,7 +79,7 @@ jobs: - name: Check that building dev application works env: NEXTJS_DISABLE_SENTRY: true - run: yarn build + run: NODE_OPTIONS=--openssl-legacy-provider yarn build - name: Frontend build failure slack notification uses: rtCamp/action-slack-notify@v2 env: diff --git a/.github/workflows/ks-handler-frontend-tests.yml b/.github/workflows/ks-handler-frontend-tests.yml index f91a288813..aae9af617d 100644 --- a/.github/workflows/ks-handler-frontend-tests.yml +++ b/.github/workflows/ks-handler-frontend-tests.yml @@ -2,14 +2,14 @@ name: (KS Handler) Frontend Lint, Unit and Component tests on: push: - branches: [ develop, main ] + branches: [develop, main] pull_request: paths: - - 'frontend/shared/**' - - 'frontend/kesaseteli/shared/**' - - 'frontend/kesaseteli/handler/**' - - 'frontend/*' - - '.github/workflows/ks-handler-frontend-tests.yml' + - "frontend/shared/**" + - "frontend/kesaseteli/shared/**" + - "frontend/kesaseteli/handler/**" + - "frontend/*" + - ".github/workflows/ks-handler-frontend-tests.yml" - "!**/browser-tests/**" - "!**/README.md" workflow_dispatch: @@ -79,7 +79,7 @@ jobs: - name: Check that building dev application works env: NEXTJS_DISABLE_SENTRY: true - run: yarn build + run: NODE_OPTIONS=--openssl-legacy-provider yarn build - name: Frontend build failure slack notification uses: rtCamp/action-slack-notify@v2 env: diff --git a/.github/workflows/ks-youth-frontend-tests.yml b/.github/workflows/ks-youth-frontend-tests.yml index d6da1681db..8ba667154d 100644 --- a/.github/workflows/ks-youth-frontend-tests.yml +++ b/.github/workflows/ks-youth-frontend-tests.yml @@ -2,14 +2,14 @@ name: (KS Youth) Frontend Lint, Unit and Component tests on: push: - branches: [ develop, main ] + branches: [develop, main] pull_request: paths: - - 'frontend/shared/**' - - 'frontend/kesaseteli/shared/**' - - 'frontend/kesaseteli/youth/**' - - 'frontend/*' - - '.github/workflows/ks-youth-frontend-tests.yml' + - "frontend/shared/**" + - "frontend/kesaseteli/shared/**" + - "frontend/kesaseteli/youth/**" + - "frontend/*" + - ".github/workflows/ks-youth-frontend-tests.yml" - "!**/browser-tests/**" - "!**/README.md" workflow_dispatch: @@ -79,7 +79,7 @@ jobs: - name: Check that building dev application works env: NEXTJS_DISABLE_SENTRY: true - run: yarn build + run: NODE_OPTIONS=--openssl-legacy-provider yarn build - name: Frontend build failure slack notification uses: rtCamp/action-slack-notify@v2 env: diff --git a/.github/workflows/te-admn-frontend-tests.yml b/.github/workflows/te-admn-frontend-tests.yml index ecee92a43c..9b8b1a4143 100644 --- a/.github/workflows/te-admn-frontend-tests.yml +++ b/.github/workflows/te-admn-frontend-tests.yml @@ -2,13 +2,13 @@ name: (TET) Admin Frontend Lint, Unit and Component tests on: push: - branches: [ develop, main ] + branches: [develop, main] pull_request: paths: - - 'frontend/shared/**' - - 'frontend/tet/admin/**' - - 'frontend/*' - - '.github/workflows/te-admn-frontend-tests.yml' + - "frontend/shared/**" + - "frontend/tet/admin/**" + - "frontend/*" + - ".github/workflows/te-admn-frontend-tests.yml" - "!**/browser-tests/**" - "!**/README.md" workflow_dispatch: @@ -78,7 +78,7 @@ jobs: - name: Check that building dev application works env: NEXTJS_DISABLE_SENTRY: true - run: yarn build + run: NODE_OPTIONS=--openssl-legacy-provider yarn build - name: Frontend build failure slack notification uses: rtCamp/action-slack-notify@v2 env: diff --git a/.github/workflows/te-yout-frontend-tests.yml b/.github/workflows/te-yout-frontend-tests.yml index 2bee662baa..989b9b13ff 100644 --- a/.github/workflows/te-yout-frontend-tests.yml +++ b/.github/workflows/te-yout-frontend-tests.yml @@ -2,13 +2,13 @@ name: (TET) Youth Frontend Lint, Unit and Component tests on: push: - branches: [ develop, main ] + branches: [develop, main] pull_request: paths: - - 'frontend/shared/**' - - 'frontend/*' - - 'frontend/tet/**' - - '.github/workflows/te-yout-frontend-tests.yml' + - "frontend/shared/**" + - "frontend/*" + - "frontend/tet/**" + - ".github/workflows/te-yout-frontend-tests.yml" - "!**/browser-tests/**" - "!**/README.md" workflow_dispatch: @@ -78,7 +78,7 @@ jobs: - name: Check that building dev application works env: NEXTJS_DISABLE_SENTRY: true - run: yarn build + run: NODE_OPTIONS=--openssl-legacy-provider yarn build - name: Frontend build failure slack notification uses: rtCamp/action-slack-notify@v2 env: From b7c1abd414fba2b8f83b804830bf71c52de8991d Mon Sep 17 00:00:00 2001 From: Sampo Tawast Date: Fri, 19 May 2023 16:47:59 +0300 Subject: [PATCH 07/11] TET: See if TypeScript errors can be dodged with older type definitions --- frontend/package.json | 2 +- frontend/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index 67bfa1c2b6..520152ce74 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -82,7 +82,7 @@ "@types/jest": "^27.4.0", "@types/jest-axe": "^3.5.3", "@types/leaflet": "^1.7.9", - "@types/node": "^18.16.0", + "@types/node": "^17.0.43", "@types/pretty": "^2.0.1", "@types/react-input-mask": "2.0.5", "@types/react-leaflet": "^2.8.2", diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 791e21d04f..cdd34ee442 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -3336,10 +3336,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.47.tgz#ca9237d51f2a2557419688511dab1c8daf475188" integrity sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg== -"@types/node@^18.16.0": - version "18.16.3" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.16.3.tgz#6bda7819aae6ea0b386ebc5b24bdf602f1b42b01" - integrity sha512-OPs5WnnT1xkCBiuQrZA4+YAV4HEJejmHneyraIaxsbev5yCEr6KMwINNFP9wQeFIw8FWcoTqF3vQsa5CDaI+8Q== +"@types/node@^17.0.43": + version "17.0.45" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.45.tgz#2c0fafd78705e7a18b7906b5201a522719dc5190" + integrity sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw== "@types/normalize-package-data@^2.4.0": version "2.4.1" From 698f2c1b6d1b4b72658fd1a2f6568d81febb25e4 Mon Sep 17 00:00:00 2001 From: Sampo Tawast Date: Mon, 22 May 2023 13:08:30 +0300 Subject: [PATCH 08/11] Add --NODE_OPTIONS=--openssl-legacy-provider to dockerfile too --- frontend/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/Dockerfile b/frontend/Dockerfile index beb351fee0..1bb73acc6e 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -38,7 +38,7 @@ FROM appbase as development # Set V8 max heap size to 2GB (default is 512MB) # This prevents Docker Compose from crashing due to out of memory errors -ENV NODE_OPTIONS="--max_old_space_size=2048" +ENV NODE_OPTIONS="--max_old_space_size=2048 --openssl-legacy-provider" ARG PROJECT ARG FOLDER @@ -102,6 +102,8 @@ RUN yarn cache clean FROM helsinkitest/node:18-slim AS production # ========================================== +ENV NODE_OPTIONS="--openssl-legacy-provider" + ARG PORT ARG PROJECT ARG FOLDER From ce8459b95e31e311ac98eea5bc4ec03a86a5066b Mon Sep 17 00:00:00 2001 From: Sampo Tawast Date: Tue, 23 May 2023 10:11:24 +0300 Subject: [PATCH 09/11] Revert 9646aba7, add @ts-ignore to rule out some issues with react-hook-form This reverts commit 9646aba74a47da766072ce1e303b8635ed619771. --- frontend/package.json | 2 +- frontend/tet/admin/src/components/editor/Editor.tsx | 13 ++++++++++--- .../admin/src/components/editor/HiddenIdInput.tsx | 5 +++++ .../admin/src/components/editor/SelectionGroup.tsx | 5 +++++ frontend/yarn.lock | 8 ++++---- 5 files changed, 25 insertions(+), 8 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index 520152ce74..67bfa1c2b6 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -82,7 +82,7 @@ "@types/jest": "^27.4.0", "@types/jest-axe": "^3.5.3", "@types/leaflet": "^1.7.9", - "@types/node": "^17.0.43", + "@types/node": "^18.16.0", "@types/pretty": "^2.0.1", "@types/react-input-mask": "2.0.5", "@types/react-leaflet": "^2.8.2", diff --git a/frontend/tet/admin/src/components/editor/Editor.tsx b/frontend/tet/admin/src/components/editor/Editor.tsx index 8ca77bdd05..db1197d655 100644 --- a/frontend/tet/admin/src/components/editor/Editor.tsx +++ b/frontend/tet/admin/src/components/editor/Editor.tsx @@ -23,6 +23,13 @@ export type EditorSectionProps = { initialValue: TetPosting; }; +// Known issue with react-hook-form library, errors out with: +// Type of property 'prototype' circularly references itself in mapped type '{ [K in keyof Blob]-?: PathImpl; }'. +// More at: https://github.com/orgs/react-hook-form/discussions/7764 + +// @ts-ignore +const RenderHiddenIdInput = (id: string, value: string): JSXElement => ; + // add new posting / edit existing const Editor: React.FC = ({ initialValue, isNewPosting = false }) => { const { t } = useTranslation(); @@ -38,9 +45,9 @@ const Editor: React.FC = ({ initialValue, isNewPosting = false }) = return (
- - - + {RenderHiddenIdInput('id', initialValue?.id)} + {RenderHiddenIdInput('image_url', initialValue?.image_url)} + {RenderHiddenIdInput('image_id', initialValue?.image_id)}

* {t('common:editor.requiredInfo')}

diff --git a/frontend/tet/admin/src/components/editor/HiddenIdInput.tsx b/frontend/tet/admin/src/components/editor/HiddenIdInput.tsx index 71f53a8e12..2dd763e7a7 100644 --- a/frontend/tet/admin/src/components/editor/HiddenIdInput.tsx +++ b/frontend/tet/admin/src/components/editor/HiddenIdInput.tsx @@ -3,6 +3,11 @@ import { useFormContext } from 'react-hook-form'; import InputProps from 'shared/types/input-props'; import TetPosting from 'tet-shared/types/tetposting'; +// Known issue with react-hook-form library, errors out with: +// Type of property 'prototype' circularly references itself in mapped type '{ [K in keyof Blob]-?: PathImpl; }'. +// More at: https://github.com/orgs/react-hook-form/discussions/7764 + +// @ts-ignore const HiddenIdInput: React.FC> = ({ id, initialValue }) => { const { register } = useFormContext(); return ; diff --git a/frontend/tet/admin/src/components/editor/SelectionGroup.tsx b/frontend/tet/admin/src/components/editor/SelectionGroup.tsx index 7a70e86fd7..1284a744e1 100644 --- a/frontend/tet/admin/src/components/editor/SelectionGroup.tsx +++ b/frontend/tet/admin/src/components/editor/SelectionGroup.tsx @@ -34,6 +34,11 @@ const SelectionGroup: React.FC = ({ fieldId, label, options, required, ru }; return ( + // Known issue with react-hook-form library, errors out with: + // Type of property 'prototype' circularly references itself in mapped type '{ [K in keyof Blob]-?: PathImpl; }'. + // More at: https://github.com/orgs/react-hook-form/discussions/7764 + + // @ts-ignore Date: Mon, 26 Jun 2023 13:34:50 +0300 Subject: [PATCH 10/11] fix: wrong cwd for bf-handler ran all project's tests --- frontend/package.json | 6 +++--- package.json | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index 67bfa1c2b6..056830de02 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -10,8 +10,8 @@ "tet/*", "shared" ], - "engines" : { - "node" : ">=18.16.0 <19.0.0" + "engines": { + "node": ">=18.16.0 <19.0.0" }, "scripts": { "audit": "npx lerna-audit --level=high --groups=dependencies", @@ -39,7 +39,7 @@ "test:staged": "npx lerna run test:staged", "test:coverage": "npx lerna run test:coverage --stream --concurrency 1", "bf-appl:test": "yarn --cwd benefit/applicant test", - "bf-hdlr:test": "yarn --cwd benefit/bf-handler test", + "bf-hdlr:test": "yarn --cwd benefit/handler test", "bf-appl:browser-test": "yarn --cwd benefit/applicant browser-test", "bf-appl:browser-test:ci": "yarn --cwd benefit/applicant browser-test:ci", "ks-empl:test": " yarn --cwd kesaseteli/employer test", diff --git a/package.json b/package.json index 45b1917ac5..3f53dc9d16 100644 --- a/package.json +++ b/package.json @@ -3,12 +3,12 @@ "cross-env": "^7.0.3", "husky": "^8.0.3" }, - "engines" : { - "node" : ">=18.16.0 <19.0.0" + "engines": { + "node": ">=18.16.0 <19.0.0" }, "scripts": { "prepare": "husky install", - "// clean: stop and remove docker containers and database volume" : "", + "// clean: stop and remove docker containers and database volume": "", "clean": "docker compose -f compose.handler.yml down --remove-orphans; docker compose -f compose.employer.yml down --remove-orphans; docker compose -f compose.benefit.yml down --remove-orphans; docker rm -f $(docker ps -a -q); docker volume rm $(docker volume ls -q);", "// partial docker compose commands per service, dont use these straight. Use :up, :build or :rebuild instead ": "", "benefit": "cross-env COMPOSE_HTTP_TIMEOUT=200 docker compose -f compose.benefit.yml", From e3f9e0d8d64731107ff649a7a071d2cee7edb51c Mon Sep 17 00:00:00 2001 From: Sampo Tawast Date: Thu, 10 Aug 2023 14:21:46 +0300 Subject: [PATCH 11/11] disable eslint that nags of @ts-ignore --- frontend/tet/admin/src/components/editor/DateInput.tsx | 5 +++++ frontend/tet/admin/src/components/editor/Editor.tsx | 1 + frontend/tet/admin/src/components/editor/HiddenIdInput.tsx | 1 + frontend/tet/admin/src/components/editor/SelectionGroup.tsx | 1 + frontend/tet/admin/src/components/editor/TextArea.tsx | 5 +++++ frontend/tet/admin/src/components/editor/TextInput.tsx | 5 +++++ 6 files changed, 18 insertions(+) diff --git a/frontend/tet/admin/src/components/editor/DateInput.tsx b/frontend/tet/admin/src/components/editor/DateInput.tsx index bb7703b7d4..ca89c6d12d 100644 --- a/frontend/tet/admin/src/components/editor/DateInput.tsx +++ b/frontend/tet/admin/src/components/editor/DateInput.tsx @@ -6,7 +6,12 @@ import { Language } from 'shared/i18n/i18n'; import Id from 'shared/types/id'; import TetPosting from 'tet-shared/types/tetposting'; +// Known issue with react-hook-form library, errors out with: +// Type of property 'prototype' circularly references itself in mapped type '{ [K in keyof Blob]-?: PathImpl; }'. +// More at: https://github.com/orgs/react-hook-form/discussions/7764 type Props = { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore id: Id; label: string; registerOptions?: RegisterOptions; diff --git a/frontend/tet/admin/src/components/editor/Editor.tsx b/frontend/tet/admin/src/components/editor/Editor.tsx index db1197d655..cb8dfa3cd1 100644 --- a/frontend/tet/admin/src/components/editor/Editor.tsx +++ b/frontend/tet/admin/src/components/editor/Editor.tsx @@ -27,6 +27,7 @@ export type EditorSectionProps = { // Type of property 'prototype' circularly references itself in mapped type '{ [K in keyof Blob]-?: PathImpl; }'. // More at: https://github.com/orgs/react-hook-form/discussions/7764 +// eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore const RenderHiddenIdInput = (id: string, value: string): JSXElement => ; diff --git a/frontend/tet/admin/src/components/editor/HiddenIdInput.tsx b/frontend/tet/admin/src/components/editor/HiddenIdInput.tsx index 2dd763e7a7..bfae1707fa 100644 --- a/frontend/tet/admin/src/components/editor/HiddenIdInput.tsx +++ b/frontend/tet/admin/src/components/editor/HiddenIdInput.tsx @@ -7,6 +7,7 @@ import TetPosting from 'tet-shared/types/tetposting'; // Type of property 'prototype' circularly references itself in mapped type '{ [K in keyof Blob]-?: PathImpl; }'. // More at: https://github.com/orgs/react-hook-form/discussions/7764 +// eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore const HiddenIdInput: React.FC> = ({ id, initialValue }) => { const { register } = useFormContext(); diff --git a/frontend/tet/admin/src/components/editor/SelectionGroup.tsx b/frontend/tet/admin/src/components/editor/SelectionGroup.tsx index 1284a744e1..60663bd276 100644 --- a/frontend/tet/admin/src/components/editor/SelectionGroup.tsx +++ b/frontend/tet/admin/src/components/editor/SelectionGroup.tsx @@ -38,6 +38,7 @@ const SelectionGroup: React.FC = ({ fieldId, label, options, required, ru // Type of property 'prototype' circularly references itself in mapped type '{ [K in keyof Blob]-?: PathImpl; }'. // More at: https://github.com/orgs/react-hook-form/discussions/7764 + // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore ; }'. +// More at: https://github.com/orgs/react-hook-form/discussions/7764 type Props = { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore id: Id; testId?: string; label: string; diff --git a/frontend/tet/admin/src/components/editor/TextInput.tsx b/frontend/tet/admin/src/components/editor/TextInput.tsx index 50172eaac0..8c974ccfc6 100644 --- a/frontend/tet/admin/src/components/editor/TextInput.tsx +++ b/frontend/tet/admin/src/components/editor/TextInput.tsx @@ -4,7 +4,12 @@ import { Controller, RegisterOptions, useFormContext } from 'react-hook-form'; import Id from 'shared/types/id'; import TetPosting from 'tet-shared/types/tetposting'; +// Known issue with react-hook-form library, errors out with: +// Type of property 'prototype' circularly references itself in mapped type '{ [K in keyof Blob]-?: PathImpl; }'. +// More at: https://github.com/orgs/react-hook-form/discussions/7764 type Props = { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore id: Id; label: string; placeholder: string;