chore!: remove mongo 5/6 support (#35961)

Co-authored-by: Diego Sampaio <chinello@gmail.com>
This commit is contained in:
Guilherme Gazzo 2025-05-14 16:14:13 -03:00 committed by Guilherme Gazzo
parent bd10778e8b
commit 828cf798cf
4 changed files with 52 additions and 48 deletions

View File

@ -0,0 +1,4 @@
---
"@rocket.chat/meteor": major
---
Removes support of MongoDB versions 5.x and 6.x

View File

@ -253,7 +253,7 @@ jobs:
if: inputs.type == 'ui' && always()
uses: actions/upload-artifact@v5
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

View File

@ -158,7 +158,7 @@ jobs:
fi;
curl -H "Content-Type: application/json" -H "X-Update-Token: $UPDATE_TOKEN" -d \
"{\"nodeVersion\": \"${{ needs.release-versions.outputs.node-version }}\", \"denoVersion\": \"${{ needs.release-versions.outputs.deno-version }}\", \"compatibleMongoVersions\": [\"5\", \"6\", \"7\", \"8\"], \"commit\": \"$GITHUB_SHA\", \"tag\": \"$RC_VERSION\", \"branch\": \"$GIT_BRANCH\", \"artifactName\": \"$ARTIFACT_NAME\", \"releaseType\": \"draft\", \"draftAs\": \"$RC_RELEASE\"}" \
"{\"nodeVersion\": \"${{ needs.release-versions.outputs.node-version }}\", \"denoVersion\": \"${{ needs.release-versions.outputs.deno-version }}\",\"compatibleMongoVersions\": [\"8.2\"], \"commit\": \"$GITHUB_SHA\", \"tag\": \"$RC_VERSION\", \"branch\": \"$GIT_BRANCH\", \"artifactName\": \"$ARTIFACT_NAME\", \"releaseType\": \"draft\", \"draftAs\": \"$RC_RELEASE\"}" \
https://releases.rocket.chat/update
packages-build:
@ -543,7 +543,7 @@ jobs:
release: ee
transporter: 'nats://nats:4222'
enterprise-license: ${{ needs.release-versions.outputs.enterprise-license }}
mongodb-version: "['5.0', '8.2']"
mongodb-version: "['8.2']"
coverage: '8.2'
node-version: ${{ needs.release-versions.outputs.node-version }}
deno-version: ${{ needs.release-versions.outputs.deno-version }}
@ -565,7 +565,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: "['8.2']"
node-version: ${{ needs.release-versions.outputs.node-version }}
deno-version: ${{ needs.release-versions.outputs.deno-version }}
lowercase-repo: ${{ needs.release-versions.outputs.lowercase-repo }}
@ -963,7 +963,7 @@ jobs:
fi;
curl -H "Content-Type: application/json" -H "X-Update-Token: $UPDATE_TOKEN" -d \
"{\"nodeVersion\": \"${{ needs.release-versions.outputs.node-version }}\", \"denoVersion\": \"${{ needs.release-versions.outputs.deno-version }}\", \"compatibleMongoVersions\": [\"5\", \"6\", \"7\", \"8\"], \"commit\": \"$GITHUB_SHA\", \"tag\": \"$RC_VERSION\", \"branch\": \"$GIT_BRANCH\", \"artifactName\": \"$ARTIFACT_NAME\", \"releaseType\": \"$RC_RELEASE\"}" \
"{\"nodeVersion\": \"${{ needs.release-versions.outputs.node-version }}\", \"denoVersion\": \"${{ needs.release-versions.outputs.deno-version }}\", \"compatibleMongoVersions\": [\"8.2\"], \"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

View File

@ -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();
@ -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);
// 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';
// 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 (!(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);
});