Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
Integrate the server with MongoDB by parameterizing the connection URI and updating deployment manifests.
- Parameterize MongoDB URI in
application.yamlusingMONGO_USERNAME,MONGO_PASSWORD, andMONGO_HOST. - Bump MongoDB image version to 8.0 in the Helm chart and Docker Compose.
- Replace default init environment variables in the Helm chart.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| server/src/main/resources/application.yaml | Switched hard-coded MongoDB URI to templated environment values. |
| recipai-chart/templates/mongodb-deployment.yml | Updated MongoDB image to 8.0 and replaced init-user env variables. |
| docker-compose.dev.yml | Changed MongoDB image tag from latest to 8.0. |
Comments suppressed due to low confidence (5)
server/src/main/resources/application.yaml:21
- The MongoDB connection URI contains colons and slashes that may confuse the YAML parser. Wrap the entire URI in quotes (e.g.,
"mongodb://...") to ensure it’s parsed correctly.
uri: mongodb://${MONGO_USERNAME:admin}:${MONGO_PASSWORD:admin}@${MONGO_HOST:127.0.0.1:27017}/recipai?authSource=admin
recipai-chart/templates/mongodb-deployment.yml:31
- The official MongoDB image expects
MONGO_INITDB_ROOT_USERNAMEandMONGO_INITDB_ROOT_PASSWORDto initialize the database. Replacing them withMONGO_USERNAMEandMONGO_PASSWORDwill prevent the built-in init script from running correctly. Consider reverting to the expected variable names or adding an init container to handle custom names.
- - name: MONGO_HOST
recipai-chart/templates/mongodb-deployment.yml:32
- [nitpick] Embedding the port in
MONGO_HOSTcan be confusing. It may be clearer to define separateMONGO_HOSTandMONGO_PORTvariables for better clarity and future flexibility.
- - value: {{ .Values.services.mongodb }}:27017
docker-compose.dev.yml:48
- [nitpick] Pinning to a minor version tag (
8.0) can lead to unexpected patch upgrades. Consider specifying a full patch version (e.g.,8.0.5) to ensure consistent local environments.
image: mongo:8.0
server/src/main/resources/application.yaml:19
- The new environment variables (
MONGO_USERNAME,MONGO_PASSWORD,MONGO_HOST) should be documented in the README or deployment guide, including their defaults and expected formats.
data:
edkaya
approved these changes
Jun 10, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.