Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
4 changes: 4 additions & 0 deletions .changeset/gold-keys-compare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
"@rocket.chat/meteor": major
---
Removes mongo 5/6 support
Comment thread
ggazzo marked this conversation as resolved.
Outdated
8 changes: 4 additions & 4 deletions .github/workflows/ci-test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ on:
transporter:
type: string
mongodb-version:
default: "['5.0', '7.0']"
default: "['7.0']"
required: false
type: string
release:
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -335,14 +335,14 @@ 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

- name: Store e2e-ee-coverage
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
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 }}
Expand All @@ -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 }}
Expand Down Expand Up @@ -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
Expand Down
90 changes: 45 additions & 45 deletions apps/meteor/server/startup/serverRunning.js
Original file line number Diff line number Diff line change
@@ -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())) {
Expand All @@ -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();
Expand Down Expand Up @@ -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);
Expand All @@ -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')) {
Comment thread
ggazzo marked this conversation as resolved.
// 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);
});