Browse Source

Merge pull request #7556 from overleaf/em-finish-node-16

Finish Node 16 upgrade

GitOrigin-RevId: 03e5a54e4b17f43142ff78f5b4cca4d0dbefe6eb
Eric Mc Sween 4 years ago
parent
commit
eb4764e777

+ 1 - 1
services/contacts/.nvmrc

@@ -1 +1 @@
-14.18.3
+16.14.2

+ 1 - 1
services/contacts/Dockerfile

@@ -2,7 +2,7 @@
 # Instead run bin/update_build_scripts from
 # https://github.com/sharelatex/sharelatex-dev-environment
 
-FROM gcr.io/overleaf-ops/node:14.18.3 as base
+FROM node:16.14.2 as base
 
 WORKDIR /overleaf/services/contacts
 

+ 1 - 1
services/contacts/Makefile

@@ -30,7 +30,7 @@ HERE=$(shell pwd)
 MONOREPO=$(shell cd ../../ && pwd)
 # Run the linting commands in the scope of the monorepo.
 # Eslint and prettier (plus some configs) are on the root.
-RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) gcr.io/overleaf-ops/node:14.18.3 npm run --silent
+RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) node:16.14.2 npm run --silent
 
 format:
 	$(RUN_LINTING) format

+ 1 - 2
services/contacts/buildscript.txt

@@ -3,7 +3,6 @@ contacts
 --docker-repos=gcr.io/overleaf-ops
 --env-add=
 --env-pass-through=
---node-image=gcr.io/overleaf-ops/node
---node-version=14.18.3
+--node-version=16.14.2
 --public-repo=False
 --script-version=4.1.0

+ 2 - 2
services/contacts/docker-compose.yml

@@ -6,7 +6,7 @@ version: "2.3"
 
 services:
   test_unit:
-    image: gcr.io/overleaf-ops/node:14.18.3
+    image: node:16.14.2
     volumes:
       - .:/overleaf/services/contacts
       - ../../node_modules:/overleaf/node_modules
@@ -20,7 +20,7 @@ services:
     user: node
 
   test_acceptance:
-    image: gcr.io/overleaf-ops/node:14.18.3
+    image: node:16.14.2
     volumes:
       - .:/overleaf/services/contacts
       - ../../node_modules:/overleaf/node_modules

+ 1 - 1
services/notifications/.nvmrc

@@ -1 +1 @@
-14.18.3
+16.14.2

+ 1 - 1
services/notifications/Dockerfile

@@ -2,7 +2,7 @@
 # Instead run bin/update_build_scripts from
 # https://github.com/sharelatex/sharelatex-dev-environment
 
-FROM gcr.io/overleaf-ops/node:14.18.3 as base
+FROM node:16.14.2 as base
 
 WORKDIR /overleaf/services/notifications
 

+ 1 - 1
services/notifications/Makefile

@@ -30,7 +30,7 @@ HERE=$(shell pwd)
 MONOREPO=$(shell cd ../../ && pwd)
 # Run the linting commands in the scope of the monorepo.
 # Eslint and prettier (plus some configs) are on the root.
-RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) gcr.io/overleaf-ops/node:14.18.3 npm run --silent
+RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) node:16.14.2 npm run --silent
 
 format:
 	$(RUN_LINTING) format

+ 1 - 2
services/notifications/buildscript.txt

@@ -3,7 +3,6 @@ notifications
 --docker-repos=gcr.io/overleaf-ops
 --env-add=
 --env-pass-through=
---node-image=gcr.io/overleaf-ops/node
---node-version=14.18.3
+--node-version=16.14.2
 --public-repo=True
 --script-version=4.1.0

+ 2 - 2
services/notifications/docker-compose.yml

@@ -6,7 +6,7 @@ version: "2.3"
 
 services:
   test_unit:
-    image: gcr.io/overleaf-ops/node:14.18.3
+    image: node:16.14.2
     volumes:
       - .:/overleaf/services/notifications
       - ../../node_modules:/overleaf/node_modules
@@ -20,7 +20,7 @@ services:
     user: node
 
   test_acceptance:
-    image: gcr.io/overleaf-ops/node:14.18.3
+    image: node:16.14.2
     volumes:
       - .:/overleaf/services/notifications
       - ../../node_modules:/overleaf/node_modules

+ 1 - 1
services/real-time/.nvmrc

@@ -1 +1 @@
-14.18.3
+16.14.2

+ 1 - 1
services/real-time/Dockerfile

@@ -2,7 +2,7 @@
 # Instead run bin/update_build_scripts from
 # https://github.com/sharelatex/sharelatex-dev-environment
 
-FROM gcr.io/overleaf-ops/node:14.18.3 as base
+FROM node:16.14.2 as base
 
 WORKDIR /overleaf/services/real-time
 

+ 1 - 1
services/real-time/Makefile

@@ -30,7 +30,7 @@ HERE=$(shell pwd)
 MONOREPO=$(shell cd ../../ && pwd)
 # Run the linting commands in the scope of the monorepo.
 # Eslint and prettier (plus some configs) are on the root.
-RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) gcr.io/overleaf-ops/node:14.18.3 npm run --silent
+RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) node:16.14.2 npm run --silent
 
 format:
 	$(RUN_LINTING) format

+ 1 - 2
services/real-time/buildscript.txt

@@ -3,7 +3,6 @@ real-time
 --docker-repos=gcr.io/overleaf-ops
 --env-add=
 --env-pass-through=
---node-image=gcr.io/overleaf-ops/node
---node-version=14.18.3
+--node-version=16.14.2
 --public-repo=True
 --script-version=4.1.0

+ 2 - 2
services/real-time/docker-compose.yml

@@ -6,7 +6,7 @@ version: "2.3"
 
 services:
   test_unit:
-    image: gcr.io/overleaf-ops/node:14.18.3
+    image: node:16.14.2
     volumes:
       - .:/overleaf/services/real-time
       - ../../node_modules:/overleaf/node_modules
@@ -20,7 +20,7 @@ services:
     user: node
 
   test_acceptance:
-    image: gcr.io/overleaf-ops/node:14.18.3
+    image: node:16.14.2
     volumes:
       - .:/overleaf/services/real-time
       - ../../node_modules:/overleaf/node_modules

+ 1 - 1
services/spelling/.nvmrc

@@ -1 +1 @@
-14.18.3
+16.14.2

+ 1 - 1
services/spelling/Dockerfile

@@ -2,7 +2,7 @@
 # Instead run bin/update_build_scripts from
 # https://github.com/sharelatex/sharelatex-dev-environment
 
-FROM gcr.io/overleaf-ops/node:14.18.3 as base
+FROM node:16.14.2 as base
 
 WORKDIR /overleaf/services/spelling
 COPY services/spelling/install_deps.sh /overleaf/services/spelling/

+ 1 - 1
services/spelling/Makefile

@@ -30,7 +30,7 @@ HERE=$(shell pwd)
 MONOREPO=$(shell cd ../../ && pwd)
 # Run the linting commands in the scope of the monorepo.
 # Eslint and prettier (plus some configs) are on the root.
-RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) gcr.io/overleaf-ops/node:14.18.3 npm run --silent
+RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) node:16.14.2 npm run --silent
 
 format:
 	$(RUN_LINTING) format

+ 1 - 2
services/spelling/buildscript.txt

@@ -4,7 +4,6 @@ spelling
 --docker-repos=gcr.io/overleaf-ops
 --env-add=
 --env-pass-through=
---node-image=gcr.io/overleaf-ops/node
---node-version=14.18.3
+--node-version=16.14.2
 --public-repo=False
 --script-version=4.1.0

+ 1 - 9
services/spelling/install_deps.sh

@@ -2,19 +2,11 @@
 
 set -ex
 
-echo 'APT::Default-Release "stretch";' >/etc/apt/apt.conf.d/default-release
-
 # The following aspell packages exist in Ubuntu but not Debian:
 # aspell-af, aspell-id, aspell-nr, aspell-ns, aspell-st, aspell-tn, aspell-ts, aspell-xhu
 echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ focal main universe" > /etc/apt/sources.list.d/focal-amd.list
 echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ focal main universe" > /etc/apt/sources.list.d/focal-ports-arm.list
 apt-key adv --no-tty --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32
-# Need to install aspell-no from testing (buster) as broken in stable (stretch).
-echo "deb http://deb.debian.org/debian/ unstable main" > /etc/apt/sources.list.d/unstable.list
 
 apt-get update
