From e6dade353340a5c70825720cfda1fad2e1b24529 Mon Sep 17 00:00:00 2001 From: Daniel Benton Date: Tue, 16 Jan 2024 11:03:29 +0000 Subject: [PATCH 1/8] MAP-577 Add Prison Relocation options, bump node/npm versions --- .circleci/config.yml | 4 ++-- package-lock.json | 4 ++-- package.json | 4 ++-- server/config/types.ts | 3 +++ 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6ef09993..9d40ced9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,13 +14,13 @@ parameters: node-version: type: string - default: 18.17.1-browsers + default: 21.5.0-browsers executors: integration-tests: docker: - image: cimg/node:<< pipeline.parameters.node-version >> - - image: circleci/postgres:10.13-ram + - image: circleci/postgres:14.7-ram environment: POSTGRES_PASSWORD: use-of-force POSTGRES_USER: use-of-force diff --git a/package-lock.json b/package-lock.json index 9ec42887..6d71572d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -92,8 +92,8 @@ "typescript": "^4.9.5" }, "engines": { - "node": "^18", - "npm": "<10" + "node": "^21", + "npm": "^10" } }, "node_modules/@aashutoshrathi/word-wrap": { diff --git a/package.json b/package.json index 4419b30e..b32b34a9 100644 --- a/package.json +++ b/package.json @@ -29,8 +29,8 @@ "security_audit": "npx audit-ci --config audit-ci.json" }, "engines": { - "node": "^18", - "npm": "<10" + "node": "^21", + "npm": "^10" }, "jest": { "transform": { diff --git a/server/config/types.ts b/server/config/types.ts index 3a027b69..6cf67130 100644 --- a/server/config/types.ts +++ b/server/config/types.ts @@ -43,6 +43,9 @@ export const RelocationLocation = toEnum({ SEGREGATION_UNIT: { value: 'SEGREGATION_UNIT', label: 'Segregation unit' }, SPECIAL_ACCOMMODATION: { value: 'SPECIAL_ACCOMMODATION', label: 'Special accommodation' }, CELLULAR_VEHICLE: { value: 'CELLULAR_VEHICLE', label: 'Cellular vehicle' }, + RECEPTION: { value: 'RECEPTION', label: 'Reception' }, + OTHER_WING: { value: 'OTHER_WING', label: 'Other wing' }, + FACILITATE_RELEASE: { value: 'FACILITATE_RELEASE', label: 'To facilitate release' }, }) export const ReportStatus = toEnum({ From 6d95028a2779636c1788a716bc8d8b2de30645ae Mon Sep 17 00:00:00 2001 From: Daniel Benton Date: Tue, 16 Jan 2024 11:06:25 +0000 Subject: [PATCH 2/8] MAP-577 Bump npm in circle pipeline --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9d40ced9..937b8d04 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -39,7 +39,7 @@ jobs: - checkout - run: name: Update npm - command: 'sudo npm install -g npm@9' + command: 'sudo npm install -g npm@10' - restore_cache: key: dependency-cache-{{ checksum "package-lock.json" }} - run: From a41833e87fe08c16f07b61a25a707bd621f0f5e7 Mon Sep 17 00:00:00 2001 From: Daniel Benton Date: Tue, 16 Jan 2024 11:19:34 +0000 Subject: [PATCH 3/8] MAP-577 Fix postgres version in circle pipeline --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 937b8d04..da449f22 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,7 +20,7 @@ executors: integration-tests: docker: - image: cimg/node:<< pipeline.parameters.node-version >> - - image: circleci/postgres:14.7-ram + - image: cimg/postgres:14.7 environment: POSTGRES_PASSWORD: use-of-force POSTGRES_USER: use-of-force From d8b206edd6a691cca7ffae8a416c69504d6b01d6 Mon Sep 17 00:00:00 2001 From: Daniel Benton Date: Tue, 16 Jan 2024 11:24:12 +0000 Subject: [PATCH 4/8] MAP-577 Update assertion messge on invalid json --- server/routes/maintainingReports/admin.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/routes/maintainingReports/admin.test.ts b/server/routes/maintainingReports/admin.test.ts index a3265ddb..1a2bfcf7 100644 --- a/server/routes/maintainingReports/admin.test.ts +++ b/server/routes/maintainingReports/admin.test.ts @@ -142,7 +142,7 @@ describe('/:reportId/edit-report', () => { expect(reportService.update).not.toHaveBeenCalled() expect(flash).toHaveBeenCalledWith('errors', { href: '#form', - text: 'Unexpected token h in JSON at position 1', + text: "Unexpected token 'h', \"this isn't json!\" is not valid JSON", }) }) }) From 70b4e5d7ada2c401f2b55f4d2efad51579e574f1 Mon Sep 17 00:00:00 2001 From: Daniel Benton Date: Tue, 16 Jan 2024 11:30:01 +0000 Subject: [PATCH 5/8] MAP-577 Update node in Dockerfile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index cd5f2538..4ba8cbe8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:18.17.1 as builder +FROM node:21.5.0 as builder ARG BUILD_NUMBER ARG GIT_REF @@ -24,7 +24,7 @@ RUN CYPRESS_INSTALL_BINARY=0 npm ci --no-audit && \ RUN npm prune --production -FROM node:18.17.1-slim +FROM node:21.5.0-slim LABEL maintainer="HMPPS Digital Studio " # Cache breaking From 430d3eb75337e2eca4c1880da1b0b29ec4906744 Mon Sep 17 00:00:00 2001 From: Daniel Benton Date: Tue, 16 Jan 2024 16:00:14 +0000 Subject: [PATCH 6/8] MAP-577 Node 20 --- Dockerfile | 4 ++-- README.md | 2 +- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4ba8cbe8..28d3b328 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:21.5.0 as builder +FROM node:20.11.0 as builder ARG BUILD_NUMBER ARG GIT_REF @@ -24,7 +24,7 @@ RUN CYPRESS_INSTALL_BINARY=0 npm ci --no-audit && \ RUN npm prune --production -FROM node:21.5.0-slim +FROM node:20.11.0-slim LABEL maintainer="HMPPS Digital Studio " # Cache breaking diff --git a/README.md b/README.md index 1f043648..5f477b6f 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ The easiest way to run the app is to use docker compose to start local postgres `docker-compose pull` `docker-compose up` -Install dependencies using `npm install`, ensuring you are using >= `Node v16` +Install dependencies using `npm install`, ensuring you are using >= `Node v20` And then, to build the assets and start the app with nodemon: `npm run start:dev` diff --git a/package.json b/package.json index b32b34a9..580a2e27 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "security_audit": "npx audit-ci --config audit-ci.json" }, "engines": { - "node": "^21", + "node": "^20", "npm": "^10" }, "jest": { From d8ab811ee0ae854927fabdcfceb8c840700c09e5 Mon Sep 17 00:00:00 2001 From: Daniel Benton Date: Tue, 16 Jan 2024 16:03:17 +0000 Subject: [PATCH 7/8] package-lock.json --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 6d71572d..aeabd236 100644 --- a/package-lock.json +++ b/package-lock.json @@ -92,7 +92,7 @@ "typescript": "^4.9.5" }, "engines": { - "node": "^21", + "node": "^20", "npm": "^10" } }, From fff4985a96f68fbaa7ed3764f9cbacc5c0d08f74 Mon Sep 17 00:00:00 2001 From: Daniel Benton Date: Tue, 16 Jan 2024 16:05:07 +0000 Subject: [PATCH 8/8] MAP-577 Fix pipeline node version --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index da449f22..0ea499e0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,7 +14,7 @@ parameters: node-version: type: string - default: 21.5.0-browsers + default: 20.11.0-browsers executors: integration-tests: