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
This commit is contained in:
dblythy
2022-11-11 08:21:11 +11:00
committed by GitHub
parent ccb14970cb
commit 37245f62ce
5 changed files with 16 additions and 53 deletions

View File

@@ -121,51 +121,34 @@ jobs:
strategy: strategy:
matrix: matrix:
include: include:
- name: MongoDB 4.0, Standalone, MMAPv1 - name: MongoDB 4.2, ReplicaSet
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
MONGODB_VERSION: 4.2.19 MONGODB_VERSION: 4.2.19
MONGODB_TOPOLOGY: replicaset MONGODB_TOPOLOGY: replicaset
MONGODB_STORAGE_ENGINE: wiredTiger
NODE_VERSION: 18.1.0 NODE_VERSION: 18.1.0
- name: MongoDB 4.4, ReplicaSet, WiredTiger - name: MongoDB 4.4, ReplicaSet
MONGODB_VERSION: 4.4.13 MONGODB_VERSION: 4.4.13
MONGODB_TOPOLOGY: replicaset MONGODB_TOPOLOGY: replicaset
MONGODB_STORAGE_ENGINE: wiredTiger
NODE_VERSION: 18.1.0 NODE_VERSION: 18.1.0
- name: MongoDB 5, ReplicaSet, WiredTiger - name: MongoDB 5, ReplicaSet
MONGODB_VERSION: 5.3.2 MONGODB_VERSION: 5.3.2
MONGODB_TOPOLOGY: replicaset MONGODB_TOPOLOGY: replicaset
MONGODB_STORAGE_ENGINE: wiredTiger
NODE_VERSION: 18.1.0 NODE_VERSION: 18.1.0
- name: MongoDB 6, ReplicaSet, WiredTiger - name: MongoDB 6, ReplicaSet
MONGODB_VERSION: 6.0.2 MONGODB_VERSION: 6.0.2
MONGODB_TOPOLOGY: replicaset MONGODB_TOPOLOGY: replicaset
MONGODB_STORAGE_ENGINE: wiredTiger
NODE_VERSION: 18.1.0 NODE_VERSION: 18.1.0
- name: Redis Cache - name: Redis Cache
PARSE_SERVER_TEST_CACHE: redis PARSE_SERVER_TEST_CACHE: redis
MONGODB_VERSION: 4.4.13 MONGODB_VERSION: 4.4.13
MONGODB_TOPOLOGY: standalone MONGODB_TOPOLOGY: standalone
MONGODB_STORAGE_ENGINE: wiredTiger
NODE_VERSION: 18.1.0 NODE_VERSION: 18.1.0
- name: Node 14 - name: Node 14
MONGODB_VERSION: 4.4.13 MONGODB_VERSION: 4.4.13
MONGODB_TOPOLOGY: standalone MONGODB_TOPOLOGY: standalone
MONGODB_STORAGE_ENGINE: wiredTiger NODE_VERSION: 14.19.1
NODE_VERSION: 14.21.0
- name: Node 16 - name: Node 16
MONGODB_VERSION: 4.4.13 MONGODB_VERSION: 4.4.13
MONGODB_TOPOLOGY: standalone MONGODB_TOPOLOGY: standalone
MONGODB_STORAGE_ENGINE: wiredTiger
NODE_VERSION: 16.14.2 NODE_VERSION: 16.14.2
fail-fast: false fail-fast: false
name: ${{ matrix.name }} name: ${{ matrix.name }}

View File

@@ -112,20 +112,19 @@
"lint-fix": "eslint --fix --cache ./", "lint-fix": "eslint --fix --cache ./",
"build": "babel src/ -d lib/ --copy-files", "build": "babel src/ -d lib/ --copy-files",
"watch": "babel --watch 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: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} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} TESTING=1 jasmine", "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": "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.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: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:5.3.2": "npm run test:mongodb --dbversion=5.3.2",
"test:mongodb:6.0.2": "npm run test:mongodb --dbversion=6.0.2", "test:mongodb:6.0.2": "npm run test:mongodb --dbversion=6.0.2",
"posttest:mongodb": "mongodb-runner stop", "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", "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} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} TESTING=1 jasmine", "testonly": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.3.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} TESTING=1 jasmine",
"test": "npm run testonly", "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", "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} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=wiredTiger} TESTING=1 nyc jasmine", "coverage": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.3.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} TESTING=1 nyc jasmine",
"start": "node ./bin/parse-server", "start": "node ./bin/parse-server",
"prettier": "prettier --write {src,spec}/{**/*,*}.js", "prettier": "prettier --write {src,spec}/{**/*,*}.js",
"prepare": "npm run build", "prepare": "npm run build",

View File

@@ -6,7 +6,6 @@ const databaseURI = 'mongodb://localhost:27017/parseServerMongoAdapterTestDataba
const request = require('../lib/request'); const request = require('../lib/request');
const Config = require('../lib/Config'); const Config = require('../lib/Config');
const TestUtils = require('../lib/TestUtils'); const TestUtils = require('../lib/TestUtils');
const semver = require('semver');
const fakeClient = { const fakeClient = {
s: { options: { dbName: null } }, s: { options: { dbName: null } },
@@ -401,11 +400,7 @@ describe_only_db('mongo')('MongoStorageAdapter', () => {
expect(schemaAfterDeletion.fields.test).toBeUndefined(); expect(schemaAfterDeletion.fields.test).toBeUndefined();
}); });
if ( if (process.env.MONGODB_TOPOLOGY === 'replicaset') {
semver.satisfies(process.env.MONGODB_VERSION, '>=4.0.4') &&
process.env.MONGODB_TOPOLOGY === 'replicaset' &&
process.env.MONGODB_STORAGE_ENGINE === 'wiredTiger'
) {
describe('transactions', () => { describe('transactions', () => {
const headers = { const headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',

View File

@@ -2,7 +2,6 @@ const ParseServerRESTController = require('../lib/ParseServerRESTController')
.ParseServerRESTController; .ParseServerRESTController;
const ParseServer = require('../lib/ParseServer').default; const ParseServer = require('../lib/ParseServer').default;
const Parse = require('parse/node').Parse; const Parse = require('parse/node').Parse;
const semver = require('semver');
const TestUtils = require('../lib/TestUtils'); const TestUtils = require('../lib/TestUtils');
let RESTController; let RESTController;
@@ -130,19 +129,13 @@ describe('ParseServerRESTController', () => {
}); });
if ( if (
(semver.satisfies(process.env.MONGODB_VERSION, '>=4.0.4') && process.env.MONGODB_TOPOLOGY === 'replicaset' ||
process.env.MONGODB_TOPOLOGY === 'replicaset' &&
process.env.MONGODB_STORAGE_ENGINE === 'wiredTiger') ||
process.env.PARSE_SERVER_TEST_DB === 'postgres' process.env.PARSE_SERVER_TEST_DB === 'postgres'
) { ) {
describe('transactions', () => { describe('transactions', () => {
beforeEach(async () => { beforeEach(async () => {
await TestUtils.destroyAllDataPermanently(true); await TestUtils.destroyAllDataPermanently(true);
if ( if (process.env.MONGODB_TOPOLOGY === 'replicaset') {
semver.satisfies(process.env.MONGODB_VERSION, '>=4.0.4') &&
process.env.MONGODB_TOPOLOGY === 'replicaset' &&
process.env.MONGODB_STORAGE_ENGINE === 'wiredTiger'
) {
await reconfigureServer({ await reconfigureServer({
databaseAdapter: undefined, databaseAdapter: undefined,
databaseURI: databaseURI:

View File

@@ -1,6 +1,5 @@
const batch = require('../lib/batch'); const batch = require('../lib/batch');
const request = require('../lib/request'); const request = require('../lib/request');
const semver = require('semver');
const TestUtils = require('../lib/TestUtils'); const TestUtils = require('../lib/TestUtils');
const originalURL = '/parse/batch'; const originalURL = '/parse/batch';
@@ -206,19 +205,13 @@ describe('batch', () => {
}); });
if ( if (
(semver.satisfies(process.env.MONGODB_VERSION, '>=4.0.4') && process.env.MONGODB_TOPOLOGY === 'replicaset' ||
process.env.MONGODB_TOPOLOGY === 'replicaset' &&
process.env.MONGODB_STORAGE_ENGINE === 'wiredTiger') ||
process.env.PARSE_SERVER_TEST_DB === 'postgres' process.env.PARSE_SERVER_TEST_DB === 'postgres'
) { ) {
describe('transactions', () => { describe('transactions', () => {
beforeEach(async () => { beforeEach(async () => {
await TestUtils.destroyAllDataPermanently(true); await TestUtils.destroyAllDataPermanently(true);
if ( if (process.env.MONGODB_TOPOLOGY === 'replicaset') {
semver.satisfies(process.env.MONGODB_VERSION, '>=4.0.4') &&
process.env.MONGODB_TOPOLOGY === 'replicaset' &&
process.env.MONGODB_STORAGE_ENGINE === 'wiredTiger'
) {
await reconfigureServer({ await reconfigureServer({
databaseAdapter: undefined, databaseAdapter: undefined,
databaseURI: databaseURI: