From 6b141501fd237946a975bbf5780d4783a13a85f0 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Fri, 9 May 2025 16:26:12 -0300 Subject: [PATCH 1/6] chore!: remove mongo 5/6 support --- .github/workflows/ci-test-e2e.yml | 2 +- .github/workflows/ci.yml | 8 +-- apps/meteor/server/startup/serverRunning.js | 78 ++++++++++----------- 3 files changed, 44 insertions(+), 44 deletions(-) diff --git a/.github/workflows/ci-test-e2e.yml b/.github/workflows/ci-test-e2e.yml index 8b9142b192b0c..1fda23b9ff570 100644 --- a/.github/workflows/ci-test-e2e.yml +++ b/.github/workflows/ci-test-e2e.yml @@ -26,7 +26,7 @@ on: transporter: type: string mongodb-version: - default: "['5.0', '7.0']" + default: "['7.0']" required: false type: string release: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 38566662907ed..9a5dd76b94b91 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -130,7 +130,7 @@ jobs: fi; curl -H "Content-Type: application/json" -H "X-Update-Token: $UPDATE_TOKEN" -d \ - "{\"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\"}" \ + "{\"nodeVersion\": \"${{ needs.release-versions.outputs.node-version }}\", \"compatibleMongoVersions\": [\"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: @@ -491,7 +491,7 @@ jobs: release: ee transporter: 'nats://nats:4222' enterprise-license: ${{ needs.release-versions.outputs.enterprise-license }} - mongodb-version: "['5.0']" + mongodb-version: "['7.0']" node-version: ${{ needs.release-versions.outputs.node-version }} deno-version: ${{ needs.release-versions.outputs.deno-version }} lowercase-repo: ${{ needs.release-versions.outputs.lowercase-repo }} @@ -514,7 +514,7 @@ jobs: enterprise-license: ${{ needs.release-versions.outputs.enterprise-license }} shard: '[1, 2, 3, 4, 5]' total-shard: 5 - mongodb-version: "['5.0']" + mongodb-version: "['7.0']" node-version: ${{ needs.release-versions.outputs.node-version }} deno-version: ${{ needs.release-versions.outputs.deno-version }} lowercase-repo: ${{ needs.release-versions.outputs.lowercase-repo }} @@ -893,7 +893,7 @@ jobs: fi; curl -H "Content-Type: application/json" -H "X-Update-Token: $UPDATE_TOKEN" -d \ - "{\"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\"}" \ + "{\"nodeVersion\": \"${{ needs.release-versions.outputs.node-version }}\", \"compatibleMongoVersions\": [\"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 7a1233bd29cde..ba703cdd35ba7 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), '<5.0.0')) { - msg += ['', '', 'YOUR CURRENT MONGODB VERSION IS NOT SUPPORTED BY ROCKET.CHAT,', 'PLEASE UPGRADE TO VERSION 5.0 OR LATER'].join('\n'); + if (semver.satisfies(semver.coerce(mongoVersion), '<7.0.0')) { + msg += ['', '', 'YOUR CURRENT MONGODB VERSION IS NOT SUPPORTED BY ROCKET.CHAT,', 'PLEASE UPGRADE TO VERSION 7.0 OR LATER'].join('\n'); showErrorBox('SERVER ERROR', msg); exitIfNotBypassed(process.env.BYPASS_MONGO_VALIDATION); @@ -88,42 +88,42 @@ Meteor.startup(async () => { showSuccessBox('SERVER RUNNING', msg); // Deprecation - 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 8.0.0 AND GREATER,', - 'PLEASE UPGRADE MONGODB TO VERSION 6.0 OR GREATER', - ].join('\n'); - showWarningBox('DEPRECATION', msg); - - const id = `mongodbDeprecation_${mongoVersion.replace(/[^0-9]/g, '_')}`; - const title = 'MongoDB_Deprecated'; - const text = 'MongoDB_version_s_is_deprecated_please_upgrade_your_installation'; - const link = 'https://go.rocket.chat/i/mongodb-deprecated'; - - if (!(await Users.bannerExistsById(id))) { - if (skipMongoDbDeprecationBanner || process.env.TEST_MODE) { - return; - } - sendMessagesToAdmins({ - msgs: async ({ adminUser }) => [ - { - msg: `*${i18n.t(title, adminUser.language)}*\n${i18n.t(text, { postProcess: 'sprintf', sprintf: [mongoVersion] }, adminUser.language)}\n${link}`, - }, - ], - banners: [ - { - id, - priority: 100, - title, - text, - textArguments: [mongoVersion], - modifiers: ['danger'], - link, - }, - ], - }); - } - } + // if (!skipMongoDbDeprecationCheck && semver.satisfies(semver.coerce(mongoVersion), '<7.0.0')) { + // msg = [ + // `YOUR CURRENT MONGODB VERSION (${mongoVersion}) IS DEPRECATED.`, + // '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); + + // const id = `mongodbDeprecation_${mongoVersion.replace(/[^0-9]/g, '_')}`; + // const title = 'MongoDB_Deprecated'; + // const text = 'MongoDB_version_s_is_deprecated_please_upgrade_your_installation'; + // const link = 'https://go.rocket.chat/i/mongodb-deprecated'; + + // if (!(await Users.bannerExistsById(id))) { + // if (skipMongoDbDeprecationBanner || process.env.TEST_MODE) { + // return; + // } + // sendMessagesToAdmins({ + // msgs: async ({ adminUser }) => [ + // { + // msg: `*${i18n.t(title, adminUser.language)}*\n${i18n.t(text, { postProcess: 'sprintf', sprintf: [mongoVersion] }, adminUser.language)}\n${link}`, + // }, + // ], + // banners: [ + // { + // id, + // priority: 100, + // title, + // text, + // textArguments: [mongoVersion], + // modifiers: ['danger'], + // link, + // }, + // ], + // }); + // } + // } }, 100); }); From 5407b0c140497083197ea31de0b896028aa4faf4 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Fri, 9 May 2025 15:40:30 -0400 Subject: [PATCH 2/6] Create gold-keys-compare.md --- .changeset/gold-keys-compare.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .changeset/gold-keys-compare.md diff --git a/.changeset/gold-keys-compare.md b/.changeset/gold-keys-compare.md new file mode 100644 index 0000000000000..ef045898aee67 --- /dev/null +++ b/.changeset/gold-keys-compare.md @@ -0,0 +1,4 @@ +--- +"@rocket.chat/meteor": major +--- +Removes mongo 5/6 support From 71595c1e1eadcb368865ab00e48791131c73f359 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Fri, 9 May 2025 17:00:00 -0300 Subject: [PATCH 3/6] lint --- apps/meteor/server/startup/serverRunning.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/meteor/server/startup/serverRunning.js b/apps/meteor/server/startup/serverRunning.js index ba703cdd35ba7..48ea4426f3963 100644 --- a/apps/meteor/server/startup/serverRunning.js +++ b/apps/meteor/server/startup/serverRunning.js @@ -1,17 +1,17 @@ import fs from 'fs'; import path from 'path'; -import { Users } from '@rocket.chat/models'; +// import { Users } from '@rocket.chat/models'; import { Meteor } from 'meteor/meteor'; import semver from 'semver'; import { settings } from '../../app/settings/server'; import { Info } from '../../app/utils/rocketchat.info'; import { getMongoInfo } from '../../app/utils/server/functions/getMongoInfo'; -import { i18n } from '../lib/i18n'; +// import { i18n } from '../lib/i18n'; import { isRunningMs } from '../lib/isRunningMs'; -import { showErrorBox, showWarningBox, showSuccessBox } from '../lib/logger/showBox'; -import { sendMessagesToAdmins } from '../lib/sendMessagesToAdmins'; +import { showErrorBox, showSuccessBox } from '../lib/logger/showBox'; +// import { sendMessagesToAdmins } from '../lib/sendMessagesToAdmins'; const exitIfNotBypassed = (ignore, errorCode = 1) => { if (typeof ignore === 'string' && ['yes', 'true'].includes(ignore.toLowerCase())) { @@ -21,8 +21,8 @@ const exitIfNotBypassed = (ignore, errorCode = 1) => { process.exit(errorCode); }; -const skipMongoDbDeprecationCheck = ['yes', 'true'].includes(String(process.env.SKIP_MONGODEPRECATION_CHECK).toLowerCase()); -const skipMongoDbDeprecationBanner = ['yes', 'true'].includes(String(process.env.SKIP_MONGODEPRECATION_BANNER).toLowerCase()); +// const skipMongoDbDeprecationCheck = ['yes', 'true'].includes(String(process.env.SKIP_MONGODEPRECATION_CHECK).toLowerCase()); +// const skipMongoDbDeprecationBanner = ['yes', 'true'].includes(String(process.env.SKIP_MONGODEPRECATION_BANNER).toLowerCase()); Meteor.startup(async () => { const { oplogEnabled, mongoVersion, mongoStorageEngine } = await getMongoInfo(); From 5213b6d5c3a1f0809c65f36ef06f3780f3524df4 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Tue, 13 May 2025 15:58:47 -0300 Subject: [PATCH 4/6] fix: update artifact names in CI workflow to include db-watcher-disabled condition --- .github/workflows/ci-test-e2e.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-test-e2e.yml b/.github/workflows/ci-test-e2e.yml index 1fda23b9ff570..f3f2284c262cc 100644 --- a/.github/workflows/ci-test-e2e.yml +++ b/.github/workflows/ci-test-e2e.yml @@ -335,7 +335,7 @@ jobs: if: inputs.type == 'api' && inputs.release == 'ee' uses: actions/upload-artifact@v4 with: - name: e2e-api-ee-coverage-${{ matrix.mongodb-version }}-${{ matrix.shard }} + name: e2e-api-ee-coverage-${{ matrix.mongodb-version }}-${{ matrix.shard }}${{ inputs.db-watcher-disabled == 'true' && '-no-watcher' || '' }} path: /tmp/coverage include-hidden-files: true @@ -343,6 +343,6 @@ jobs: if: inputs.type == 'ui' && inputs.release == 'ee' uses: actions/upload-artifact@v4 with: - name: e2e-ee-coverage-${{ matrix.mongodb-version }}-${{ matrix.shard }} + name: e2e-ee-coverage-${{ matrix.mongodb-version }}-${{ matrix.shard }}${{ inputs.db-watcher-disabled == 'true' && '-no-watcher' || '' }} path: ./apps/meteor/coverage* include-hidden-files: true From c2f936c96b4b5e4e1fcdbdaab3ce4c659e9ef8e1 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Tue, 13 May 2025 17:35:43 -0300 Subject: [PATCH 5/6] fix: enhance artifact naming in CI workflow to conditionally include db-watcher-disabled flag --- .github/workflows/ci-test-e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-test-e2e.yml b/.github/workflows/ci-test-e2e.yml index f3f2284c262cc..19d706c64e35b 100644 --- a/.github/workflows/ci-test-e2e.yml +++ b/.github/workflows/ci-test-e2e.yml @@ -297,7 +297,7 @@ jobs: if: inputs.type == 'ui' && always() uses: actions/upload-artifact@v4 with: - name: playwright-test-trace-${{ inputs.release }}-${{ matrix.mongodb-version }}-${{ matrix.shard }} + name: playwright-test-trace-${{ inputs.release }}-${{ matrix.mongodb-version }}-${{ matrix.shard }}${{ inputs.db-watcher-disabled == 'true' && '-no-watcher' || '' }} path: ./apps/meteor/tests/e2e/.playwright* include-hidden-files: true From 2bdbda4b740275fd9f2d9d91bd45f6a0fb9766dd Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Wed, 14 May 2025 13:53:52 -0400 Subject: [PATCH 6/6] Update .changeset/gold-keys-compare.md Co-authored-by: Diego Sampaio --- .changeset/gold-keys-compare.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/gold-keys-compare.md b/.changeset/gold-keys-compare.md index ef045898aee67..452169781c04c 100644 --- a/.changeset/gold-keys-compare.md +++ b/.changeset/gold-keys-compare.md @@ -1,4 +1,4 @@ --- "@rocket.chat/meteor": major --- -Removes mongo 5/6 support +Removes support of MongoDB versions 5.x and 6.x