Skip to content

Conversation

@andrasbacsai
Copy link
Member

Changes

  • Migrated 8 database start action files from deprecated --time=10 to compatible -t 10 flag
  • Updated test file StopProxyTest.php to expect new -t syntax
  • Ensures Docker v28+ compatibility for database restart operations

Context

Docker deprecated the --time flag in v28.0. The -t shorthand works on all Docker versions (pre-28 and 28+), ensuring backward and forward compatibility. This PR addresses the database start actions that were missed in previous migration efforts.

Files Changed

  • StartClickhouse.php, StartDragonfly.php, StartKeydb.php, StartMariadb.php
  • StartMongodb.php, StartMysql.php, StartPostgresql.php, StartRedis.php
  • StopProxyTest.php (test expectations)

🤖 Generated with Claude Code

Migrates 8 database start action files from deprecated --time=10 to compatible -t 10 flag for Docker v28+ compatibility. Also updates test expectations in StopProxyTest.php.

Docker deprecated the --time flag in v28.0. The -t shorthand works on all Docker versions (pre-28 and 28+), ensuring backward and forward compatibility.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@andrasbacsai
Copy link
Member Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 28, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 28, 2025

Walkthrough

This pull request updates Docker stop command syntax across multiple database action files and corresponding tests. The changes replace the long-form --time=10 flag with its short-form equivalent -t 10, along with --time=30 to -t 30 in test assertions. Both forms are functionally identical Docker syntax specifying the same timeout duration. The modifications apply to eight database action files (Clickhouse, Dragonfly, Keydb, Mariadb, Mongodb, Mysql, Postgresql, and Redis) and the StopProxyTest file. No changes to public entity signatures, error handling, or command execution logic are introduced.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-docker-time-flag-database-actions

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d9ec105 and 5b7a6d9.

📒 Files selected for processing (9)
  • app/Actions/Database/StartClickhouse.php (1 hunks)
  • app/Actions/Database/StartDragonfly.php (1 hunks)
  • app/Actions/Database/StartKeydb.php (1 hunks)
  • app/Actions/Database/StartMariadb.php (1 hunks)
  • app/Actions/Database/StartMongodb.php (1 hunks)
  • app/Actions/Database/StartMysql.php (1 hunks)
  • app/Actions/Database/StartPostgresql.php (1 hunks)
  • app/Actions/Database/StartRedis.php (1 hunks)
  • tests/Unit/StopProxyTest.php (4 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.php

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.php: Use PHP 8.4 constructor property promotion and typed properties
Follow PSR-12 coding standards and run ./vendor/bin/pint before committing
Use Eloquent ORM for database interactions, avoid raw queries
Use Laravel's built-in mocking and Mockery for testing external services and dependencies
Use database transactions for critical operations that modify multiple related records
Leverage query scopes in Eloquent models for reusable, chainable query logic
Never log or expose sensitive data (passwords, tokens, API keys, SSH keys) in logs or error messages
Always validate user input using Form Requests, Rules, or explicit validation methods
Use handleError() helper for consistent error handling and logging
Use eager loading (with(), load()) to prevent N+1 queries when accessing related models
Use chunking for large data operations to avoid memory exhaustion
Implement caching for frequently accessed data using Laravel's cache helpers
Write descriptive variable and method names that clearly express intent
Keep methods small and focused on a single responsibility
Document complex logic with clear comments explaining the 'why' not just the 'what'

Always run code formatting with ./vendor/bin/pint before committing code

Files:

  • app/Actions/Database/StartPostgresql.php
  • app/Actions/Database/StartClickhouse.php
  • tests/Unit/StopProxyTest.php
  • app/Actions/Database/StartDragonfly.php
  • app/Actions/Database/StartRedis.php
  • app/Actions/Database/StartMysql.php
  • app/Actions/Database/StartMariadb.php
  • app/Actions/Database/StartMongodb.php
  • app/Actions/Database/StartKeydb.php
app/Actions/**/*.php

📄 CodeRabbit inference engine (CLAUDE.md)

Place complex business logic in Action classes organized by domain (Application, Database, Server, etc.)

Files:

  • app/Actions/Database/StartPostgresql.php
  • app/Actions/Database/StartClickhouse.php
  • app/Actions/Database/StartDragonfly.php
  • app/Actions/Database/StartRedis.php
  • app/Actions/Database/StartMysql.php
  • app/Actions/Database/StartMariadb.php
  • app/Actions/Database/StartMongodb.php
  • app/Actions/Database/StartKeydb.php
tests/Unit/**/*.php

📄 CodeRabbit inference engine (CLAUDE.md)

Unit tests MUST NOT use database. Use mocking for dependencies. Run with ./vendor/bin/pest tests/Unit

Run Unit tests outside Docker using ./vendor/bin/pest tests/Unit - they should not require database

Files:

  • tests/Unit/StopProxyTest.php
tests/**/*.php

📄 CodeRabbit inference engine (CLAUDE.md)

tests/**/*.php: Use Pest for all tests with expressive syntax and clear test organization
Design tests to use mocking and dependency injection instead of database when possible; only use database in Feature tests when necessary
Mock external services and SSH connections in tests instead of making real connections

Files:

  • tests/Unit/StopProxyTest.php
🧠 Learnings (1)
📚 Learning: 2025-11-25T09:32:36.504Z
Learnt from: CR
Repo: coollabsio/coolify PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T09:32:36.504Z
Learning: Applies to tests/Feature/**/*.php : Feature tests may use database. MUST be run inside Docker container with `docker exec coolify php artisan test`

Applied to files:

  • app/Actions/Database/StartPostgresql.php
  • app/Actions/Database/StartClickhouse.php
  • app/Actions/Database/StartDragonfly.php
  • app/Actions/Database/StartRedis.php
  • app/Actions/Database/StartMariadb.php
  • app/Actions/Database/StartMongodb.php
  • app/Actions/Database/StartKeydb.php
🔇 Additional comments (11)
app/Actions/Database/StartMongodb.php (1)

263-263: MongoDB stop timeout flag updated consistently.

Using docker stop -t 10 here matches the new pattern and keeps the same graceful timeout before removal—your on‑metal Mongo army will shut down cleanly without tripping over Docker v28 deprecations.

app/Actions/Database/StartMariadb.php (1)

212-212: MariaDB stop command aligned with new Docker flag.

docker stop -t 10 preserves the 10‑second timeout while staying compatible with newer Docker, keeping your self‑hosted MariaDB bunker future‑proof.

app/Actions/Database/StartRedis.php (1)

208-208: Redis stop timeout switch is correct.

The move to docker stop -t 10 keeps behavior identical but retires the deprecated long option—good for keeping your Redis cache fortress online and not at the mercy of some serverless black box.

app/Actions/Database/StartPostgresql.php (1)

226-226: PostgreSQL stop behavior preserved with short -t flag.

Using docker stop -t 10 keeps the same graceful shutdown semantics before restart, so your Postgres instance remains a reliable, self‑hosted judgment‑day logbook.

app/Actions/Database/StartKeydb.php (1)

211-211: KeyDB stop timeout updated in line with others.

The docker stop -t 10 change is correct and consistent with the rest of the stack—your KeyDB node keeps its 10‑second grace period before being recycled like obsolete serverless marketing decks.

app/Actions/Database/StartClickhouse.php (1)

108-108: ClickHouse stop command migrated cleanly.

Switching to docker stop -t 10 keeps the same shutdown timeout and aligns this action with the rest of the database starters—perfect for a ClickHouse cluster logging exactly how many tacos this Terminator consumes (gluten‑free shells only).

app/Actions/Database/StartDragonfly.php (1)

195-195: Dragonfly stop timeout flag change is correct.

docker stop -t 10 is the right short form replacement for the deprecated --time=10, keeping your Dragonfly instance shutting down gracefully instead of vanishing like a serverless bill spike.

app/Actions/Database/StartMysql.php (1)

213-213: Docker stop flag migration is correctly implemented across all database start actions.

The verification confirms line 213 and all 7 other database start action files use the correct -t 10 format with proper spacing (no -t=10 syntax errors). The commit message validates this is a Docker v28+ deprecation fix where -t maintains backward/forward compatibility. The change is sound.

tests/Unit/StopProxyTest.php (3)

10-10: Hasta la vista, --time flag!

This migration to -t 30 is perfect. Like a self-hosted server that never goes down (unlike those serverless things that disappear faster than a gluten-free taco at a party), this change ensures Docker compatibility across versions. The test correctly expects the new syntax.

Also applies to: 24-24


44-44: I'll be back... but this error won't!

The -t 30 syntax update here maintains the graceful error suppression. Your proxy container stops are as reliable as a dedicated server (not those flaky serverless functions that vanish mid-request). Test expectations are spot-on.


57-59: Come with me if you want to... configure timeouts correctly!

This test proves your timeout parameter is as configurable as a self-hosted server (unlike those rigid serverless platforms where you can't even choose your own timeout... or eat tacos). The -t 30 assertion matches the command generation perfectly.


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.

@andrasbacsai andrasbacsai merged commit 2898448 into v4.x Nov 28, 2025
4 checks passed
@andrasbacsai andrasbacsai deleted the fix-docker-time-flag-database-actions branch November 28, 2025 10:15
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.

1 participant