-apt-get install -y aspell aspell-en aspell-af aspell-ar aspell-ar-large aspell-bg aspell-br aspell-ca aspell-cs aspell-cy aspell-da aspell-de aspell-de-alt aspell-el aspell-eo aspell-es aspell-et aspell-eu-es aspell-fa aspell-fo aspell-fr aspell-ga aspell-gl-minimos aspell-hr aspell-hsb aspell-id aspell-it aspell-kk aspell-ku aspell-lt aspell-lv aspell-nl aspell-nr aspell-ns  aspell-pa aspell-pl aspell-pt aspell-pt-br aspell-ro aspell-ru aspell-sk aspell-sl aspell-st aspell-sv aspell-tl aspell-tn aspell-ts aspell-xh
-
-printf 'Package: aspell-*\nPin: release a=unstable\nPin-Priority: 1337\n' \
-  > /etc/apt/preferences.d/aspell-from-unstable
-apt-get install aspell-no
+apt-get install -y aspell aspell-en aspell-af aspell-ar aspell-ar-large aspell-bg aspell-br aspell-ca aspell-cs aspell-cy aspell-da aspell-de aspell-de-1901 aspell-el aspell-eo aspell-es aspell-et aspell-eu-es aspell-fa aspell-fo aspell-fr aspell-ga aspell-gl-minimos aspell-hr aspell-hsb aspell-id aspell-it aspell-kk aspell-ku aspell-lt aspell-lv aspell-nl aspell-no aspell-nr aspell-ns  aspell-pa aspell-pl aspell-pt aspell-pt-br aspell-ro aspell-ru aspell-sk aspell-sl aspell-st aspell-sv aspell-tl aspell-tn aspell-ts aspell-xh

+ 20 - 1
services/spelling/test/acceptance/js/CheckTest.js

@@ -27,7 +27,26 @@ describe('checking words', function () {
     it('should return the list of misspellings', async function () {
       const body = JSON.parse(response.body)
       expect(body).to.deep.equal({
-        misspellings: [{ index: 0, suggestions: ['anther', 'another'] }],
+        misspellings: [
+          {
+            index: 0,
+            suggestions: [
+              'anther',
+              'another',
+              'anthers',
+              'panther',
+              'anathema',
+              'anthem',
+              'nether',
+              "anther's",
+              'ante',
+              'neither',
+              'norther',
+              'ether',
+              'other',
+            ],
+          },
+        ],
       })
     })
   })

+ 1 - 1
services/track-changes/.nvmrc

@@ -1 +1 @@
-14.18.3
+16.14.2

+ 1 - 1
services/track-changes/Dockerfile

@@ -2,7 +2,7 @@
 # Instead run bin/update_build_scripts from
 # https://github.com/sharelatex/sharelatex-dev-environment
 
-FROM gcr.io/overleaf-ops/node:14.18.3 as base
+FROM node:16.14.2 as base
 
 WORKDIR /overleaf/services/track-changes
 

+ 1 - 1
services/track-changes/Makefile

@@ -30,7 +30,7 @@ HERE=$(shell pwd)
 MONOREPO=$(shell cd ../../ && pwd)
 # Run the linting commands in the scope of the monorepo.
 # Eslint and prettier (plus some configs) are on the root.
-RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) gcr.io/overleaf-ops/node:14.18.3 npm run --silent
+RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) node:16.14.2 npm run --silent
 
 format:
 	$(RUN_LINTING) format

+ 1 - 1
services/track-changes/app/js/HttpController.js

@@ -238,7 +238,7 @@ module.exports = HttpController = {
     UpdatesManager.exportProject(
       project_id,
       function (err, { updates, userIds }, confirmWrite) {
-        const abortStreaming = req.aborted || res.finished || res.destroyed
+        const abortStreaming = req.destroyed || res.finished || res.destroyed
         if (abortStreaming) {
           // Tell the producer to stop emitting data
           if (confirmWrite) confirmWrite(new Error('stop'))

+ 1 - 1
services/track-changes/app/js/ZipManager.js

@@ -162,7 +162,7 @@ async function makeTempDirectory() {
  * Clean up a temporary directory made with makeTempDirectory()
  */
 function cleanupTempDirectory(tmpdir) {
-  fs.promises.rmdir(tmpdir, { recursive: true }).catch(err => {
+  fs.promises.rm(tmpdir, { recursive: true, force: true }).catch(err => {
     if (err) {
       logger.warn({ err, tmpdir }, 'Failed to clean up temp directory')
     }

+ 1 - 2
services/track-changes/buildscript.txt

@@ -3,7 +3,6 @@ track-changes
 --docker-repos=gcr.io/overleaf-ops
 --env-add=AWS_BUCKET=bucket
 --env-pass-through=
---node-image=gcr.io/overleaf-ops/node
---node-version=14.18.3
+--node-version=16.14.2
 --public-repo=True
 --script-version=4.1.0

+ 2 - 2
services/track-changes/docker-compose.yml

@@ -6,7 +6,7 @@ version: "2.3"
 
 services:
   test_unit:
-    image: gcr.io/overleaf-ops/node:14.18.3
+    image: node:16.14.2
     volumes:
       - .:/overleaf/services/track-changes
       - ../../node_modules:/overleaf/node_modules
@@ -20,7 +20,7 @@ services:
     user: node
 
   test_acceptance:
-    image: gcr.io/overleaf-ops/node:14.18.3
+    image: node:16.14.2
     volumes:
       - .:/overleaf/services/track-changes
       - ../../node_modules:/overleaf/node_modules