-
-
Notifications
You must be signed in to change notification settings - Fork 0
[hotfix] Standardise db creds #47
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
WalkthroughThis update standardizes environment variable and secret naming conventions for database credentials across configuration files, including Docker Compose and build scripts. It introduces new example environment files for production and GitHub environments, renames secret references and environment variables, adds explicit image tags to certain services in Docker Compose, and modifies the CI workflow to build release images using new Makefile targets. Additionally, the local environment example file was extended with Docker user and group variables. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant EnvProd as .env.prod.example
participant EnvGH as .env.gh.example
participant EnvLocal as .env.example
participant Make as build.mk
participant Compose as docker-compose.yml
participant HealthCheck as healthcheck.sh
participant CI as GitHub Actions Deploy Workflow
participant API as API Service
participant DB as Database
Dev->>EnvProd: Reference production env template variables
Dev->>EnvGH: Reference GitHub env template variables
Dev->>EnvLocal: Reference local Docker user/group env variables
Dev->>Make: Run build:ci (uses standardized DB_SECRET_* vars)
Make->>Compose: Pass standardized secret env vars to Docker Compose
Compose->>API: Injects DB_SECRET_* variables
API->>DB: Uses secrets for DB connection
HealthCheck->>DB: Reads secrets from updated secret file paths
CI->>Make: Trigger build:ci after updated workflow steps
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ 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
CodeRabbit Configuration File (
|
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)
database/infra/scripts/healthcheck.sh (1)
7-8: Trim trailing newline from secrets to avoid subtle failures
catpreserves the trailing newline usually present in Docker secrets.pg_isreadytreats\nliterally, so authentication may fail with “role "\n" does not exist”.-DB_USER=$(cat /run/secrets/pg_username) -DB_NAME=$(cat /run/secrets/pg_dbname) +read -r DB_USER < /run/secrets/pg_username +read -r DB_NAME < /run/secrets/pg_dbname
read -rcleanly strips the newline without spawning an extra subshell, keeping the script POSIX-sh portable and a bit faster.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
database/infra/scripts/healthcheck.sh(1 hunks)docker-compose.yml(7 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- docker-compose.yml
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 (2)
.github/workflows/deploy.yml (2)
53-59: Harden the directory-listing debug step
ls -la ./storage/logswill fail the job if that directory isn’t present in a fresh checkout (very common in CI). Either make the command tolerant to absence or wrap it with a conditional.- ls -la ./storage/logs + [ -d ./storage/logs ] && ls -la ./storage/logs || echo "storage/logs does not exist"
60-62: Ensure Docker Compose plugin is available
docker compose --profile prod configrelies on the Compose CLI plugin being pre-installed on the runner. While GitHub’s default runners currently bundle it, that guarantee isn’t explicit.
Consider adding an explicit installation (e.g.,docker/setup-buildx-actionwithinstall: trueor a separatedocker/setup-qemu-action) or at least adocker compose versionsanity check so the failure mode is clearer.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.env.example(1 hunks).github/workflows/deploy.yml(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- .env.example
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Summary by CodeRabbit