Skip to content

Conversation

@gocanto
Copy link
Collaborator

@gocanto gocanto commented Jan 2, 2026

Summary by CodeRabbit

  • Chores
    • Enhanced deployment process with improved service startup orchestration and database health verification before migrations execute
    • Added informative status messages throughout deployment steps for better operational visibility

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 2, 2026

Warning

Rate limit exceeded

@gocanto has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 7 minutes and 11 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 773751c and bb8ab70.

📒 Files selected for processing (3)
  • Makefile
  • infra/makefile/build.mk
  • infra/makefile/db.mk

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

The build-deploy target in infra/makefile/build.mk was refactored to replace inline migration execution with a staged deployment sequence. The new flow ensures the migration script is executable, starts the database service, waits for database health confirmation with a timeout, runs migrations via make db:migrate, and starts remaining services, with echo messages at each step.

Changes

Cohort / File(s) Summary
Build Deployment Orchestration
infra/makefile/build.mk
Restructured build-deploy target from immediate inline migration execution to a staged startup pipeline: (1) chmod migration script executable, (2) start database service, (3) health-check loop with timeout waiting for database readiness, (4) execute make db:migrate, (5) start remaining services. Added user-facing progress messages for each stage.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • chore: Run migrations on deployment #152: Also modifies the build-deploy target to execute make db:migrate as part of deployment, with this PR adding health-check orchestration and staged service startup around the migration execution.

Pre-merge checks

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'build' is vague and generic—it does not clearly convey the specific changes made to the build orchestration process. Provide a more descriptive title that explains the main change, such as 'Refactor build-deploy to add health checks and staged database startup' or similar.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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.

@gemini-code-assist
Copy link

Summary of Changes

Hello @gocanto, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the 'build-deploy' process within the 'infra/makefile/build.mk' file. The primary goal is to enhance the stability and reliability of deployments by introducing a structured sequence for database initialization and service startup. This ensures that the database is fully prepared and migrated before dependent application services are launched, mitigating potential issues related to service availability and data consistency during deployment.

Highlights

  • Database Health Check: Introduced a step to explicitly start the 'api-db' service and wait for it to report a 'healthy' status before proceeding with further build steps, ensuring database readiness.
  • Migration Execution Order: Changed the order of operations to ensure database migrations are run only after the database service is confirmed to be healthy and running, preventing premature migration attempts.
  • Service Startup Sequencing: Modified the 'build-deploy' target to start the main application services only after the database is healthy and migrations have been successfully applied, improving deployment stability.
  • Build Process Visibility: Added informative 'echo' messages to the build output, providing clearer feedback on the current stage of the deployment process for better monitoring.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gocanto gocanto marked this pull request as ready for review January 2, 2026 02:53
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request significantly improves the build-deploy process by introducing a health check to ensure the database is fully ready before running migrations. This is an excellent change that makes the deployment more robust and reliable by preventing potential race conditions. I have added a couple of minor suggestions to replace hardcoded values with existing Makefile variables to further improve maintainability.

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
infra/makefile/build.mk (1)

40-43: Critical: Environment variables not properly exported.

The environment variable assignments on lines 41-43 are not effective. In Makefiles, each line runs in a separate shell, so these variables won't be available to subsequent commands (lines 44-53). This will cause the database connection to fail.

🔎 Proposed fix
 build-deploy:
-	@DB_SECRET_USERNAME="$(DB_SECRET_USERNAME)" \
-	DB_SECRET_PASSWORD="$(DB_SECRET_PASSWORD)" \
-	DB_SECRET_DBNAME="$(DB_SECRET_DBNAME)"
-	chmod +x "$(DB_INFRA_SCRIPTS_PATH)/postgres-entrypoint.sh" && \
+	@export DB_SECRET_USERNAME="$(DB_SECRET_USERNAME)" && \
+	export DB_SECRET_PASSWORD="$(DB_SECRET_PASSWORD)" && \
+	export DB_SECRET_DBNAME="$(DB_SECRET_DBNAME)" && \
+	chmod +x "$(DB_INFRA_SCRIPTS_PATH)/postgres-entrypoint.sh" && \
 	chmod +x "$(DB_INFRA_SCRIPTS_PATH)/run-migration.sh"

