Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/twelve-meals-sit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@rocket.chat/meteor": patch
"@rocket.chat/federation-matrix": patch
---

Adjusts the minimum supported MongoDB version from 8.2 (Rapid Release with short support lifecycle) to 8, ensuring stable and long-term compatibility
2 changes: 1 addition & 1 deletion .github/workflows/ci-test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:
transporter:
type: string
mongodb-version:
default: "['8.2']"
default: "['8.0']"
required: false
type: string
release:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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\": [\"8.2\"], \"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.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:
Expand Down Expand Up @@ -548,8 +548,8 @@ jobs:
release: ee
transporter: 'nats://nats:4222'
enterprise-license: ${{ needs.release-versions.outputs.enterprise-license }}
mongodb-version: "['8.2']"
coverage: '8.2'
mongodb-version: "['8.0']"
coverage: '8.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 }}
Expand All @@ -570,8 +570,8 @@ jobs:
enterprise-license: ${{ needs.release-versions.outputs.enterprise-license }}
shard: '[1, 2, 3, 4, 5]'
total-shard: 5
mongodb-version: "['8.2']"
coverage: '8.2'
mongodb-version: "['8.0']"
coverage: '8.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 }}
Expand Down Expand Up @@ -981,7 +981,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\": [\"8.2\"], \"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.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
Expand Down
83 changes: 43 additions & 40 deletions apps/meteor/server/startup/serverRunning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { getMongoInfo } from '../../app/utils/server/functions/getMongoInfo';
// import { i18n } from '../lib/i18n';
// import { isRunningMs } from '../lib/isRunningMs';
// import { sendMessagesToAdmins } from '../lib/sendMessagesToAdmins';
import { showErrorBox, showSuccessBox } from '../lib/logger/showBox';
import { showErrorBox, showSuccessBox, showWarningBox } from '../lib/logger/showBox';

const exitIfNotBypassed = (ignore: string | undefined, errorCode = 1) => {
if (typeof ignore === 'string' && ['yes', 'true'].includes(ignore.toLowerCase())) {
Expand All @@ -21,7 +21,10 @@ const exitIfNotBypassed = (ignore: string | undefined, errorCode = 1) => {
process.exit(errorCode);
};

// const skipMongoDbDeprecationCheck = ['yes', 'true'].includes(String(process.env.SKIP_MONGODEPRECATION_CHECK).toLowerCase());
const skipMongoDbDeprecationCheck =
['yes', 'true'].includes(String(process.env.SKIP_MONGODEPRECATION_CHECK).toLowerCase()) ||
process.env.TEST_MODE === 'true' ||
process.env.NODE_ENV === 'development';
// const skipMongoDbDeprecationBanner = ['yes', 'true'].includes(String(process.env.SKIP_MONGODEPRECATION_BANNER).toLowerCase());

Meteor.startup(async () => {
Expand Down Expand Up @@ -72,7 +75,7 @@ Meteor.startup(async () => {
const mongoSemver = semver.coerce(mongoVersion);

if (!mongoSemver || semver.satisfies(mongoSemver, '<7.0.0')) {
msg += ['', '', 'YOUR CURRENT MONGODB VERSION IS NOT SUPPORTED BY ROCKET.CHAT,', 'PLEASE UPGRADE TO VERSION 7.0 OR LATER'].join('\n');
msg += ['', '', 'YOUR CURRENT MONGODB VERSION IS NOT SUPPORTED BY ROCKET.CHAT,', 'PLEASE UPGRADE TO VERSION 8.0 OR LATER'].join('\n');
showErrorBox('SERVER ERROR', msg);

exitIfNotBypassed(process.env.BYPASS_MONGO_VALIDATION);
Expand All @@ -81,42 +84,42 @@ Meteor.startup(async () => {
showSuccessBox('SERVER RUNNING', msg);

// Deprecation
// 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,
// },
// ],
// });
// }
// }
if (!skipMongoDbDeprecationCheck && semver.satisfies(semver.coerce(mongoVersion)!, '<8.0.0')) {
msg = [
`DEPRECATED: MONGODB VERSION ${mongoVersion}.`,
'SUPPORT FOR MONGODB <8.0 WILL BE REMOVED IN ROCKET.CHAT 9.0.0',
'PLEASE UPGRADE MONGODB TO VERSION 8.0 OR GREATER',
].join('\n');
showWarningBox('DEPRECATION', msg);
Comment on lines 87 to 93
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Deprecation message references "ROCKET.CHAT VERSION 8.0.0" but this is Rocket.Chat 8.x.

Line 90 says MongoDB < 8.0 "WILL NOT BE SUPPORTED ON ROCKET.CHAT VERSION 8.0.0 AND GREATER," but this code ships with Rocket.Chat 8.x. If MongoDB 7.x is still intentionally allowed (soft-deprecated), the message should reference the next major version where it will actually be removed, or state it's deprecated now and will be blocked in a future release. As written, users on RC 8.x seeing this warning will be confused because the stated cutoff has already passed.

🤖 Prompt for AI Agents
In `@apps/meteor/server/startup/serverRunning.ts` around lines 87 - 93, The
deprecation text in the semver check block (where skipMongoDbDeprecationCheck,
semver.satisfies(semver.coerce(mongoVersion)!, '<8.0.0'), and showWarningBox are
used) incorrectly claims MongoDB <8.0 "WILL NOT BE SUPPORTED ON ROCKET.CHAT
VERSION 8.0.0 AND GREATER" even though this code runs in Rocket.Chat 8.x; update
the warning message in that block to either: (A) state that MongoDB <8.0 is
deprecated now and will be removed in the next major release (e.g., "DEPRECATED:
MongoDB <8.0. Will be removed in Rocket.Chat 9.0.0"), or (B) say it is
deprecated and support will be dropped in a future major release (e.g.,
"DEPRECATED: MongoDB <8.0. Support will be removed in a future release"),
ensuring the strings built for msg reflect the corrected wording so users on 8.x
are not misled.


// 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);
});
2 changes: 1 addition & 1 deletion docker-compose-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ services:
image: nats:2.6-alpine

mongo:
image: mongodb/mongodb-community-server:${MONGODB_VERSION:-8.2}-ubi8
image: mongodb/mongodb-community-server:${MONGODB_VERSION:-8.0}-ubi8
container_name: mongo
restart: on-failure
ports:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ services:
- nats

mongo:
image: mongodb/mongodb-community-server:8.2-ubi8
image: mongodb/mongodb-community-server:${MONGODB_VERSION:-8.0}-ubi8
restart: on-failure
ports:
- 27017:27017
Expand Down
2 changes: 1 addition & 1 deletion ee/packages/federation-matrix/docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ services:
- "traefik.http.routers.rc1-http.middlewares=rc1"

mongo:
image: mongo:8.0
image: mongo:${MONGODB_FEDERATION_VERSION:-8.0}
profiles:
- test
- element
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"dsv": "turbo run dsv --env-mode=loose --filter=@rocket.chat/meteor...",
"ms": "turbo run ms --env-mode=loose",
"fossify": "TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\"}' ts-node scripts/fossify.ts",
"set:mongo-version": "node ./scripts/set-mongo-version.mjs",
"fuselage": "./fuselage.sh",
"lint": "turbo run lint",
"storybook": "yarn workspace @rocket.chat/meteor run storybook",
Expand Down
Loading
Loading