Skip to content

Conversation

@rodrigok
Copy link
Member

@rodrigok rodrigok commented Oct 24, 2025

https://rocketchat.atlassian.net/browse/ARCH-1845

Proposed changes (including videos or screenshots)

Issue(s)

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • Chores
    • Added official support for MongoDB 8.2 and broadened supported version ranges to include 5, 6, 7, and 8.
    • Updated CI and local deployment to use MongoDB 8.2, adjusted startup and replica-set initialization flow, and removed several legacy replica-set environment variables.

@rodrigok rodrigok added this to the 7.13.0 milestone Oct 24, 2025
@rodrigok rodrigok requested a review from a team as a code owner October 24, 2025 12:39
@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Oct 24, 2025

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is targeting the wrong base branch. It should target 7.13.0, but it targets 7.12.0

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Oct 24, 2025

⚠️ No Changeset found

Latest commit: 70192d9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link

coderabbitai bot commented Oct 24, 2025

Walkthrough

CI workflows and local compose updated to add MongoDB 8.2 support: CI matrices and compatibility arrays now include 8/8.2, RC Docker selection logic checks for 8.2, and the local mongo service uses mongodb/mongodb-community-server:8.2-ubi8 with a custom entrypoint that starts mongod and initiates a replica set.

Changes

Cohort / File(s) Summary
CI Workflows
.github/workflows/ci-test-e2e.yml, .github/workflows/ci.yml
Test matrix default changed from ['5.0','7.0']['5.0','8.2']; compatibility arrays in curl payloads updated from ["5.0","6.0","7.0"]["5","6","7","8"]; RC Dockerfile/tag derivation and job name suffix updated to check for 8.2 instead of 7.0.
Local Compose & Entrypoint
docker-compose-local.yml
Mongo image changed from docker.io/bitnamilegacy/mongodb:7.0.1mongodb/mongodb-community-server:8.2-ubi8; removed several replica-set env vars (e.g., MONGODB_REPLICA_SET_MODE, MONGODB_INITIAL_PRIMARY_PORT_NUMBER, MONGODB_ADVERTISED_HOSTNAME, MONGODB_ENABLE_JOURNAL, ALLOW_EMPTY_PASSWORD); added custom entrypoint that launches mongod with --replSet and --bind_ip_all, polls readiness with mongosh, and runs rs.initiate() to configure the replica set.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Compose as docker-compose-local
  participant Container as mongo:8.2-ubi8 (entrypoint)
  participant Mongod as mongod
  participant Mongosh as mongosh

  Compose->>Container: start container (custom entrypoint)
  Container->>Mongod: launch mongod --replSet <RS_NAME> --bind_ip_all
  Container->>Mongosh: poll for readiness (loop)
  loop until ready
    Mongosh->>Mongod: isMaster / ping
  end
  Mongosh->>Mongod: rs.initiate({_id: RS_NAME, members:[{_id:0, host:HOST:PORT}]})
  Mongod-->>Mongosh: initiation result
  Container-->>Compose: log success / exit entrypoint
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Review focus:
    • .github/workflows/ci-test-e2e.yml — matrix defaults and RC selection conditions that reference 8.2.
    • .github/workflows/ci.yml — updated compatibility arrays embedded in curl payloads.
    • docker-compose-local.yml — image tag (8.2-ubi8), removed env vars impact, and entrypoint script correctness (readiness polling, rs.initiate() parameters and error handling).

Poem

🐰 I swapped a seven for eight-two with glee,
I start mongod, I wait, then rs begins to be.
Logs hum like carrots, members take their place,
Replica seeds planted in a cozy space,
Hop, nibble, commit — a tiny rabbit's glee. 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "chore: add support for MongoDB 8" directly corresponds to the primary objective of the changeset. The modifications across the workflow files and docker-compose configuration all focus on updating MongoDB from version 7.0 to 8.2, which clearly aligns with adding MongoDB 8 support. The title is concise, specific, and accurately reflects the main change a teammate would understand from scanning the commit history.
Out of Scope Changes Check ✅ Passed The changes are largely focused on MongoDB version upgrades from 7.0 to 8.2 across CI workflows and docker-compose configuration. However, the docker-compose-local.yml change includes a significant alteration beyond version bumping: switching the MongoDB image provider from Bitnami legacy (docker.io/bitnamilegacy/mongodb:7.0.1) to the official MongoDB Community Server image (mongodb/mongodb-community-server:8.2-ubi8), along with custom entrypoint logic replacing Bitnami-specific environment variables. While this change appears necessary to support MongoDB 8.2 (since the Bitnami legacy image likely lacks 8.x support), it represents a notable infrastructure change that warrants careful review.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/add-support-for-mongodb-8

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Oct 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.90%. Comparing base (6f4362b) to head (70192d9).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #37294      +/-   ##
===========================================
- Coverage    67.92%   67.90%   -0.02%     
===========================================
  Files         3356     3356              
  Lines       114887   114887              
  Branches     20758    20748      -10     
===========================================
- Hits         78035    78017      -18     
- Misses       34162    34185      +23     
+ Partials      2690     2685       -5     
Flag Coverage Δ
e2e 57.45% <ø> (+0.03%) ⬆️
unit 71.96% <ø> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rodrigok rodrigok force-pushed the chore/add-support-for-mongodb-8 branch from e97f427 to d549e71 Compare October 25, 2025 12:36
Copy link

@coderabbitai coderabbitai bot left a 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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between e97f427 and d549e71.

📒 Files selected for processing (3)
  • .github/workflows/ci-test-e2e.yml (2 hunks)
  • .github/workflows/ci.yml (3 hunks)
  • docker-compose-local.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/ci-test-e2e.yml
  • .github/workflows/ci.yml
⏰ 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). (3)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🔇 Additional comments (2)
docker-compose-local.yml (2)

154-156: Verify removed environment variables do not break MongoDB configuration.

The updated compose file removes several Bitnami-specific environment variables (MONGODB_REPLICA_SET_MODE, MONGODB_ENABLE_JOURNAL, ALLOW_EMPTY_PASSWORD, MONGODB_ADVERTISED_HOSTNAME). Confirm that this transition from Bitnami to official MongoDB image does not inadvertently change behavior—specifically, verify that:

  • Journal logging remains enabled (should be default in MongoDB 8.2)
  • Replica set initialization still functions correctly without MONGODB_REPLICA_SET_MODE
  • The local development environment operates as expected

157-168: Entrypoint format should use array format (best practice), but the original is not syntactically invalid.

The original YAML syntax is actually valid and parses successfully. The review's claims about quote mismatches and malformed literal blocks are incorrect—the YAML parser confirms the structure is sound and preserves the script correctly with proper escaping.

However, the array format recommended is still the better approach for Docker Compose entrypoints because:

  • Array format (exec form) is the Docker standard and more predictable
  • String form entrypoints can have ambiguous shell interpretation with preserved indentation
  • Array form cleanly separates the command from arguments

Update to array format for clarity and to follow Docker best practices, but note the original wasn't technically "malformed."

@rodrigok rodrigok force-pushed the chore/add-support-for-mongodb-8 branch from d549e71 to ef5afb3 Compare October 25, 2025 13:19
@rodrigok rodrigok force-pushed the chore/add-support-for-mongodb-8 branch from ef5afb3 to 4f1c278 Compare October 25, 2025 13:59
Copy link

@coderabbitai coderabbitai bot left a 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

🧹 Nitpick comments (1)
docker-compose-local.yml (1)

149-156: Vestigial Bitnami environment variables do not affect official MongoDB image.

The official mongodb-community-server:8.2-ubi8 image does not support Bitnami-specific environment variables (MONGODB_REPLICA_SET_NAME, MONGODB_PORT_NUMBER, MONGODB_INITIAL_PRIMARY_HOST). However, these lines remain in the compose file. While harmless since the official image ignores them, consider removing these variables to reduce confusion or adding a comment explaining they're preserved for reference in the custom entrypoint initialization script.

For clarity, consider removing or documenting these variables:

  mongo:
    image: mongodb/mongodb-community-server:8.2-ubi8
    restart: on-failure
    ports:
      - 27017:27017
-   environment:
-     MONGODB_REPLICA_SET_NAME: ${MONGODB_REPLICA_SET_NAME:-rs0}
-     MONGODB_PORT_NUMBER: ${MONGODB_PORT_NUMBER:-27017}
-     MONGODB_INITIAL_PRIMARY_HOST: ${MONGODB_INITIAL_PRIMARY_HOST:-mongo}
    entrypoint: |
      bash -c
        "mongod --replSet ${MONGODB_REPLICA_SET_NAME:-rs0} --bind_ip_all &
...

Alternatively, move these to a separate # Configuration comment section if they're used by downstream services.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between ef5afb3 and 4f1c278.

📒 Files selected for processing (3)
  • .github/workflows/ci-test-e2e.yml (3 hunks)
  • .github/workflows/ci.yml (3 hunks)
  • docker-compose-local.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/ci.yml
⏰ 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). (3)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🔇 Additional comments (3)
.github/workflows/ci-test-e2e.yml (2)

29-29: Version update is correct.

The default MongoDB version matrix has been appropriately updated to include 8.2 and drop 7.0.


119-120: I need to verify whether the specific Docker tags with the -ubi8 suffix actually exist on Docker Hub for the mongodb-community-server image.

No issues found—configuration is correct.

Docker Hub includes images with -ubi8 tags for mongodb-community-server (e.g., 5.0.14-ubi8, 8.0.14-ubi8). The workflow correctly appends the -ubi8 suffix to version matrix values, and the GitHub action passes this string directly to Docker, which resolves to the appropriate image tag. No double-suffix issue exists.

docker-compose-local.yml (1)

157-168: Custom entrypoint shell script is syntactically valid and logically correct.

Verification confirms the docker-compose entrypoint script passes YAML and bash syntax validation. The multi-line format executes correctly, variable substitution with $$ is proper, the wait command correctly waits for the backgrounded mongod process, and the replica set initialization logic follows the expected sequence: start mongod, poll for readiness with mongosh, then initialize the replica set. No syntax or structural issues found.

@sampaiodiego sampaiodiego added the stat: QA assured Means it has been tested and approved by a company insider label Oct 28, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Oct 28, 2025
@kodiakhq kodiakhq bot merged commit 88aa28e into develop Oct 28, 2025
48 checks passed
@kodiakhq kodiakhq bot deleted the chore/add-support-for-mongodb-8 branch October 28, 2025 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants