-
Notifications
You must be signed in to change notification settings - Fork 13.1k
chore: update MongoDB version to 8.0 #38596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
…ript for version management
…hance environment checks
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
🦋 Changeset detectedLatest commit: f3ceaf5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 40 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughThis change lowers the minimum supported MongoDB version from 8.2 to 8.0 LTS across the entire codebase. It updates CI workflows, Docker configurations, server startup validation logic, and introduces a utility script for managing MongoDB version references. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Adjusts the minimum supported MongoDB version for stability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 9 files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@apps/meteor/server/startup/serverRunning.ts`:
- Around line 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.
🧹 Nitpick comments (2)
apps/meteor/server/startup/serverRunning.ts (1)
95-122: Large block of commented-out code.This 28-line block of dead code hurts readability. Consider removing it entirely — it can always be recovered from version control if needed. As per coding guidelines, code comments in the implementation should be avoided.
scripts/set-mongo-version.mjs (1)
48-59:--helpexits with code 1 and writes to stderr.Conventional CLI behavior is to print help to stdout and exit with code 0 when the user explicitly requests
--help. Currently, both "no args" and--helpgo throughdie(), which uses stderr and a non-zero exit code. Consider separating help from error exits.Proposed fix
if (args.length === 0 || args.includes('--help') || args.includes('-h')) { - die( - [ + const isHelp = args.includes('--help') || args.includes('-h'); + const msg = [ 'Usage: node ./scripts/set-mongo-version.mjs <mongodbVersion> [--federation <federationMongoVersion>] [--compatible <v1,v2,...>] [--dry-run]', '', 'Examples:', ' node ./scripts/set-mongo-version.mjs 8.2', ' node ./scripts/set-mongo-version.mjs 8.2 --federation 8.0', ' node ./scripts/set-mongo-version.mjs 7.0 --dry-run', - ].join('\n'), - ); + ].join('\n'); + (isHelp ? process.stdout : process.stderr).write(`${msg}\n`); + process.exit(isHelp ? 0 : 1); }
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
.changeset/twelve-meals-sit.md.github/workflows/ci-test-e2e.yml.github/workflows/ci.ymlapps/meteor/server/startup/serverRunning.tsdocker-compose-ci.ymldocker-compose-local.ymlee/packages/federation-matrix/docker-compose.test.ymlpackage.jsonscripts/set-mongo-version.mjs
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}
📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation
Files:
apps/meteor/server/startup/serverRunning.ts
🧠 Learnings (2)
📚 Learning: 2026-01-17T01:51:47.764Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 38219
File: packages/core-typings/src/cloud/Announcement.ts:5-6
Timestamp: 2026-01-17T01:51:47.764Z
Learning: In packages/core-typings/src/cloud/Announcement.ts, the AnnouncementSchema.createdBy field intentionally overrides IBannerSchema.createdBy (object with _id and optional username) with a string enum ['cloud', 'system'] to match existing runtime behavior. This is documented as technical debt with a FIXME comment at apps/meteor/app/cloud/server/functions/syncWorkspace/handleCommsSync.ts:53 and should not be flagged as an error until the runtime behavior is corrected.
Applied to files:
apps/meteor/server/startup/serverRunning.ts
📚 Learning: 2025-09-19T15:15:04.642Z
Learnt from: rodrigok
Repo: RocketChat/Rocket.Chat PR: 36991
File: apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts:219-221
Timestamp: 2025-09-19T15:15:04.642Z
Learning: The Federation_Matrix_homeserver_domain setting in apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts is part of the old federation system and is being deprecated/removed, so configuration issues with this setting should not be flagged for improvement.
Applied to files:
.changeset/twelve-meals-sit.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: 🔎 Code Check / Code Lint
- GitHub Check: 🔨 Test Unit / Unit Tests
- GitHub Check: 📦 Meteor Build (coverage)
- GitHub Check: 🔨 Test Storybook / Test Storybook
- GitHub Check: 🔎 Code Check / TypeScript
- GitHub Check: cubic · AI code reviewer
- GitHub Check: CodeQL-Build
- GitHub Check: CodeQL-Build
🔇 Additional comments (12)
.changeset/twelve-meals-sit.md (1)
1-6: LGTM!Changeset correctly marks both affected packages as patch updates with a clear description of the version policy change.
apps/meteor/server/startup/serverRunning.ts (1)
24-27: Skipping deprecation check in development and test modes looks reasonable.This prevents noisy warnings during local dev and CI runs.
scripts/set-mongo-version.mjs (2)
118-140:replaceAllOrThrowlogic is sound.Proper
lastIndexreset for global/sticky patterns, and the distinction between "pattern didn't match at all" (throw if required) vs. "pattern matched but replacement was identical" (no-op) is well handled.
161-258: Main execution block and file update orchestration look good.The dry-run support, progress output, and centralized version management across multiple config files is a solid approach. The regex patterns are appropriately tailored to each target file's format.
docker-compose-ci.yml (1)
178-178: LGTM!Default MongoDB version correctly updated to 8.0 while remaining overrideable via
MONGODB_VERSION.docker-compose-local.yml (1)
133-133: Good improvement: parameterized with env variable override.Previously hardcoded, now consistent with
docker-compose-ci.ymland overrideable viaMONGODB_VERSION.ee/packages/federation-matrix/docker-compose.test.yml (1)
122-123: LGTM!Parameterized with
MONGODB_FEDERATION_VERSIONand a sensible default, consistent with the separate federation version derivation logic inset-mongo-version.mjs..github/workflows/ci.yml (3)
161-162: LGTM — draft release notification updated tocompatibleMongoVersions: ["8.0"].Consistent with the version policy change.
551-552: LGTM — EE test jobs updated to MongoDB 8.0.Both
test-api-eeandtest-ui-eeconsistently use['8.0']for mongodb-version and'8.0'for coverage.Also applies to: 573-574
984-985: LGTM — final release notification updated consistently..github/workflows/ci-test-e2e.yml (1)
22-25: LGTM — default MongoDB version updated to 8.0 LTS.Aligns with the PR objective to target the long-term-support release instead of the short-lived 8.2 Rapid Release.
package.json (1)
31-31: New utility script for MongoDB version management looks good.Centralizing version updates via
set:mongo-versionis a solid approach to keep CI workflows, Docker Compose files, and other configs in sync. Verify the referenced script exists and handles edge cases (e.g., no arguments, invalid version format).
[approve_code_changes, request_verification]#!/bin/bash # Verify the script file exists and check its basic structure fd 'set-mongo-version.mjs' --type f echo "---" cat scripts/set-mongo-version.mjs 2>/dev/null | head -40
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
| if (!skipMongoDbDeprecationCheck && semver.satisfies(semver.coerce(mongoVersion)!, '<8.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 8.0 OR GREATER', | ||
| ].join('\n'); | ||
| showWarningBox('DEPRECATION', msg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #38596 +/- ##
===========================================
- Coverage 70.41% 70.36% -0.05%
===========================================
Files 3162 3174 +12
Lines 110663 110886 +223
Branches 19940 19927 -13
===========================================
+ Hits 77923 78026 +103
- Misses 30711 30815 +104
- Partials 2029 2045 +16
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Co-authored-by: ggazzo <5263975+ggazzo@users.noreply.github.com>
Co-authored-by: ggazzo <5263975+ggazzo@users.noreply.github.com>
…ecation-warning Fix MongoDB <8.0 deprecation warning for version 8.x
We initially documented MongoDB 8.2 as the minimum supported version. However, MongoDB 8.2 belongs to the Rapid Release channel, which has a short support lifecycle (approximately three months).
To avoid relying on short-lived releases and to provide a more stable and predictable support matrix, we have adjusted the minimum supported MongoDB version to MongoDB 8.
With this change, we explicitly commit that this Rocket.Chat version is tested and guaranteed to work with MongoDB 8.x.
https://rocketchat.atlassian.net/browse/CORE-1814
Proposed changes (including videos or screenshots)
Issue(s)
Steps to test or reproduce
Further comments
Summary by CodeRabbit