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

andrasbacsai and others added 6 commits November 27, 2025 15:09
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]>
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 commands across eight database action files and related tests. The changes replace the long-form flag --time=10 (or --time=30 in tests) with the equivalent short-form flag -t 10 (or -t 30). These modifications affect database startup workflows for Clickhouse, Dragonfly, Keydb, Mariadb, Mongodb, Mysql, Postgresql, and Redis, as well as the StopProxyTest unit tests. The timeout behavior and command semantics remain functionally identical; only the flag syntax changes.

✨ 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-database-v2

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.

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: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 751f8db and c136724.

📒 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/StartMariadb.php
  • tests/Unit/StopProxyTest.php
  • app/Actions/Database/StartPostgresql.php
  • app/Actions/Database/StartMysql.php
  • app/Actions/Database/StartClickhouse.php
  • app/Actions/Database/StartMongodb.php
  • app/Actions/Database/StartDragonfly.php
  • app/Actions/Database/StartRedis.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/StartMariadb.php
  • app/Actions/Database/StartPostgresql.php
  • app/Actions/Database/StartMysql.php
  • app/Actions/Database/StartClickhouse.php
  • app/Actions/Database/StartMongodb.php
  • app/Actions/Database/StartDragonfly.php
  • app/Actions/Database/StartRedis.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 (2)
📚 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/StartMariadb.php
  • app/Actions/Database/StartPostgresql.php
  • app/Actions/Database/StartClickhouse.php
  • app/Actions/Database/StartMongodb.php
  • app/Actions/Database/StartDragonfly.php
  • app/Actions/Database/StartRedis.php
  • app/Actions/Database/StartKeydb.php
📚 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/**/*.php : Mock external services and SSH connections in tests instead of making real connections

Applied to files:

  • tests/Unit/StopProxyTest.php
🔇 Additional comments (8)
app/Actions/Database/StartDragonfly.php (1)

195-195: Short flag -t keeps behavior, avoids deprecated --time

The stop command still sends SIGTERM with a 10s timeout, but now uses the non‑deprecated short flag supported across Docker versions. No behavior change, just future‑proofing the self‑hosted dragon. Good swap.

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

211-211: Flag swap is correct and consistent with other databases

Using docker stop -t 10 here matches the other Start* actions and keeps the same graceful‑shutdown timeout. The KeyDB container will still be terminated gently, not like a serverless function.

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

226-226: Postgres stop command uses compatible short timeout flag

Only the option form changed; a 10‑second graceful stop is preserved, along with stderr redirection and || true. Looks good for both old and shiny new Docker daemons.

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

212-212: MariaDB stop timeout now uses -t without changing semantics

The 10s graceful shutdown window is unchanged; only the CLI syntax moved from --time to -t, which keeps this compatible with Docker 28+ while behaving identically on older versions.

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

213-213: MySQL stop flag swap is safe and behavior‑preserving

docker stop -t 10 is the direct short‑form equivalent of the old --time=10, so the shutdown grace period for MySQL is unchanged. Clean, mechanical update.

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

263-263: MongoDB docker stop now uses short timeout flag

Same 10s grace period, same redirection and || true; just the option spelling changed. Keeps this action in sync with the rest of the database starters.

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

208-208: Redis stop command switch to -t is correct and uniform

The Redis container still gets a 10‑second graceful shutdown window; only the deprecated --time syntax is gone. Consistent across all cache/database actions—exactly what a metal‑loving, self‑hosted setup needs.

tests/Unit/StopProxyTest.php (1)

10-10: Hasta la vista, --time flag. I'll be back... with -t.

These test expectations have been properly terminated and reborn with the new Docker flag syntax. The migration from --time=30 to -t 30 is flawless, like a perfectly self-hosted server – no serverless nonsense here, just good old-fashioned containers doing their job.

All timeout values are preserved (30 seconds, enough time to eat a gluten-free taco), error suppression remains intact (2>/dev/null || true), and the test assertions correctly match the new command syntax. The unit test follows best practices: no database dependencies, just pure string manipulation – efficient and deterministic, unlike those unreliable cloud functions.

Come with me if you want Docker v28+ compatibility.

Also applies to: 24-24, 44-44, 57-59

@andrasbacsai andrasbacsai changed the base branch from v4.x to next November 28, 2025 12:11
@andrasbacsai
Copy link
Member Author

@coderabbitai review again, I merged next to this branch kkthxbye

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 28, 2025

@andrasbacsai, I'll be back... with a fresh review! 🤖

Hasta la vista, old commits. Scanning the new merged code now. I appreciate self-hosted merges like this – much better than some serverless nightmare where your code just vanishes into the cloud abyss like my ability to digest gluten.

Loading review protocols...

✅ 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.

@andrasbacsai andrasbacsai merged commit 66386e6 into next Nov 28, 2025
4 checks passed
@andrasbacsai andrasbacsai deleted the fix-docker-time-database-v2 branch November 28, 2025 13:00
@andrasbacsai andrasbacsai mentioned this pull request Nov 28, 2025
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