From 37245f62ce83516b6b95a54b850f0274ef680478 Mon Sep 17 00:00:00 2001 From: dblythy Date: Fri, 11 Nov 2022 08:21:11 +1100 Subject: [PATCH] feat: Remove support for MongoDB 4.0 (#8292) BREAKING CHANGE: This release removes support for MongoDB 4.0; the new minimum supported MongoDB version is 4.2. which also removes support for the deprecated MongoDB MMAPv1 storage engine --- .github/workflows/ci.yml | 27 +++++--------------------- package.json | 13 ++++++------- spec/MongoStorageAdapter.spec.js | 7 +------ spec/ParseServerRESTController.spec.js | 11 ++--------- spec/batch.spec.js | 11 ++--------- 5 files changed, 16 insertions(+), 53 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7cecfc64ed..6c49f3c0ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -121,51 +121,34 @@ jobs: strategy: matrix: include: - - name: MongoDB 4.0, Standalone, MMAPv1 - MONGODB_VERSION: 4.0.28 - MONGODB_TOPOLOGY: standalone - MONGODB_STORAGE_ENGINE: mmapv1 - NODE_VERSION: 18.1.0 - - name: MongoDB 4.0, ReplicaSet, WiredTiger - MONGODB_VERSION: 4.0.28 - MONGODB_TOPOLOGY: replicaset - MONGODB_STORAGE_ENGINE: wiredTiger - NODE_VERSION: 18.1.0 - - name: MongoDB 4.2, ReplicaSet, WiredTiger + - name: MongoDB 4.2, ReplicaSet MONGODB_VERSION: 4.2.19 MONGODB_TOPOLOGY: replicaset - MONGODB_STORAGE_ENGINE: wiredTiger NODE_VERSION: 18.1.0 - - name: MongoDB 4.4, ReplicaSet, WiredTiger + - name: MongoDB 4.4, ReplicaSet MONGODB_VERSION: 4.4.13 MONGODB_TOPOLOGY: replicaset - MONGODB_STORAGE_ENGINE: wiredTiger NODE_VERSION: 18.1.0 - - name: MongoDB 5, ReplicaSet, WiredTiger + - name: MongoDB 5, ReplicaSet MONGODB_VERSION: 5.3.2 MONGODB_TOPOLOGY: replicaset - MONGODB_STORAGE_ENGINE: wiredTiger NODE_VERSION: 18.1.0 - - name: MongoDB 6, ReplicaSet, WiredTiger + - name: MongoDB 6, ReplicaSet MONGODB_VERSION: 6.0.2 MONGODB_TOPOLOGY: replicaset - MONGODB_STORAGE_ENGINE: wiredTiger NODE_VERSION: 18.1.0 - name: Redis Cache PARSE_SERVER_TEST_CACHE: redis MONGODB_VERSION: 4.4.13 MONGODB_TOPOLOGY: standalone - MONGODB_STORAGE_ENGINE: wiredTiger NODE_VERSION: 18.1.0 - name: Node 14 MONGODB_VERSION: 4.4.13 MONGODB_TOPOLOGY: standalone - MONGODB_STORAGE_ENGINE: wiredTiger - NODE_VERSION: 14.21.0 + NODE_VERSION: 14.19.1 - name: Node 16 MONGODB_VERSION: 4.4.13 MONGODB_TOPOLOGY: standalone - MONGODB_STORAGE_ENGINE: wiredTiger NODE_VERSION: 16.14.2 fail-fast: false name: ${{ matrix.name }} diff --git a/package.json b/package.json index 99b92f1eac..269dd140ec 100644 --- a/package.json +++ b/package.json @@ -112,20 +112,19 @@ "lint-fix": "eslint --fix --cache ./", "build": "babel src/ -d lib/ --copy-files", "watch": "babel --watch src/ -d lib/ --copy-files", - "test:mongodb:runnerstart": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=$npm_config_dbversion} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} mongodb-runner start", - "test:mongodb:testonly": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=$npm_config_dbversion} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} TESTING=1 jasmine", + "test:mongodb:runnerstart": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=$npm_config_dbversion} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} mongodb-runner start", + "test:mongodb:testonly": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=$npm_config_dbversion} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} TESTING=1 jasmine", "test:mongodb": "npm run test:mongodb:runnerstart --dbversion=$npm_config_dbversion && npm run test:mongodb:testonly --dbversion=$npm_config_dbversion", - "test:mongodb:4.0.28": "npm run test:mongodb --dbversion=4.0.28", "test:mongodb:4.2.19": "npm run test:mongodb --dbversion=4.2.19", "test:mongodb:4.4.13": "npm run test:mongodb --dbversion=4.4.13", "test:mongodb:5.3.2": "npm run test:mongodb --dbversion=5.3.2", "test:mongodb:6.0.2": "npm run test:mongodb --dbversion=6.0.2", "posttest:mongodb": "mongodb-runner stop", - "pretest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.3.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} mongodb-runner start", - "testonly": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.3.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} TESTING=1 jasmine", + "pretest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.3.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} mongodb-runner start", + "testonly": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.3.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} TESTING=1 jasmine", "test": "npm run testonly", - "posttest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.3.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} mongodb-runner stop", - "coverage": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.3.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} TESTING=1 nyc jasmine", + "posttest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.3.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} mongodb-runner stop", + "coverage": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.3.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} TESTING=1 nyc jasmine", "start": "node ./bin/parse-server", "prettier": "prettier --write {src,spec}/{**/*,*}.js", "prepare": "npm run build", diff --git a/spec/MongoStorageAdapter.spec.js b/spec/MongoStorageAdapter.spec.js index f78caa2608..b95986140d 100644 --- a/spec/MongoStorageAdapter.spec.js +++ b/spec/MongoStorageAdapter.spec.js @@ -6,7 +6,6 @@ const databaseURI = 'mongodb://localhost:27017/parseServerMongoAdapterTestDataba const request = require('../lib/request'); const Config = require('../lib/Config'); const TestUtils = require('../lib/TestUtils'); -const semver = require('semver'); const fakeClient = { s: { options: { dbName: null } }, @@ -401,11 +400,7 @@ describe_only_db('mongo')('MongoStorageAdapter', () => { expect(schemaAfterDeletion.fields.test).toBeUndefined(); }); - if ( - semver.satisfies(process.env.MONGODB_VERSION, '>=4.0.4') && - process.env.MONGODB_TOPOLOGY === 'replicaset' && - process.env.MONGODB_STORAGE_ENGINE === 'wiredTiger' - ) { + if (process.env.MONGODB_TOPOLOGY === 'replicaset') { describe('transactions', () => { const headers = { 'Content-Type': 'application/json', diff --git a/spec/ParseServerRESTController.spec.js b/spec/ParseServerRESTController.spec.js index 0ec52ed4b5..5e6a550e25 100644 --- a/spec/ParseServerRESTController.spec.js +++ b/spec/ParseServerRESTController.spec.js @@ -2,7 +2,6 @@ const ParseServerRESTController = require('../lib/ParseServerRESTController') .ParseServerRESTController; const ParseServer = require('../lib/ParseServer').default; const Parse = require('parse/node').Parse; -const semver = require('semver'); const TestUtils = require('../lib/TestUtils'); let RESTController; @@ -130,19 +129,13 @@ describe('ParseServerRESTController', () => { }); if ( - (semver.satisfies(process.env.MONGODB_VERSION, '>=4.0.4') && - process.env.MONGODB_TOPOLOGY === 'replicaset' && - process.env.MONGODB_STORAGE_ENGINE === 'wiredTiger') || + process.env.MONGODB_TOPOLOGY === 'replicaset' || process.env.PARSE_SERVER_TEST_DB === 'postgres' ) { describe('transactions', () => { beforeEach(async () => { await TestUtils.destroyAllDataPermanently(true); - if ( - semver.satisfies(process.env.MONGODB_VERSION, '>=4.0.4') && - process.env.MONGODB_TOPOLOGY === 'replicaset' && - process.env.MONGODB_STORAGE_ENGINE === 'wiredTiger' - ) { + if (process.env.MONGODB_TOPOLOGY === 'replicaset') { await reconfigureServer({ databaseAdapter: undefined, databaseURI: diff --git a/spec/batch.spec.js b/spec/batch.spec.js index 8c3baebcc4..8367c70f61 100644 --- a/spec/batch.spec.js +++ b/spec/batch.spec.js @@ -1,6 +1,5 @@ const batch = require('../lib/batch'); const request = require('../lib/request'); -const semver = require('semver'); const TestUtils = require('../lib/TestUtils'); const originalURL = '/parse/batch'; @@ -206,19 +205,13 @@ describe('batch', () => { }); if ( - (semver.satisfies(process.env.MONGODB_VERSION, '>=4.0.4') && - process.env.MONGODB_TOPOLOGY === 'replicaset' && - process.env.MONGODB_STORAGE_ENGINE === 'wiredTiger') || + process.env.MONGODB_TOPOLOGY === 'replicaset' || process.env.PARSE_SERVER_TEST_DB === 'postgres' ) { describe('transactions', () => { beforeEach(async () => { await TestUtils.destroyAllDataPermanently(true); - if ( - semver.satisfies(process.env.MONGODB_VERSION, '>=4.0.4') && - process.env.MONGODB_TOPOLOGY === 'replicaset' && - process.env.MONGODB_STORAGE_ENGINE === 'wiredTiger' - ) { + if (process.env.MONGODB_TOPOLOGY === 'replicaset') { await reconfigureServer({ databaseAdapter: undefined, databaseURI: