From 7007914e24705d6cae3302920de0c4b07d6cb182 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Thu, 11 Apr 2024 23:57:14 -0300 Subject: [PATCH] chore!: Removed Mongo 4.4. support and added 7.0 (#32162) Co-authored-by: Diego Sampaio --- .changeset/fair-seahorses-laugh.md | 13 +++++++++++++ .changeset/fluffy-knives-count.md | 5 +++++ .github/workflows/ci-test-e2e.yml | 8 ++++---- .github/workflows/ci.yml | 10 +++++----- apps/meteor/server/startup/serverRunning.js | 10 +++++----- docker-compose-local.yml | 8 ++++---- 6 files changed, 36 insertions(+), 18 deletions(-) create mode 100644 .changeset/fair-seahorses-laugh.md create mode 100644 .changeset/fluffy-knives-count.md diff --git a/.changeset/fair-seahorses-laugh.md b/.changeset/fair-seahorses-laugh.md new file mode 100644 index 0000000000000..8f93695a8e174 --- /dev/null +++ b/.changeset/fair-seahorses-laugh.md @@ -0,0 +1,13 @@ +--- +'@rocket.chat/meteor': major +--- + +As per MongoDB Lifecycle Schedules ([mongodb.com/legal/support-policy/lifecycles](https://www.mongodb.com/legal/support-policy/lifecycles)) we're removing official support to MongoDB version 4.4 that has reached end of life in February 2024. + +We recommend upgrading to at least MongoDB 6.0+, though 5.0 is still a supported version. + +Here are official docs on how to upgrade to some of the supported versions: + +- [mongodb.com/docs/manual/release-notes/5.0-upgrade-replica-set](https://www.mongodb.com/docs/manual/release-notes/5.0-upgrade-replica-set/) +- [mongodb.com/docs/manual/release-notes/6.0-upgrade-replica-set](https://www.mongodb.com/docs/manual/release-notes/6.0-upgrade-replica-set/) +- [mongodb.com/docs/manual/release-notes/7.0-upgrade-replica-set](https://www.mongodb.com/docs/manual/release-notes/7.0-upgrade-replica-set/) diff --git a/.changeset/fluffy-knives-count.md b/.changeset/fluffy-knives-count.md new file mode 100644 index 0000000000000..4e4e8aad36319 --- /dev/null +++ b/.changeset/fluffy-knives-count.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": major +--- + +Added MongoDB 7.0 support diff --git a/.github/workflows/ci-test-e2e.yml b/.github/workflows/ci-test-e2e.yml index e6c02b7b6417a..2372ea8cbeca6 100644 --- a/.github/workflows/ci-test-e2e.yml +++ b/.github/workflows/ci-test-e2e.yml @@ -29,7 +29,7 @@ on: transporter: type: string mongodb-version: - default: "['4.4', '6.0']" + default: "['5.0', '7.0']" required: false type: string release: @@ -80,8 +80,8 @@ jobs: test: runs-on: ubuntu-20.04 env: - RC_DOCKERFILE: ${{ matrix.mongodb-version == '6.0' && inputs.rc-dockerfile-alpine || inputs.rc-dockerfile }} - RC_DOCKER_TAG: ${{ matrix.mongodb-version == '6.0' && inputs.rc-docker-tag-alpine || inputs.rc-docker-tag }} + RC_DOCKERFILE: ${{ matrix.mongodb-version == '7.0' && inputs.rc-dockerfile-alpine || inputs.rc-dockerfile }} + RC_DOCKER_TAG: ${{ matrix.mongodb-version == '7.0' && inputs.rc-docker-tag-alpine || inputs.rc-docker-tag }} strategy: fail-fast: false @@ -89,7 +89,7 @@ jobs: mongodb-version: ${{ fromJSON(inputs.mongodb-version) }} shard: ${{ fromJSON(inputs.shard) }} - name: MongoDB ${{ matrix.mongodb-version }}${{ inputs.db-watcher-disabled == 'true' && ' [no watchers]' || '' }} (${{ matrix.shard }}/${{ inputs.total-shard }})${{ matrix.mongodb-version == '6.0' && ' - Alpine' || '' }} + name: MongoDB ${{ matrix.mongodb-version }}${{ inputs.db-watcher-disabled == 'true' && ' [no watchers]' || '' }} (${{ matrix.shard }}/${{ inputs.total-shard }})${{ matrix.mongodb-version == '7.0' && ' - Alpine' || '' }} steps: - name: Collect Workflow Telemetry diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 40260f71d21f5..33a92b9055c66 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -121,7 +121,7 @@ jobs: fi; curl -H "Content-Type: application/json" -H "X-Update-Token: $UPDATE_TOKEN" -d \ - "{\"nodeVersion\": \"${{ needs.release-versions.outputs.node-version }}\", \"compatibleMongoVersions\": [\"4.4\", \"5.0\", \"6.0\"], \"commit\": \"$GITHUB_SHA\", \"tag\": \"$RC_VERSION\", \"branch\": \"$GIT_BRANCH\", \"artifactName\": \"$ARTIFACT_NAME\", \"releaseType\": \"draft\", \"draftAs\": \"$RC_RELEASE\"}" \ + "{\"nodeVersion\": \"${{ needs.release-versions.outputs.node-version }}\", \"compatibleMongoVersions\": [\"5.0\", \"6.0\", \"7.0\"], \"commit\": \"$GITHUB_SHA\", \"tag\": \"$RC_VERSION\", \"branch\": \"$GIT_BRANCH\", \"artifactName\": \"$ARTIFACT_NAME\", \"releaseType\": \"draft\", \"draftAs\": \"$RC_RELEASE\"}" \ https://releases.rocket.chat/update packages-build: @@ -369,7 +369,7 @@ jobs: release: ee transporter: 'nats://nats:4222' enterprise-license: ${{ needs.release-versions.outputs.enterprise-license }} - mongodb-version: "['4.4']" + mongodb-version: "['5.0']" node-version: ${{ needs.release-versions.outputs.node-version }} lowercase-repo: ${{ needs.release-versions.outputs.lowercase-repo }} rc-dockerfile: ${{ needs.release-versions.outputs.rc-dockerfile }} @@ -393,7 +393,7 @@ jobs: enterprise-license: ${{ needs.release-versions.outputs.enterprise-license }} shard: '[1, 2, 3, 4, 5]' total-shard: 5 - mongodb-version: "['4.4']" + mongodb-version: "['5.0']" node-version: ${{ needs.release-versions.outputs.node-version }} lowercase-repo: ${{ needs.release-versions.outputs.lowercase-repo }} rc-dockerfile: ${{ needs.release-versions.outputs.rc-dockerfile }} @@ -423,7 +423,7 @@ jobs: enterprise-license: ${{ needs.release-versions.outputs.enterprise-license }} shard: '[1, 2, 3, 4, 5]' total-shard: 5 - mongodb-version: "['6.0']" + mongodb-version: "['7.0']" node-version: ${{ needs.release-versions.outputs.node-version }} lowercase-repo: ${{ needs.release-versions.outputs.lowercase-repo }} rc-dockerfile: ${{ needs.release-versions.outputs.rc-dockerfile }} @@ -806,7 +806,7 @@ jobs: fi; curl -H "Content-Type: application/json" -H "X-Update-Token: $UPDATE_TOKEN" -d \ - "{\"nodeVersion\": \"${{ needs.release-versions.outputs.node-version }}\", \"compatibleMongoVersions\": [\"4.4\", \"5.0\", \"6.0\"], \"commit\": \"$GITHUB_SHA\", \"tag\": \"$RC_VERSION\", \"branch\": \"$GIT_BRANCH\", \"artifactName\": \"$ARTIFACT_NAME\", \"releaseType\": \"$RC_RELEASE\"}" \ + "{\"nodeVersion\": \"${{ needs.release-versions.outputs.node-version }}\", \"compatibleMongoVersions\": [\"5.0\", \"6.0\", \"7.0\"], \"commit\": \"$GITHUB_SHA\", \"tag\": \"$RC_VERSION\", \"branch\": \"$GIT_BRANCH\", \"artifactName\": \"$ARTIFACT_NAME\", \"releaseType\": \"$RC_RELEASE\"}" \ https://releases.rocket.chat/update # Makes build fail if the release isn't there diff --git a/apps/meteor/server/startup/serverRunning.js b/apps/meteor/server/startup/serverRunning.js index 8d572036f16a8..d642c006c4d2e 100644 --- a/apps/meteor/server/startup/serverRunning.js +++ b/apps/meteor/server/startup/serverRunning.js @@ -78,8 +78,8 @@ Meteor.startup(async () => { exitIfNotBypassed(process.env.BYPASS_NODEJS_VALIDATION); } - if (!semver.satisfies(semver.coerce(mongoVersion), '>=4.4.0')) { - msg += ['', '', 'YOUR CURRENT MONGODB VERSION IS NOT SUPPORTED,', 'PLEASE UPGRADE TO VERSION 4.4 OR LATER'].join('\n'); + if (semver.satisfies(semver.coerce(mongoVersion), '<5.0.0')) { + msg += ['', '', 'YOUR CURRENT MONGODB VERSION IS NOT SUPPORTED,', 'PLEASE UPGRADE TO VERSION 5.0 OR LATER'].join('\n'); showErrorBox('SERVER ERROR', msg); exitIfNotBypassed(process.env.BYPASS_MONGO_VALIDATION); @@ -88,11 +88,11 @@ Meteor.startup(async () => { showSuccessBox('SERVER RUNNING', msg); // Deprecation - if (!skipMongoDbDeprecationCheck && !semver.satisfies(semver.coerce(mongoVersion), '>=5.0.0')) { + if (!skipMongoDbDeprecationCheck && semver.satisfies(semver.coerce(mongoVersion), '<6.0.0')) { msg = [ `YOUR CURRENT MONGODB VERSION (${mongoVersion}) IS DEPRECATED.`, - 'IT WILL NOT BE SUPPORTED ON ROCKET.CHAT VERSION 7.0.0 AND GREATER,', - 'PLEASE UPGRADE MONGODB TO VERSION 5.0 OR GREATER', + 'IT WILL NOT BE SUPPORTED ON ROCKET.CHAT VERSION 8.0.0 AND GREATER,', + 'PLEASE UPGRADE MONGODB TO VERSION 6.0 OR GREATER', ].join('\n'); showWarningBox('DEPRECATION', msg); diff --git a/docker-compose-local.yml b/docker-compose-local.yml index 16c64187461a9..812899c7d9467 100644 --- a/docker-compose-local.yml +++ b/docker-compose-local.yml @@ -112,7 +112,7 @@ services: - 'host.docker.internal:host-gateway' depends_on: - nats - + queue-worker-service: platform: linux/amd64 build: @@ -128,7 +128,7 @@ services: - 'host.docker.internal:host-gateway' depends_on: - nats - + omnichannel-transcript-service: platform: linux/amd64 build: @@ -144,9 +144,9 @@ services: - 'host.docker.internal:host-gateway' depends_on: - nats - + mongo: - image: docker.io/bitnami/mongodb:4.4 + image: docker.io/bitnami/mongodb:7.0 restart: on-failure environment: MONGODB_REPLICA_SET_MODE: primary