-
Notifications
You must be signed in to change notification settings - Fork 1
separate dev and prod dbs #583
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: dev
Are you sure you want to change the base?
Conversation
WalkthroughThe changes introduce distinct production and development RDS database resources in the infrastructure code, updating references to these databases accordingly. The Docker Compose file updates the PostGIS image version for the database service. Additionally, a correction is made to the environment variable used for the AWS secret access key in the application settings. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev_ApiStack
participant Prod_ApiStack
participant CommonStack
participant Dev_Database
participant Prod_Database
Dev_ApiStack->>CommonStack: Request dev_database
CommonStack->>Dev_Database: Return dev_database instance
Prod_ApiStack->>CommonStack: Request prod_database
CommonStack->>Prod_Database: Return prod_database instance
Tip ⚡️ Faster reviews with caching
Enjoy the performance boost—your workflow just got faster. ✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
docker-compose.yml(1 hunks)iac/app.py(2 hunks)iac/stacks/common.py(3 hunks)src/app/settings.py(1 hunks)
🔇 Additional comments (8)
iac/stacks/common.py (5)
66-76: Good refactoring of database resources - production database setup looks good.The code properly renames the original database elements to clearly indicate they are for production use. The instance size upgrade from SMALL to MEDIUM is also a good improvement for production workloads.
Also applies to: 78-92
94-104: Development database credentials are properly isolated.Good implementation of separate credentials for the development database with a distinct secret name path, which ensures proper isolation between environments.
215-216: Security group rules properly updated for both databases.The security group configuration now correctly allows ECS tasks to connect to both production and development databases.
221-226: Subnet access properly configured for both databases.Good implementation of allowing access from each private subnet CIDR block to both database instances.
106-120:Details
❓ Verification inconclusive
Development database uses newer Postgres version - verify compatibility.
The development database uses Postgres 16.3 while production uses 13.7. This separation allows testing with newer versions before production adoption.
Consider testing application compatibility with both database versions to ensure there are no issues with the version difference. PostgreSQL 16 introduced some changes that could potentially affect application behavior.
🏁 Script executed:
#!/bin/bash # Check versions and compatibility notes between the PostgreSQL versions used echo "Comparing PostgreSQL 13.7 and 16.3 compatibility" rg -A 5 "PostgreSQL (13|16)" src/Length of output: 142
🏁 Script executed:
#!/bin/bash echo "Listing all Postgres engine version usages in iac/stacks" rg -n "DatabaseInstanceEngine\\.postgres" -A2 iac/stacks echo echo "Listing all PostgresEngineVersion constants in iac/stacks" rg -n "PostgresEngineVersion\\.VER" -n iac/stacksLength of output: 1149
Verify PostgreSQL Version Compatibility
The development RDS instance is using Postgres 16.3 (iac/stacks/common.py:110–112) while production remains on 13.7 (iac/stacks/common.py:82–84). Please ensure the application is fully compatible with both versions, particularly around any query syntax changes or deprecated features introduced in Postgres 16, before promoting 16.x to production.
- iac/stacks/common.py:82–84 – Production engine version: PostgresEngineVersion.VER_13_7
- iac/stacks/common.py:110–112 – Development engine version: PostgresEngineVersion.VER_16_3
docker-compose.yml (1)
14-14:Details
❓ Verification inconclusive
Updated PostGIS image version to align with development database.
The PostGIS image has been updated from version 13-3.2-alpine to 17-3.5-alpine to align with the newer Postgres version used in the development environment.
Verify that your application works with this newer PostgreSQL version (17) as it's higher than even the development database version (16.3).
🏁 Script executed:
#!/bin/bash # Check for PostgreSQL version-specific code or dependencies echo "Searching for PostgreSQL version-specific dependencies or code..." grep -r "postgresql.*version\|postgres.*version" --include="*.py" --include="*.json" --include="*.yml" ./src/Length of output: 252
Verify PostgreSQL 17 compatibility
A recursive grep in
./src/for version-specific Postgres references returned no matches, suggesting the app is largely DB-agnostic. However, because you’ve bumped from 13→17 (even beyond your dev DB’s 16.3), please manually confirm:• Update your CI/workflow to pull
postgis/postgis:17-3.5-alpineand run the full test suite.
• Spin up a local PostGIS 17 container and exercise all database migrations.
• Run integration/end-to-end tests against the new image to catch any SQL or driver incompatibilities.iac/app.py (2)
57-57: Updated development API stack to use dev database.Correctly updated the development API stack to reference the dedicated development database.
85-85: Updated production API stack to use production database.Correctly updated the production API stack to reference the dedicated production database.
michaelconnor00
left a comment
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.
Looks good.
Summary by CodeRabbit