-
Couldn't load subscription status.
- Fork 12.3k
chore: add support for MongoDB 8 #37294
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
Conversation
|
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 |
|
WalkthroughCI workflows and local compose updated to add MongoDB 8.2 support: CI matrices and compatibility arrays now include Changes
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
e97f427 to
d549e71
Compare
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
📜 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.
📒 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."
d549e71 to
ef5afb3
Compare
ef5afb3 to
4f1c278
Compare
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
🧹 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-ubi8image 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
# Configurationcomment 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.
📒 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-ubi8suffix actually exist on Docker Hub for the mongodb-community-server image.No issues found—configuration is correct.
Docker Hub includes images with
-ubi8tags for mongodb-community-server (e.g.,5.0.14-ubi8,8.0.14-ubi8). The workflow correctly appends the-ubi8suffix 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, thewaitcommand correctly waits for the backgroundedmongodprocess, 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.
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