Alternatively, prefix each docker compose command with the variables:

 build-deploy:
-	@DB_SECRET_USERNAME="$(DB_SECRET_USERNAME)" \
-	DB_SECRET_PASSWORD="$(DB_SECRET_PASSWORD)" \
-	DB_SECRET_DBNAME="$(DB_SECRET_DBNAME)"
-	chmod +x "$(DB_INFRA_SCRIPTS_PATH)/postgres-entrypoint.sh" && \
-	chmod +x "$(DB_INFRA_SCRIPTS_PATH)/run-migration.sh"
+	@chmod +x "$(DB_INFRA_SCRIPTS_PATH)/postgres-entrypoint.sh" && \
+	chmod +x "$(DB_INFRA_SCRIPTS_PATH)/run-migration.sh"
 	@echo "Starting database service..."
-	docker compose --env-file ./.env up api-db -d
+	@DB_SECRET_USERNAME="$(DB_SECRET_USERNAME)" \
+	DB_SECRET_PASSWORD="$(DB_SECRET_PASSWORD)" \
+	DB_SECRET_DBNAME="$(DB_SECRET_DBNAME)" \
+	docker compose --env-file ./.env up api-db -d
 	@echo "Waiting for database to be healthy..."
 	@timeout 60 sh -c 'until docker inspect --format="{{.State.Health.Status}}" oullin_db 2>/dev/null | grep -q "healthy"; do sleep 2; done' || (echo "Database failed to become healthy" && exit 1)
 	@echo "Running migrations..."
-	make db:migrate
+	@DB_SECRET_USERNAME="$(DB_SECRET_USERNAME)" \
+	DB_SECRET_PASSWORD="$(DB_SECRET_PASSWORD)" \
+	DB_SECRET_DBNAME="$(DB_SECRET_DBNAME)" \
+	make db:migrate
 	@echo "Starting remaining services..."
-	docker compose --env-file ./.env --profile prod up -d
+	@DB_SECRET_USERNAME="$(DB_SECRET_USERNAME)" \
+	DB_SECRET_PASSWORD="$(DB_SECRET_PASSWORD)" \
+	DB_SECRET_DBNAME="$(DB_SECRET_DBNAME)" \
+	docker compose --env-file ./.env --profile prod up -d
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 773751c and e9d8fab.

📒 Files selected for processing (1)
  • infra/makefile/build.mk
⏰ 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). (1)
  • GitHub Check: test (1.25.5)
🔇 Additional comments (2)
infra/makefile/build.mk (2)

49-49: No action needed. The container naming is correct. The api-db service is configured in docker-compose.yml with container_name: oullin_db, so the health check on line 49 will successfully find and inspect the correct container.

Likely an incorrect or invalid review comment.


45-45: The run-migration.sh script is actively used. When make db:migrate is called, it runs the api-db-migrate Docker service (docker-compose.yml lines 409-422), which uses run-migration.sh as its entrypoint (line 421). The chmod +x ensures the script has proper execute permissions before the Docker service is started.

Likely an incorrect or invalid review comment.

@gocanto
Copy link
Collaborator Author

gocanto commented Jan 2, 2026

@coderabbitai full review

@coderabbitai
Copy link

coderabbitai bot commented Jan 2, 2026

✅ Actions performed

Full review triggered.

@gocanto
Copy link
Collaborator Author

gocanto commented Jan 2, 2026

@codex review

@gocanto gocanto merged commit 5d575c0 into main Jan 2, 2026
3 checks passed
@gocanto gocanto deleted the hotfix/build branch January 2, 2026 03:10
@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Keep it up!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants