Skip to content

Conversation

@levivannoort
Copy link
Contributor

@levivannoort levivannoort commented Nov 26, 2025

Added healthchecks to the various test dependencies within the docker-compose. These healthchecks differ in implementation per database.

levi@apws utopia/database <branch> $ docker compose up -d --wait
[+] Running 12/12
 ✔ Container utopia-mysql            Healthy                                                                                                                                                                                    1.6s
 ✔ Container utopia-postgres-mirror  Healthy                                                                                                                                                                                    1.6s
 ✔ Container utopia-redis            Healthy                                                                                                                                                                                    1.6s
 ✔ Container utopia-mongo            Healthy                                                                                                                                                                                    1.6s
 ✔ Container utopia-adminer          Healthy                                                                                                                                                                                    1.6s
 ✔ Container utopia-mariadb-mirror   Healthy                                                                                                                                                                                    6.1s
 ✔ Container utopia-postgres         Healthy                                                                                                                                                                                    1.6s
 ✔ Container utopia-redis-mirror     Healthy                                                                                                                                                                                    1.6s
 ✔ Container mongo-express           Healthy                                                                                                                                                                                    1.6s
 ✔ Container utopia-mysql-mirror     Healthy                                                                                                                                                                                    1.6s
 ✔ Container utopia-mariadb          Healthy                                                                                                                                                                                    6.1s
 ✔ Container tests                   Healthy 

Summary by CodeRabbit

  • Chores
    • Improved test infrastructure by adding readiness health checks for databases, Redis, and Mongo to ensure services are ready before tests run.
    • Replaced fixed sleep waits with a container-ready wait to make test workflows more reliable and deterministic.

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 26, 2025

Walkthrough

Replaces fixed sleep-based waits with Docker Compose's readiness wait in CI and adds explicit healthchecks plus depends_on service_healthy conditions for multiple database and cache services in docker-compose to coordinate startup.

Changes

Cohort / File(s) Summary
CI workflow
\.github/workflows/tests.yml
Replaced two occurrences of docker compose up -d followed by a fixed sleep with docker compose up -d --wait in unit_test and adapter_test flows so the job waits for service readiness.
Docker Compose
docker-compose.yml
Added depends_on (using condition: service_healthy) for the tests service referencing postgres, postgres-mirror, mariadb, mariadb-mirror, mysql, mysql-mirror, redis, redis-mirror, and mongo. Introduced or adjusted healthcheck blocks for Postgres (pg_isready), MariaDB (innodb_initialized via healthcheck.sh), MySQL (mysqladmin ping), Redis (redis-cli ping), and Mongo (interval/start_period changes). No image, port, or version changes reported.

Sequence Diagram(s)

sequenceDiagram
  participant CI as CI job
  participant DC as Docker Compose
  participant Svc as Services
  participant Test as Test step

  rect rgb(230,245,255)
    CI->>DC: docker compose up -d --wait
    note right of DC: Start containers\nand wait for healthchecks
  end

  rect rgb(240,255,230)
    DC->>Svc: start containers\nrun healthchecks
    alt service healthy
      Svc-->>DC: service_healthy
    else unhealthy (retries)
      Svc-->>DC: failing -> retry per healthcheck
    end
  end

  rect rgb(255,245,230)
    DC->>CI: all required services healthy
    CI->>Test: run unit/adapters tests
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify each healthcheck command and timing (interval, timeout, retries, start_period) suits the service startup semantics.
  • Confirm depends_on declarations don't introduce unintended ordering issues or cycles.
  • Ensure CI runner supports the Docker Compose --wait behavior.

Poem

🐰 I hopped through YAML, nibbled a sleep,
Replaced the guess with checks that peep.
Containers sigh, then shout "I'm ready!"
Tests begin, paws light and steady.
Hooray — startup hops are neat and speedy! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes both main changes: adding health checks to docker-compose and removing sleep from the pipeline workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch task/improvements-to-docker-compose-and-pipeline

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 011e1fe and be52232.

📒 Files selected for processing (2)
  • .github/workflows/tests.yml (2 hunks)
  • docker-compose.yml (10 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/tests.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). (14)
  • GitHub Check: Adapter Tests (Schemaless/MongoDB)
  • GitHub Check: Adapter Tests (SharedTables/SQLite)
  • GitHub Check: Adapter Tests (SharedTables/Postgres)
  • GitHub Check: Adapter Tests (SharedTables/MySQL)
  • GitHub Check: Adapter Tests (SharedTables/MongoDB)
  • GitHub Check: Adapter Tests (MySQL)
  • GitHub Check: Adapter Tests (SQLite)
  • GitHub Check: Adapter Tests (Pool)
  • GitHub Check: Adapter Tests (Mirror)
  • GitHub Check: Adapter Tests (SharedTables/MariaDB)
  • GitHub Check: Adapter Tests (Postgres)
  • GitHub Check: Adapter Tests (MariaDB)
  • GitHub Check: Adapter Tests (MongoDB)
  • GitHub Check: Unit Test

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.

@levivannoort levivannoort marked this pull request as ready for review November 26, 2025 10:29
Copy link
Contributor

@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: 2

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5e634a7 and 2ee4c32.

📒 Files selected for processing (2)
  • .github/workflows/tests.yml (2 hunks)
  • docker-compose.yml (10 hunks)
⏰ 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). (2)
  • GitHub Check: Adapter Tests (Mirror)
  • GitHub Check: Adapter Tests (Pool)
🔇 Additional comments (1)
.github/workflows/tests.yml (1)

57-60: Workflow changes look good, pending docker-compose validation.

Both test jobs now use docker compose up -d --wait to wait for service readiness via health checks instead of fixed sleep delays. This is a solid improvement for deterministic startup—however, it depends on proper depends_on configuration with condition: service_healthy in docker-compose.yml for the tests service.

I'll validate this in the docker-compose.yml review below.

Also applies to: 100-103

@loks0n loks0n merged commit fbe23a3 into main Dec 12, 2025
18 checks passed
@loks0n loks0n deleted the task/improvements-to-docker-compose-and-pipeline branch December 12, 2025 09:35
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.

3 participants