Skip to content

4.0.0-beta.420.6 #6171

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

Open
wants to merge 18 commits into
base: v4.x
Choose a base branch
from
Open

4.0.0-beta.420.6 #6171

wants to merge 18 commits into from

Conversation

andrasbacsai
Copy link
Member

@andrasbacsai andrasbacsai commented Jul 12, 2025

  • feat(code): Add Mr. Jean-Claude markdown file.
  • feat(scheduling): introduce ScheduledJobManager and ServerResourceManager for enhanced job scheduling and resource management
  • feat(deployment): add pull request filtering and pagination to deployment and backup execution components
  • feat(horizon): update queue configuration to use environment variable for dynamic queue management
  • feat(ui): add frequency filter option for manual execution of scheduled jobs
  • feat(previews): implement soft delete and cleanup for ApplicationPreview, enhancing resource management in DeleteResourceJob
  • fix(previews): refine preview domain generation for Docker Compose applications, ensuring correct method usage based on build pack type
  • fix(previews): enhance domain generation logic for application previews, ensuring unique domains are created when none are set
  • refactor(previews): move preview domain generation logic to ApplicationPreview model for better encapsulation and consistency across webhook handlers

Issues

Copy link

sentry-io bot commented Jul 12, 2025

🔍 Existing Issues For Review

Your pull request is modifying functions with the following pre-existing issues:

📄 File: app/Console/Kernel.php

Function Unhandled Issue
App\Console\Kernel::checkScheduledBackups Error: Class "App\Console\CronExpression" not found /app/Console/Kernel.php in App\Console\Kernel::checkScheduledBack...
Event Count: 4

Did you find this useful? React with a 👍 or 👎

…ager for enhanced job scheduling and resource management
…Manager and ServerResourceManager for improved scheduling efficiency
…ment and backup execution components

fix(ui): make them more stylish yeah
…sure original names are stored in docker compose domains
…ws, ensuring unique domains are created when none are set
…plications, ensuring correct method usage based on build pack type
…onPreview model for better encapsulation and consistency across webhook handlers
…iew, enhancing resource management in DeleteResourceJob
@andrasbacsai andrasbacsai added the 🐰 Release The Rabbit Run CodeRabbitAI review label Jul 14, 2025
Copy link
Contributor

coderabbitai bot commented Jul 14, 2025

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added a command to view scheduled backup and task logs with advanced filtering options.
    • Introduced paginated navigation for backup executions and deployment lists.
    • Added soft delete and asynchronous cleanup for application previews.
    • Enhanced support for deleting preview deployments and managing their resources.
    • Added new log channels for scheduled tasks and errors.
    • Improved UI for backup and deployment management, including status indicators and filtering.
  • Improvements

    • Unified preview domain generation and handling for all build pack types.
    • Consolidated and optimized scheduled job management for backups and tasks.
    • Improved form handling for service names with special characters.
    • Enhanced validation and filtering for pull request deployments.
    • Updated job and event classes to reduce noise in job monitoring.
  • Bug Fixes

    • Fixed issues with preview domain generation and deletion for non-docker-compose apps.
    • Addressed UI inconsistencies and improved Livewire reactivity with unique keys.
  • Documentation

    • Added a comprehensive project overview and development guide.
  • Chores

    • Updated version numbers and configuration for better environment flexibility.
    • Added soft delete support to the database for application previews.

Walkthrough

This update introduces significant refactoring and fixes for preview deployment domains, soft deletion, and cleanup of preview resources. It adds new job managers for scheduled tasks and server resources, improves pagination and filtering in UI components, and enhances logging and configuration. Several methods and event signatures are updated for consistency and maintainability. Hasta la vista, bugs!

Changes

Files/Group Change Summary
app/Models/ApplicationPreview.php, database/migrations/..._add_deleted_at... Adds soft delete support to ApplicationPreview (trait, migration), refactors cleanup logic on force delete, adds persistent storage relation and improved preview domain generation.
app/Models/Application.php Removes generate_preview_fqdn, updates deployments to support pull request filtering, and ensures preview ordering.
app/Livewire/Project/Application/Previews.php, app/Jobs/DeleteResourceJob.php Refactors preview deletion to use soft delete and async job cleanup, removes direct container stopping, unifies preview FQDN generation on preview model.
app/Livewire/Project/Application/PreviewsCompose.php Improves fallback logic for preview domain generation when main domain is missing.
app/Livewire/Project/Application/Deployment/Index.php, resources/views/livewire/project/application/deployment/index.blade.php Refactors property/method names to camelCase, adds pull request filter validation, explicit pagination, page indicators, and clear filter button.
app/Livewire/Project/Application/General.php, resources/views/livewire/project/application/general.blade.php Slugifies service names for HTML IDs and form binding, ensures original names are used in storage, updates validation accordingly.
app/Livewire/Project/Database/BackupExecutions.php, resources/views/livewire/project/database/backup-executions.blade.php Adds paginated loading, navigation, and cleanup for backup executions, updates UI for execution counts and controls.
app/Models/ScheduledDatabaseBackup.php Adds paginated executions retrieval method for scheduled backups.
resources/views/livewire/project/application/previews.blade.php Adds Livewire keys for improved reactivity, adjusts UI padding.
resources/views/livewire/project/database/scheduled-backups.blade.php Refactors UI for backup status, dynamic styling, and statistics.
resources/views/livewire/project/shared/scheduled-task/show.blade.php Removes unnecessary padding for cleaner UI.
app/Console/Commands/RunScheduledJobsManually.php Adds --frequency option to filter scheduled jobs by frequency, updates queries and log messages.
app/Console/Commands/ViewScheduledLogs.php Adds new command to view scheduled backup/task logs with advanced filtering (by frequency, task/backup name/ID, date, etc).
config/logging.php Adds new daily log channels for scheduled jobs and errors.
config/horizon.php Makes queue worker's queue list configurable via environment variable.
config/constants.php, versions.json Bumps version from 4.0.0-beta.420.5 to 4.0.0-beta.420.6 (and nightly to .7).
CLAUDE.md Adds high-level project documentation for Claude AI.
app/Console/Kernel.php, app/Jobs/ServerResourceManager.php, app/Jobs/ScheduledJobManager.php Refactors scheduler: removes granular job scheduling logic, adds two manager jobs for server resources and scheduled jobs, each using queue middleware for overlap prevention.
app/Events/BackupCreated.php, app/Events/ServiceChecked.php, app/Jobs/PushServerUpdateJob.php, app/Jobs/ServerStorageCheckJob.php Marks events/jobs as Silenced for Horizon.
app/Http/Controllers/Webhook/Bitbucket.php, app/Http/Controllers/Webhook/Gitea.php, app/Http/Controllers/Webhook/Github.php, app/Http/Controllers/Webhook/Gitlab.php, app/Jobs/ApplicationDeploymentJob.php Ensures preview FQDN is generated for PR deployments, both for dockercompose and other build packs, aligning logic across VCS providers.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant LivewirePreviews
    participant ApplicationPreview
    participant DeleteResourceJob
    participant DockerServer

    User->>LivewirePreviews: Requests preview deletion (PR ID)
    LivewirePreviews->>ApplicationPreview: Soft delete preview
    LivewirePreviews->>DeleteResourceJob: Dispatch async cleanup job
    DeleteResourceJob->>ApplicationPreview: Force delete (if not trashed)
    DeleteResourceJob->>DockerServer: Remove containers/stack/networks/volumes
    DeleteResourceJob->>ApplicationPreview: Final cleanup and force delete
Loading
sequenceDiagram
    participant Scheduler
    participant ServerResourceManager
    participant ScheduledJobManager
    participant Server
    participant DatabaseBackupJob
    participant ScheduledTaskJob

    Scheduler->>ServerResourceManager: Run every minute
    ServerResourceManager->>Server: Check resources, cleanup, patch, sentinel restart

    Scheduler->>ScheduledJobManager: Run every minute
    ScheduledJobManager->>DatabaseBackupJob: Dispatch if due (per schedule)
    ScheduledJobManager->>ScheduledTaskJob: Dispatch if due (per schedule)
Loading
sequenceDiagram
    participant User
    participant LivewireDeploymentIndex
    participant Application
    participant Deployment

    User->>LivewireDeploymentIndex: Filter by PR ID, paginate
    LivewireDeploymentIndex->>Application: deployments(skip, take, pullRequestId)
    Application->>Deployment: Query with optional PR ID filter, return paged results
    LivewireDeploymentIndex->>User: Show deployments, page controls, filter state
Loading

Assessment against linked issues

Objective Addressed Explanation
Fix preview deployments so that preview FQDNs/domains are correctly generated and displayed (#6186)
Restore and persist preview domain configuration for PR deployments (#6186)
Ensure preview deployments work for both dockercompose and other build packs (#6186)
Handle missing or empty main domains gracefully in preview domain generation (#6186)

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Addition of new job managers for server resources and scheduled jobs (app/Jobs/ServerResourceManager.php, app/Jobs/ScheduledJobManager.php, app/Console/Kernel.php) These changes are a refactor of the scheduler and not directly related to the preview deployment/domain bug in #6186.
Addition of new log channels and log viewing command (config/logging.php, app/Console/Commands/ViewScheduledLogs.php) These logging enhancements are unrelated to the preview deployment/domain issue in #6186.
Addition of CLAUDE.md documentation file Project documentation for Claude is not related to the preview deployment/domain bug in #6186.
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch next

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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

🔭 Outside diff range comments (1)
app/Models/ApplicationPreview.php (1)

17-47: Judgment Day cleanup logic needs a refactor

The cleanup logic is solid, but that else clause at line 35 is making my CPU hurt more than gluten makes my stomach hurt. Static analysis caught it too - we can simplify this.

Apply this diff to eliminate the else clause and make the code cleaner:

 static::forceDeleting(function ($preview) {
     $server = $preview->application->destination->server;
     $application = $preview->application;

-    if (data_get($preview, 'application.build_pack') === 'dockercompose') {
-        // Docker Compose volume and network cleanup
-        $composeFile = $application->parse(pull_request_id: $preview->pull_request_id);
-        $volumes = data_get($composeFile, 'volumes');
-        $networks = data_get($composeFile, 'networks');
-        $networkKeys = collect($networks)->keys();
-        $volumeKeys = collect($volumes)->keys();
-        $volumeKeys->each(function ($key) use ($server) {
-            instant_remote_process(["docker volume rm -f $key"], $server, false);
-        });
-        $networkKeys->each(function ($key) use ($server) {
-            instant_remote_process(["docker network disconnect $key coolify-proxy"], $server, false);
-            instant_remote_process(["docker network rm $key"], $server, false);
-        });
-    } else {
-        // Regular application volume cleanup
-        $persistentStorages = $preview->persistentStorages()->get() ?? collect();
-        if ($persistentStorages->count() > 0) {
-            foreach ($persistentStorages as $storage) {
-                instant_remote_process(["docker volume rm -f $storage->name"], $server, false);
-            }
-        }
-    }
+    if (data_get($preview, 'application.build_pack') === 'dockercompose') {
+        // Docker Compose volume and network cleanup
+        $composeFile = $application->parse(pull_request_id: $preview->pull_request_id);
+        $volumes = data_get($composeFile, 'volumes');
+        $networks = data_get($composeFile, 'networks');
+        $networkKeys = collect($networks)->keys();
+        $volumeKeys = collect($volumes)->keys();
+        $volumeKeys->each(function ($key) use ($server) {
+            instant_remote_process(["docker volume rm -f $key"], $server, false);
+        });
+        $networkKeys->each(function ($key) use ($server) {
+            instant_remote_process(["docker network disconnect $key coolify-proxy"], $server, false);
+            instant_remote_process(["docker network rm $key"], $server, false);
+        });
+    }
+    
+    if (data_get($preview, 'application.build_pack') !== 'dockercompose') {
+        // Regular application volume cleanup
+        $persistentStorages = $preview->persistentStorages()->get() ?? collect();
+        if ($persistentStorages->count() > 0) {
+            foreach ($persistentStorages as $storage) {
+                instant_remote_process(["docker volume rm -f $storage->name"], $server, false);
+            }
+        }
+    }

     // Clean up persistent storage records
     $preview->persistentStorages()->delete();
 });
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f59a689 and 13f1002.

📒 Files selected for processing (35)
  • CLAUDE.md (1 hunks)
  • app/Console/Commands/RunScheduledJobsManually.php (7 hunks)
  • app/Console/Commands/ViewScheduledLogs.php (1 hunks)
  • app/Console/Kernel.php (3 hunks)
  • app/Events/BackupCreated.php (1 hunks)
  • app/Events/ServiceChecked.php (1 hunks)
  • app/Http/Controllers/Webhook/Bitbucket.php (1 hunks)
  • app/Http/Controllers/Webhook/Gitea.php (1 hunks)
  • app/Http/Controllers/Webhook/Github.php (1 hunks)
  • app/Http/Controllers/Webhook/Gitlab.php (1 hunks)
  • app/Jobs/ApplicationDeploymentJob.php (1 hunks)
  • app/Jobs/DeleteResourceJob.php (4 hunks)
  • app/Jobs/PushServerUpdateJob.php (1 hunks)
  • app/Jobs/ScheduledJobManager.php (1 hunks)
  • app/Jobs/ServerResourceManager.php (1 hunks)
  • app/Jobs/ServerStorageCheckJob.php (1 hunks)
  • app/Livewire/Project/Application/Deployment/Index.php (2 hunks)
  • app/Livewire/Project/Application/General.php (3 hunks)
  • app/Livewire/Project/Application/Previews.php (4 hunks)
  • app/Livewire/Project/Application/PreviewsCompose.php (2 hunks)
  • app/Livewire/Project/Database/BackupExecutions.php (4 hunks)
  • app/Models/Application.php (2 hunks)
  • app/Models/ApplicationPreview.php (4 hunks)
  • app/Models/ScheduledDatabaseBackup.php (1 hunks)
  • config/constants.php (1 hunks)
  • config/horizon.php (1 hunks)
  • config/logging.php (1 hunks)
  • database/migrations/2025_07_14_191016_add_deleted_at_to_application_previews_table.php (1 hunks)
  • resources/views/livewire/project/application/deployment/index.blade.php (1 hunks)
  • resources/views/livewire/project/application/general.blade.php (1 hunks)
  • resources/views/livewire/project/application/previews.blade.php (3 hunks)
  • resources/views/livewire/project/database/backup-executions.blade.php (1 hunks)
  • resources/views/livewire/project/database/scheduled-backups.blade.php (1 hunks)
  • resources/views/livewire/project/shared/scheduled-task/show.blade.php (1 hunks)
  • versions.json (1 hunks)
🧰 Additional context used
📓 Path-based instructions (20)
**/*.php

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/README.mdc
resources/views/**/*.blade.php

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/README.mdc
app/Events/**/*.php

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/api-and-routing.mdc
  • .cursor/rules/application-architecture.mdc
app/**/*.php

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/README.mdc
config/**/*.php

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/application-architecture.mdc
  • .cursor/rules/README.mdc
app/Jobs/**/*.php

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/application-architecture.mdc
app/Jobs/**

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/deployment-architecture.mdc
database/migrations/*.php

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/database-patterns.mdc
database/migrations/**/*.php

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/README.mdc
app/Http/**/*.php

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/application-architecture.mdc
app/{Models,Http/Controllers}/**/*.php

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/README.mdc
app/Models/**/*.php

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/application-architecture.mdc
  • .cursor/rules/README.mdc
app/Models/*.php

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/database-patterns.mdc
app/Models/ScheduledDatabaseBackup*.php

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/database-patterns.mdc
app/Models/ScheduledDatabaseBackup.php

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/deployment-architecture.mdc
app/{Models,Services}/**/*.php

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/README.mdc
app/Livewire/**/*.php

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/application-architecture.mdc
app/Models/Application.php

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/deployment-architecture.mdc
app/Console/**/*.php

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/application-architecture.mdc
app/Models/ApplicationPreview.php

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/deployment-architecture.mdc
🧠 Learnings (31)
📓 Common learnings
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/deployment-architecture.mdc:0-0
Timestamp: 2025-06-23T15:00:18.159Z
Learning: Preview environments are automatically created for feature branches (PR/MR), providing isolated test deployments with automatic cleanup after merge or close.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/project-overview.mdc:0-0
Timestamp: 2025-06-23T15:36:45.844Z
Learning: Application deployment is Git-based (supporting GitHub, GitLab, Bitbucket, Gitea), with Docker and Docker Compose support, preview deployments, zero-downtime deployments, and build cache optimization.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/deployment-architecture.mdc:0-0
Timestamp: 2025-06-23T15:00:18.159Z
Learning: Performance optimizations include Docker layer caching, multi-stage builds, build artifact reuse, parallel build processing, container resource limits, auto-scaling, database connection pooling, and CDN integration for static assets.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/deployment-architecture.mdc:0-0
Timestamp: 2025-06-23T15:00:18.159Z
Learning: Deployment orchestration involves queueing jobs, generating configurations, deploying containers, and performing health checks to ensure reliability.
resources/views/livewire/project/shared/scheduled-task/show.blade.php (1)
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/ScheduledTask*.php : Task scheduling and execution should be managed in ScheduledTask.php and ScheduledTaskExecution.php models in app/Models/.
app/Events/BackupCreated.php (9)
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/ScheduledDatabaseBackup*.php : Scheduled database backups should be managed via ScheduledDatabaseBackup.php and ScheduledDatabaseBackupExecution.php models.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/api-and-routing.mdc:0-0
Timestamp: 2025-07-01T09:12:06.691Z
Learning: Applies to app/Events/**/*.php : Broadcast real-time events using ShouldBroadcast implementations for deployment and team/application updates
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/technology-stack.mdc:0-0
Timestamp: 2025-06-26T10:24:33.728Z
Learning: Background processing and queue management are implemented using Laravel Horizon for real-time queue metrics and failed job handling, with Redis as the queue backend.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/deployment-architecture.mdc:0-0
Timestamp: 2025-06-23T15:00:18.159Z
Learning: Background jobs are processed asynchronously using Redis-backed queues, monitored by Laravel Horizon, with support for failed job retries and auto-scaling of queue workers.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/*.php : Eloquent models should use common traits: SoftDeletes, LogsActivity, HasFactory, HasUuids.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/*.php : Eloquent models should use soft deletes for audit trails.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/development-workflow.mdc:0-0
Timestamp: 2025-06-23T15:26:07.302Z
Learning: Handle queue jobs by implementing ShouldQueue, using traits like Dispatchable and Queueable, and managing retries and failures robustly.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/application-architecture.mdc:0-0
Timestamp: 2025-07-01T09:12:35.467Z
Learning: Applies to config/**/*.php : Use Horizon to manage queue workers for background job processing.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/*NotificationSettings.php : Notification channel integrations should be implemented in their respective models (EmailNotificationSettings.php, DiscordNotificationSettings.php, etc.) in app/Models/.
app/Events/ServiceChecked.php (6)
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/api-and-routing.mdc:0-0
Timestamp: 2025-07-01T09:12:06.691Z
Learning: Applies to app/Events/**/*.php : Broadcast real-time events using ShouldBroadcast implementations for deployment and team/application updates
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/*NotificationSettings.php : Notification channel integrations should be implemented in their respective models (EmailNotificationSettings.php, DiscordNotificationSettings.php, etc.) in app/Models/.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/technology-stack.mdc:0-0
Timestamp: 2025-06-26T10:24:33.728Z
Learning: Background processing and queue management are implemented using Laravel Horizon for real-time queue metrics and failed job handling, with Redis as the queue backend.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/deployment-architecture.mdc:0-0
Timestamp: 2025-06-23T15:00:18.159Z
Learning: Background jobs are processed asynchronously using Redis-backed queues, monitored by Laravel Horizon, with support for failed job retries and auto-scaling of queue workers.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/frontend-patterns.mdc:0-0
Timestamp: 2025-06-23T15:36:30.268Z
Learning: Event broadcasting uses Laravel Echo and the Pusher protocol, with private and presence channels for secure and collaborative real-time features.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/development-workflow.mdc:0-0
Timestamp: 2025-06-23T15:26:07.302Z
Learning: Handle queue jobs by implementing ShouldQueue, using traits like Dispatchable and Queueable, and managing retries and failures robustly.
config/constants.php (1)
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/project-overview.mdc:0-0
Timestamp: 2025-06-23T15:36:45.844Z
Learning: Coolify is a Laravel backend project with a Livewire frontend, emphasizing a minimal JavaScript footprint and real-time updates via WebSockets.
app/Jobs/PushServerUpdateJob.php (6)
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/application-architecture.mdc:0-0
Timestamp: 2025-07-01T09:12:35.467Z
Learning: Applies to config/**/*.php : Use Horizon to manage queue workers for background job processing.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/technology-stack.mdc:0-0
Timestamp: 2025-06-26T10:24:33.728Z
Learning: Background processing and queue management are implemented using Laravel Horizon for real-time queue metrics and failed job handling, with Redis as the queue backend.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/application-architecture.mdc:0-0
Timestamp: 2025-07-01T09:12:35.467Z
Learning: Applies to app/Jobs/**/*.php : Place background job classes in the app/Jobs/ directory.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/deployment-architecture.mdc:0-0
Timestamp: 2025-06-23T15:00:18.159Z
Learning: Background jobs are processed asynchronously using Redis-backed queues, monitored by Laravel Horizon, with support for failed job retries and auto-scaling of queue workers.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/development-workflow.mdc:0-0
Timestamp: 2025-06-23T15:26:07.302Z
Learning: Handle queue jobs by implementing ShouldQueue, using traits like Dispatchable and Queueable, and managing retries and failures robustly.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/api-and-routing.mdc:0-0
Timestamp: 2025-07-01T09:12:06.691Z
Learning: Applies to app/Events/**/*.php : Broadcast real-time events using ShouldBroadcast implementations for deployment and team/application updates
database/migrations/2025_07_14_191016_add_deleted_at_to_application_previews_table.php (8)
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/*.php : Eloquent models should use soft deletes for audit trails.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/README.mdc:0-0
Timestamp: 2025-07-01T09:11:41.417Z
Learning: Applies to database/migrations/**/*.php : Define database schema changes in database/migrations/
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to database/migrations/*.php : Database migrations should define primary keys, foreign key indexes, composite indexes, and unique constraints as appropriate for business rules.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/*.php : Eloquent models should use common traits: SoftDeletes, LogsActivity, HasFactory, HasUuids.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/testing-patterns.mdc:0-0
Timestamp: 2025-06-23T15:42:55.934Z
Learning: Test database migrations for correct table structure and foreign key constraints, including cascade deletion behavior.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to database/migrations/*.php : Database migration files must be placed in database/migrations/ and follow the incremental, rollback-supporting migration pattern using Laravel's Schema builder.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/*.php : Eloquent models should use UUID primary keys for distributed systems.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/*.php : Use model events (e.g., booted, deleting) to handle automatic cleanup and related data management in Eloquent models.
app/Jobs/ServerStorageCheckJob.php (9)
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/technology-stack.mdc:0-0
Timestamp: 2025-06-26T10:24:33.728Z
Learning: Background processing and queue management are implemented using Laravel Horizon for real-time queue metrics and failed job handling, with Redis as the queue backend.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/deployment-architecture.mdc:0-0
Timestamp: 2025-06-23T15:00:18.159Z
Learning: Background jobs are processed asynchronously using Redis-backed queues, monitored by Laravel Horizon, with support for failed job retries and auto-scaling of queue workers.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/{S3Storage,LocalFileVolume,LocalPersistentVolume}.php : Storage management should be implemented in S3Storage.php, LocalFileVolume.php, and LocalPersistentVolume.php models in app/Models/.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/application-architecture.mdc:0-0
Timestamp: 2025-07-01T09:12:35.467Z
Learning: Applies to config/**/*.php : Use Horizon to manage queue workers for background job processing.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/application-architecture.mdc:0-0
Timestamp: 2025-07-01T09:12:35.467Z
Learning: Applies to app/Jobs/**/*.php : Place background job classes in the app/Jobs/ directory.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/development-workflow.mdc:0-0
Timestamp: 2025-06-23T15:26:07.302Z
Learning: Handle queue jobs by implementing ShouldQueue, using traits like Dispatchable and Queueable, and managing retries and failures robustly.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/README.mdc:0-0
Timestamp: 2025-07-01T09:11:41.417Z
Learning: Applies to app/Models/Server.php : Store SSH keys securely and manage access in server management logic
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/*.php : Eloquent models should use soft deletes for audit trails.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/*.php : Eloquent models should use common traits: SoftDeletes, LogsActivity, HasFactory, HasUuids.
resources/views/livewire/project/application/general.blade.php (2)
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/README.mdc:0-0
Timestamp: 2025-07-01T09:11:41.417Z
Learning: Applies to app/Http/Livewire/**/*.php : Use Livewire components for interactive frontend features
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/application-architecture.mdc:0-0
Timestamp: 2025-07-01T09:12:35.467Z
Learning: Applies to app/Livewire/**/*.php : Place Livewire components in the app/Livewire/ directory.
app/Http/Controllers/Webhook/Gitlab.php (4)
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/api-and-routing.mdc:0-0
Timestamp: 2025-07-01T09:12:06.691Z
Learning: Applies to routes/webhooks.php : Define webhook endpoints for Git integrations, deployments, monitoring, backup, and SSL in routes/webhooks.php
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/{GithubApp,GitlabApp}.php : Source control integrations should be implemented in GithubApp.php and GitlabApp.php models in app/Models/.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/deployment-architecture.mdc:0-0
Timestamp: 2025-06-23T15:00:18.159Z
Learning: Preview environments are automatically created for feature branches (PR/MR), providing isolated test deployments with automatic cleanup after merge or close.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/project-overview.mdc:0-0
Timestamp: 2025-06-23T15:36:45.844Z
Learning: Application deployment is Git-based (supporting GitHub, GitLab, Bitbucket, Gitea), with Docker and Docker Compose support, preview deployments, zero-downtime deployments, and build cache optimization.
config/horizon.php (4)
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/application-architecture.mdc:0-0
Timestamp: 2025-07-01T09:12:35.467Z
Learning: Applies to config/**/*.php : Use Horizon to manage queue workers for background job processing.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/technology-stack.mdc:0-0
Timestamp: 2025-06-26T10:24:33.728Z
Learning: Background processing and queue management are implemented using Laravel Horizon for real-time queue metrics and failed job handling, with Redis as the queue backend.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/deployment-architecture.mdc:0-0
Timestamp: 2025-06-23T15:00:18.159Z
Learning: Background jobs are processed asynchronously using Redis-backed queues, monitored by Laravel Horizon, with support for failed job retries and auto-scaling of queue workers.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/application-architecture.mdc:0-0
Timestamp: 2025-07-01T09:12:35.467Z
Learning: Applies to config/**/*.php : Use Redis for session and cache storage.
resources/views/livewire/project/database/backup-executions.blade.php (1)
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/ScheduledDatabaseBackup*.php : Scheduled database backups should be managed via ScheduledDatabaseBackup.php and ScheduledDatabaseBackupExecution.php models.
app/Http/Controllers/Webhook/Gitea.php (3)
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/api-and-routing.mdc:0-0
Timestamp: 2025-07-01T09:12:06.691Z
Learning: Applies to routes/webhooks.php : Define webhook endpoints for Git integrations, deployments, monitoring, backup, and SSL in routes/webhooks.php
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/deployment-architecture.mdc:0-0
Timestamp: 2025-06-23T15:00:18.159Z
Learning: Preview environments are automatically created for feature branches (PR/MR), providing isolated test deployments with automatic cleanup after merge or close.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/project-overview.mdc:0-0
Timestamp: 2025-06-23T15:36:45.844Z
Learning: Application deployment is Git-based (supporting GitHub, GitLab, Bitbucket, Gitea), with Docker and Docker Compose support, preview deployments, zero-downtime deployments, and build cache optimization.
app/Http/Controllers/Webhook/Github.php (3)
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/{GithubApp,GitlabApp}.php : Source control integrations should be implemented in GithubApp.php and GitlabApp.php models in app/Models/.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/api-and-routing.mdc:0-0
Timestamp: 2025-07-01T09:12:06.691Z
Learning: Applies to routes/webhooks.php : Define webhook endpoints for Git integrations, deployments, monitoring, backup, and SSL in routes/webhooks.php
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/deployment-architecture.mdc:0-0
Timestamp: 2025-06-23T15:00:18.159Z
Learning: Preview environments are automatically created for feature branches (PR/MR), providing isolated test deployments with automatic cleanup after merge or close.
resources/views/livewire/project/application/previews.blade.php (8)
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/README.mdc:0-0
Timestamp: 2025-07-01T09:11:41.417Z
Learning: Applies to app/Http/Livewire/**/*.php : Use Livewire components for interactive frontend features
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/application-architecture.mdc:0-0
Timestamp: 2025-07-01T09:12:35.467Z
Learning: Applies to app/Livewire/**/*.php : Place Livewire components in the app/Livewire/ directory.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/testing-patterns.mdc:0-0
Timestamp: 2025-06-23T15:42:55.934Z
Learning: Test Livewire or UI components for real-time updates and correct display of dynamic data.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/technology-stack.mdc:0-0
Timestamp: 2025-06-26T10:24:33.728Z
Learning: Livewire 3.5.20 is the primary frontend framework for server-side rendering and reactive components, with Alpine.js used for lightweight client-side interactivity via declarative directives in Blade templates.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/README.mdc:0-0
Timestamp: 2025-07-01T09:11:41.417Z
Learning: Applies to resources/views/**/*.blade.php : Use Alpine.js and Tailwind CSS for frontend interactivity and styling
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/technology-stack.mdc:0-0
Timestamp: 2025-06-26T10:24:33.728Z
Learning: Vue.js 3.5.13 is integrated alongside Livewire for complex interactive components, built using Vite with the Vue plugin.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/deployment-architecture.mdc:0-0
Timestamp: 2025-06-23T15:00:18.159Z
Learning: Preview environments are automatically created for feature branches (PR/MR), providing isolated test deployments with automatic cleanup after merge or close.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/project-overview.mdc:0-0
Timestamp: 2025-06-23T15:36:45.844Z
Learning: Application deployment is Git-based (supporting GitHub, GitLab, Bitbucket, Gitea), with Docker and Docker Compose support, preview deployments, zero-downtime deployments, and build cache optimization.
app/Http/Controllers/Webhook/Bitbucket.php (3)
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/api-and-routing.mdc:0-0
Timestamp: 2025-07-01T09:12:06.691Z
Learning: Applies to routes/webhooks.php : Define webhook endpoints for Git integrations, deployments, monitoring, backup, and SSL in routes/webhooks.php
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/deployment-architecture.mdc:0-0
Timestamp: 2025-06-23T15:00:18.159Z
Learning: Preview environments are automatically created for feature branches (PR/MR), providing isolated test deployments with automatic cleanup after merge or close.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/project-overview.mdc:0-0
Timestamp: 2025-06-23T15:36:45.844Z
Learning: Application deployment is Git-based (supporting GitHub, GitLab, Bitbucket, Gitea), with Docker and Docker Compose support, preview deployments, zero-downtime deployments, and build cache optimization.
app/Models/ScheduledDatabaseBackup.php (2)
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/ScheduledDatabaseBackup*.php : Scheduled database backups should be managed via ScheduledDatabaseBackup.php and ScheduledDatabaseBackupExecution.php models.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/ScheduledTask*.php : Task scheduling and execution should be managed in ScheduledTask.php and ScheduledTaskExecution.php models in app/Models/.
resources/views/livewire/project/application/deployment/index.blade.php (5)
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/README.mdc:0-0
Timestamp: 2025-07-01T09:11:41.417Z
Learning: Applies to app/Http/Livewire/**/*.php : Use Livewire components for interactive frontend features
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/README.mdc:0-0
Timestamp: 2025-07-01T09:11:41.417Z
Learning: Applies to resources/views/**/*.blade.php : Use Alpine.js and Tailwind CSS for frontend interactivity and styling
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/application-architecture.mdc:0-0
Timestamp: 2025-07-01T09:12:35.467Z
Learning: Applies to app/Livewire/**/*.php : Place Livewire components in the app/Livewire/ directory.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/technology-stack.mdc:0-0
Timestamp: 2025-06-26T10:24:33.728Z
Learning: Livewire 3.5.20 is the primary frontend framework for server-side rendering and reactive components, with Alpine.js used for lightweight client-side interactivity via declarative directives in Blade templates.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/README.mdc:0-0
Timestamp: 2025-07-01T09:11:41.417Z
Learning: Applies to resources/views/**/*.blade.php : Optimize frontend performance with lazy loading, asset optimization, and CDN integration
config/logging.php (1)
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/ScheduledDatabaseBackup*.php : Scheduled database backups should be managed via ScheduledDatabaseBackup.php and ScheduledDatabaseBackupExecution.php models.
resources/views/livewire/project/database/scheduled-backups.blade.php (4)
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/ScheduledDatabaseBackup*.php : Scheduled database backups should be managed via ScheduledDatabaseBackup.php and ScheduledDatabaseBackupExecution.php models.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/README.mdc:0-0
Timestamp: 2025-07-01T09:11:41.417Z
Learning: Applies to resources/views/**/*.blade.php : Use Alpine.js and Tailwind CSS for frontend interactivity and styling
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/README.mdc:0-0
Timestamp: 2025-07-01T09:11:41.417Z
Learning: Applies to resources/views/**/*.blade.php : Optimize frontend performance with lazy loading, asset optimization, and CDN integration
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/ScheduledTask*.php : Task scheduling and execution should be managed in ScheduledTask.php and ScheduledTaskExecution.php models in app/Models/.
CLAUDE.md (6)
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/project-overview.mdc:0-0
Timestamp: 2025-06-23T15:36:45.844Z
Learning: The project structure follows Laravel conventions, with core logic in 'app/', frontend assets in 'resources/', database migrations in 'database/', Docker configurations in 'docker/', scripts in 'scripts/', and tests in 'tests/'.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/project-overview.mdc:0-0
Timestamp: 2025-06-23T15:36:45.844Z
Learning: Coolify is a Laravel backend project with a Livewire frontend, emphasizing a minimal JavaScript footprint and real-time updates via WebSockets.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/technology-stack.mdc:0-0
Timestamp: 2025-06-26T10:24:33.728Z
Learning: Code quality is maintained using Laravel Pint for code style, Rector for automated refactoring, and PHPStan for static analysis, ensuring maintainable and robust PHP code.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/project-overview.mdc:0-0
Timestamp: 2025-06-23T15:36:45.844Z
Learning: Coolify's deployment architecture is Docker-first, using Docker Compose for orchestration, image building, registry integration, and volume/network management.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/frontend-patterns.mdc:0-0
Timestamp: 2025-06-23T15:36:30.268Z
Learning: Coolify's frontend uses a server-side first approach with minimal JavaScript, leveraging Livewire for reactivity and Alpine.js for lightweight client-side interactions.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/deployment-architecture.mdc:0-0
Timestamp: 2025-06-23T15:00:18.159Z
Learning: Coolify uses Docker-based deployments orchestrated across multiple servers, with automated configuration generation, zero-downtime deployments, and comprehensive monitoring.
app/Console/Kernel.php (10)
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/ScheduledDatabaseBackup*.php : Scheduled database backups should be managed via ScheduledDatabaseBackup.php and ScheduledDatabaseBackupExecution.php models.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/ScheduledTask*.php : Task scheduling and execution should be managed in ScheduledTask.php and ScheduledTaskExecution.php models in app/Models/.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/application-architecture.mdc:0-0
Timestamp: 2025-07-01T09:12:35.467Z
Learning: Applies to app/Jobs/**/*.php : Place background job classes in the app/Jobs/ directory.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/application-architecture.mdc:0-0
Timestamp: 2025-07-01T09:12:35.467Z
Learning: Applies to config/**/*.php : Use Horizon to manage queue workers for background job processing.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/{StandaloneDocker,SwarmDocker}.php : Docker and container management should be implemented in StandaloneDocker.php and SwarmDocker.php models in app/Models/.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/api-and-routing.mdc:0-0
Timestamp: 2025-07-01T09:12:06.691Z
Learning: Applies to app/Events/**/*.php : Broadcast real-time events using ShouldBroadcast implementations for deployment and team/application updates
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/deployment-architecture.mdc:0-0
Timestamp: 2025-06-23T15:00:18.159Z
Learning: Background jobs are processed asynchronously using Redis-backed queues, monitored by Laravel Horizon, with support for failed job retries and auto-scaling of queue workers.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/technology-stack.mdc:0-0
Timestamp: 2025-06-26T10:24:33.728Z
Learning: Background processing and queue management are implemented using Laravel Horizon for real-time queue metrics and failed job handling, with Redis as the queue backend.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/development-workflow.mdc:0-0
Timestamp: 2025-06-23T15:26:07.302Z
Learning: Handle queue jobs by implementing ShouldQueue, using traits like Dispatchable and Queueable, and managing retries and failures robustly.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/README.mdc:0-0
Timestamp: 2025-07-01T09:11:41.417Z
Learning: Applies to app/Models/Server.php : Store SSH keys securely and manage access in server management logic
app/Models/ApplicationPreview.php (13)
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/*.php : Eloquent models should use soft deletes for audit trails.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/*.php : Eloquent models should use common traits: SoftDeletes, LogsActivity, HasFactory, HasUuids.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/*.php : Use model events (e.g., booted, deleting) to handle automatic cleanup and related data management in Eloquent models.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/application-architecture.mdc:0-0
Timestamp: 2025-07-01T09:12:35.467Z
Learning: Applies to app/Models/**/*.php : Use team-based soft scoping for all major resources to ensure that queries are automatically filtered by team.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/*.php : Eloquent models should use UUID primary keys for distributed systems.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/application-architecture.mdc:0-0
Timestamp: 2025-07-01T09:12:35.467Z
Learning: Applies to app/Models/**/*.php : Use team-based query scoping for all major resources to ensure multi-tenant isolation.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/{S3Storage,LocalFileVolume,LocalPersistentVolume}.php : Storage management should be implemented in S3Storage.php, LocalFileVolume.php, and LocalPersistentVolume.php models in app/Models/.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/*.php : Eloquent models should use activity logging with the Spatie package.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/README.mdc:0-0
Timestamp: 2025-07-01T09:11:41.417Z
Learning: Applies to app/Models/**/*.php : Optimize database queries using eager loading and query optimization techniques
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/ScheduledDatabaseBackup*.php : Scheduled database backups should be managed via ScheduledDatabaseBackup.php and ScheduledDatabaseBackupExecution.php models.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/{GithubApp,GitlabApp}.php : Source control integrations should be implemented in GithubApp.php and GitlabApp.php models in app/Models/.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/README.mdc:0-0
Timestamp: 2025-07-01T09:11:41.417Z
Learning: Applies to app/{Models,Http/Controllers}/**/*.php : Enforce team-based multi-tenancy and access control in application logic
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/application-architecture.mdc:0-0
Timestamp: 2025-07-01T09:12:35.467Z
Learning: Applies to app/Models/**/*.php : Use eager loading to prevent N+1 query problems in Eloquent models.
app/Jobs/ServerResourceManager.php (6)
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/technology-stack.mdc:0-0
Timestamp: 2025-06-26T10:24:33.728Z
Learning: Background processing and queue management are implemented using Laravel Horizon for real-time queue metrics and failed job handling, with Redis as the queue backend.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/development-workflow.mdc:0-0
Timestamp: 2025-06-23T15:26:07.302Z
Learning: Handle queue jobs by implementing ShouldQueue, using traits like Dispatchable and Queueable, and managing retries and failures robustly.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/deployment-architecture.mdc:0-0
Timestamp: 2025-06-23T15:00:18.159Z
Learning: Background jobs are processed asynchronously using Redis-backed queues, monitored by Laravel Horizon, with support for failed job retries and auto-scaling of queue workers.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/ScheduledDatabaseBackup*.php : Scheduled database backups should be managed via ScheduledDatabaseBackup.php and ScheduledDatabaseBackupExecution.php models.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/application-architecture.mdc:0-0
Timestamp: 2025-07-01T09:12:35.467Z
Learning: Applies to config/**/*.php : Use Horizon to manage queue workers for background job processing.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/ScheduledTask*.php : Task scheduling and execution should be managed in ScheduledTask.php and ScheduledTaskExecution.php models in app/Models/.
app/Livewire/Project/Database/BackupExecutions.php (5)
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/ScheduledDatabaseBackup*.php : Scheduled database backups should be managed via ScheduledDatabaseBackup.php and ScheduledDatabaseBackupExecution.php models.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/*Setting.php : Settings should be managed using InstanceSettings.php, ServerSetting.php, ProjectSetting.php, and ApplicationSetting.php models.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/frontend-patterns.mdc:0-0
Timestamp: 2025-06-23T15:36:30.268Z
Learning: State management is primarily server-side via Livewire component properties, session storage, database models, and caching, with Alpine.js handling local UI state.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/README.mdc:0-0
Timestamp: 2025-07-01T09:11:41.417Z
Learning: Applies to app/Http/Livewire/**/*.php : Use Livewire components for interactive frontend features
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/security-patterns.mdc:0-0
Timestamp: 2025-06-26T10:23:53.857Z
Learning: Database backups must be encrypted before storage and uploaded to secure storage, with local files cleaned up after upload.
app/Livewire/Project/Application/Previews.php (11)
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/deployment-architecture.mdc:0-0
Timestamp: 2025-06-23T15:00:18.159Z
Learning: Preview environments are automatically created for feature branches (PR/MR), providing isolated test deployments with automatic cleanup after merge or close.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/{StandaloneDocker,SwarmDocker}.php : Docker and container management should be implemented in StandaloneDocker.php and SwarmDocker.php models in app/Models/.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/README.mdc:0-0
Timestamp: 2025-07-01T09:11:41.417Z
Learning: Applies to app/Http/Livewire/**/*.php : Use Livewire components for interactive frontend features
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/project-overview.mdc:0-0
Timestamp: 2025-06-23T15:36:45.844Z
Learning: The project structure follows Laravel conventions, with core logic in 'app/', frontend assets in 'resources/', database migrations in 'database/', Docker configurations in 'docker/', scripts in 'scripts/', and tests in 'tests/'.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/application-architecture.mdc:0-0
Timestamp: 2025-07-01T09:12:35.467Z
Learning: Applies to app/Actions/**/*.php : Place business logic actions following the Action pattern in the app/Actions/ directory, using lorisleiva/laravel-actions.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/README.mdc:0-0
Timestamp: 2025-07-01T09:11:41.417Z
Learning: Applies to app/**/*.php : Adhere to Laravel best practices
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/{GithubApp,GitlabApp}.php : Source control integrations should be implemented in GithubApp.php and GitlabApp.php models in app/Models/.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/api-and-routing.mdc:0-0
Timestamp: 2025-07-01T09:12:06.691Z
Learning: Applies to app/Http/Resources/**/*.php : Use Laravel API Resource classes for consistent API responses
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/api-and-routing.mdc:0-0
Timestamp: 2025-07-01T09:12:06.691Z
Learning: Applies to app/Events/**/*.php : Broadcast real-time events using ShouldBroadcast implementations for deployment and team/application updates
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/api-and-routing.mdc:0-0
Timestamp: 2025-07-01T09:12:06.691Z
Learning: Applies to routes/web.php : Organize server and application management routes using route prefixes and groupings
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/technology-stack.mdc:0-0
Timestamp: 2025-06-26T10:24:33.728Z
Learning: Background processing and queue management are implemented using Laravel Horizon for real-time queue metrics and failed job handling, with Redis as the queue backend.
app/Console/Commands/RunScheduledJobsManually.php (4)
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/ScheduledDatabaseBackup*.php : Scheduled database backups should be managed via ScheduledDatabaseBackup.php and ScheduledDatabaseBackupExecution.php models.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/ScheduledTask*.php : Task scheduling and execution should be managed in ScheduledTask.php and ScheduledTaskExecution.php models in app/Models/.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/application-architecture.mdc:0-0
Timestamp: 2025-07-01T09:12:35.467Z
Learning: Applies to config/**/*.php : Use Horizon to manage queue workers for background job processing.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/testing-patterns.mdc:0-0
Timestamp: 2025-06-23T15:42:55.934Z
Learning: Test background jobs for correct processing, retry logic, and exponential backoff on failure.
app/Jobs/DeleteResourceJob.php (5)
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/{StandaloneDocker,SwarmDocker}.php : Docker and container management should be implemented in StandaloneDocker.php and SwarmDocker.php models in app/Models/.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/ScheduledDatabaseBackup*.php : Scheduled database backups should be managed via ScheduledDatabaseBackup.php and ScheduledDatabaseBackupExecution.php models.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/api-and-routing.mdc:0-0
Timestamp: 2025-07-01T09:12:06.691Z
Learning: Applies to routes/api.php : Implement CRUD and action endpoints for applications, servers, and databases using appropriate route prefixes and controller methods
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/application-architecture.mdc:0-0
Timestamp: 2025-07-01T09:12:35.467Z
Learning: Applies to app/Actions/**/*.php : Place business logic actions following the Action pattern in the app/Actions/ directory, using lorisleiva/laravel-actions.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/technology-stack.mdc:0-0
Timestamp: 2025-06-26T10:24:33.728Z
Learning: Background processing and queue management are implemented using Laravel Horizon for real-time queue metrics and failed job handling, with Redis as the queue backend.
app/Console/Commands/ViewScheduledLogs.php (4)
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/ScheduledDatabaseBackup*.php : Scheduled database backups should be managed via ScheduledDatabaseBackup.php and ScheduledDatabaseBackupExecution.php models.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/ScheduledTask*.php : Task scheduling and execution should be managed in ScheduledTask.php and ScheduledTaskExecution.php models in app/Models/.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/application-architecture.mdc:0-0
Timestamp: 2025-07-01T09:12:35.467Z
Learning: Applies to app/Console/**/*.php : Place custom Artisan command classes in the app/Console/ directory.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/api-and-routing.mdc:0-0
Timestamp: 2025-07-01T09:12:06.691Z
Learning: Applies to routes/console.php : Define Artisan command routes in routes/console.php
app/Jobs/ScheduledJobManager.php (8)
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/ScheduledDatabaseBackup*.php : Scheduled database backups should be managed via ScheduledDatabaseBackup.php and ScheduledDatabaseBackupExecution.php models.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/database-patterns.mdc:0-0
Timestamp: 2025-07-01T09:13:09.036Z
Learning: Applies to app/Models/ScheduledTask*.php : Task scheduling and execution should be managed in ScheduledTask.php and ScheduledTaskExecution.php models in app/Models/.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/development-workflow.mdc:0-0
Timestamp: 2025-06-23T15:26:07.302Z
Learning: Handle queue jobs by implementing ShouldQueue, using traits like Dispatchable and Queueable, and managing retries and failures robustly.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/application-architecture.mdc:0-0
Timestamp: 2025-07-01T09:12:35.467Z
Learning: Applies to app/Jobs/**/*.php : Place background job classes in the app/Jobs/ directory.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/technology-stack.mdc:0-0
Timestamp: 2025-06-26T10:24:33.728Z
Learning: Background processing and queue management are implemented using Laravel Horizon for real-time queue metrics and failed job handling, with Redis as the queue backend.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/application-architecture.mdc:0-0
Timestamp: 2025-07-01T09:12:35.467Z
Learning: Applies to config/**/*.php : Use Horizon to manage queue workers for background job processing.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/deployment-architecture.mdc:0-0
Timestamp: 2025-06-23T15:00:18.159Z
Learning: Background jobs are processed asynchronously using Redis-backed queues, monitored by Laravel Horizon, with support for failed job retries and auto-scaling of queue workers.
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/testing-patterns.mdc:0-0
Timestamp: 2025-06-23T15:42:55.934Z
Learning: Test background jobs for correct processing, retry logic, and exponential backoff on failure.
app/Jobs/ApplicationDeploymentJob.php (2)

undefined

<retrieved_learning>
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/project-overview.mdc:0-0
Timestamp: 2025-06-23T15:36:45.844Z
Learning: Application deployment is Git-based (supporting GitHub, GitLab, Bitbucket, Gitea), with Docker and Docker Compose support, preview deployments, zero-downtime deployments, and build cache optimization.
</retrieved_learning>

<retrieved_learning>
Learnt from: CR
PR: coollabsio/coolify#0
File: .cursor/rules/deployment-architecture.mdc:0-0
Timestamp: 2025-06-23T15:00:18.159Z
Learning: Preview environments are automatically created for feature branches (PR/MR), providing isolated test deployments with automatic cleanup after merge or close.
</retrieved_learning>

🧬 Code Graph Analysis (5)
app/Http/Controllers/Webhook/Gitlab.php (1)
app/Models/ApplicationPreview.php (3)
  • ApplicationPreview (9-167)
  • application (65-68)
  • generate_preview_fqdn (75-100)
app/Http/Controllers/Webhook/Bitbucket.php (1)
app/Models/ApplicationPreview.php (3)
  • ApplicationPreview (9-167)
  • application (65-68)
  • generate_preview_fqdn (75-100)
app/Livewire/Project/Application/PreviewsCompose.php (2)
app/Models/ApplicationPreview.php (1)
  • application (65-68)
bootstrap/helpers/shared.php (1)
  • generateFqdn (405-420)
app/Models/Application.php (1)
app/Models/ApplicationPreview.php (1)
  • ApplicationPreview (9-167)
app/Livewire/Project/Application/Deployment/Index.php (2)
app/Models/Application.php (1)
  • deployments (839-854)
app/Livewire/Project/Database/BackupExecutions.php (4)
  • updateCurrentPage (172-175)
  • showMore (160-170)
  • previousPage (123-135)
  • nextPage (137-145)
🪛 PHPMD (2.15.0)
app/Http/Controllers/Webhook/Gitlab.php

205-210: Avoid using static access to class '\App\Models\ApplicationPreview' in method 'manual'. (Clean Code Rules)

(StaticAccess)

app/Http/Controllers/Webhook/Gitea.php

178-183: Avoid using static access to class '\App\Models\ApplicationPreview' in method 'manual'. (Clean Code Rules)

(StaticAccess)

app/Http/Controllers/Webhook/Github.php

186-191: Avoid using static access to class '\App\Models\ApplicationPreview' in method 'manual'. (Clean Code Rules)

(StaticAccess)

app/Http/Controllers/Webhook/Bitbucket.php

146-151: Avoid using static access to class '\App\Models\ApplicationPreview' in method 'manual'. (Clean Code Rules)

(StaticAccess)

app/Livewire/Project/Application/PreviewsCompose.php

42-42: The variable $domain_string is not named in camelCase. (Controversial Rules)

(CamelCaseVariableName)


51-51: The variable $generated_fqdn is not named in camelCase. (Controversial Rules)

(CamelCaseVariableName)


53-53: The variable $preview_fqdn is not named in camelCase. (Controversial Rules)

(CamelCaseVariableName)


59-59: Avoid using static access to class '\Spatie\Url\Url' in method 'generate'. (Clean Code Rules)

(StaticAccess)


71-71: The variable $docker_compose_domains is not named in camelCase. (Controversial Rules)

(CamelCaseVariableName)


71-71: Avoid excessively long variable names like $docker_compose_domains. Keep variable name length under 20. (Naming Rules)

(LongVariable)

app/Livewire/Project/Application/General.php

262-262: Avoid unused local variables such as '$service'. (Unused Code Rules)

(UnusedLocalVariable)


476-476: Avoid unused local variables such as '$serviceName'. (Unused Code Rules)

(UnusedLocalVariable)

app/Livewire/Project/Application/Deployment/Index.php

61-64: The method mount uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. (Clean Code Rules)

(ElseExpression)


138-140: The method updatedPullRequestId uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. (Clean Code Rules)

(ElseExpression)

app/Models/ApplicationPreview.php

35-43: The method booted uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. (Clean Code Rules)

(ElseExpression)


75-100: The method generate_preview_fqdn is not named in camelCase. (Controversial Rules)

(CamelCaseMethodName)


79-79: Avoid using static access to class '\Spatie\Url\Url' in method 'generate_preview_fqdn'. (Clean Code Rules)

(StaticAccess)


80-80: The variable $preview_fqdn is not named in camelCase. (Controversial Rules)

(CamelCaseVariableName)


81-86: The method generate_preview_fqdn uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. (Clean Code Rules)

(ElseExpression)


82-82: Avoid using static access to class '\Spatie\Url\Url' in method 'generate_preview_fqdn'. (Clean Code Rules)

(StaticAccess)


105-105: The variable $docker_compose_domains is not named in camelCase. (Controversial Rules)

(CamelCaseVariableName)


105-105: Avoid excessively long variable names like $docker_compose_domains. Keep variable name length under 20. (Naming Rules)

(LongVariable)


124-124: The variable $service_name is not named in camelCase. (Controversial Rules)

(CamelCaseVariableName)


124-124: The variable $service_config is not named in camelCase. (Controversial Rules)

(CamelCaseVariableName)


125-125: The variable $domain_string is not named in camelCase. (Controversial Rules)

(CamelCaseVariableName)


158-161: The method generate_preview_fqdn_compose uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. (Clean Code Rules)

(ElseExpression)

app/Livewire/Project/Database/BackupExecutions.php

64-66: The method cleanupDeleted uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. (Clean Code Rules)

(ElseExpression)


153-156: The method loadExecutions uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. (Clean Code Rules)

(ElseExpression)

app/Livewire/Project/Application/Previews.php

210-210: The variable $pull_request_id is not named in camelCase. (Controversial Rules)

(CamelCaseVariableName)


223-223: Avoid using static access to class '\App\Jobs\DeleteResourceJob' in method 'delete'. (Clean Code Rules)

(StaticAccess)

app/Console/Commands/RunScheduledJobsManually.php

51-51: The method runScheduledBackups has a boolean flag argument $dryRun, which is a certain sign of a Single Responsibility Principle violation. (Clean Code Rules)

(BooleanArgumentFlag)


55-55: Avoid using static access to class '\App\Models\ScheduledDatabaseBackup' in method 'runScheduledBackups'. (Clean Code Rules)

(StaticAccess)


62-65: The method runScheduledBackups uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. (Clean Code Rules)

(ElseExpression)


69-69: The variable $scheduled_backups is not named in camelCase. (Controversial Rules)

(CamelCaseVariableName)


126-126: Avoid using static access to class '\App\Jobs\DatabaseBackupJob' in method 'runScheduledBackups'. (Clean Code Rules)

(StaticAccess)


142-142: The method runScheduledTasks has a boolean flag argument $dryRun, which is a certain sign of a Single Responsibility Principle violation. (Clean Code Rules)

(BooleanArgumentFlag)


142-246: The method runScheduledTasks() has a Cyclomatic Complexity of 26. The configured cyclomatic complexity threshold is 10. (Code Size Rules)

(CyclomaticComplexity)


142-246: The method runScheduledTasks() has an NPath complexity of 303966. The configured NPath complexity threshold is 200. (Code Size Rules)

(NPathComplexity)


142-246: The method runScheduledTasks() has 105 lines of code. Current threshold is set to 100. Avoid really long methods. (Code Size Rules)

(ExcessiveMethodLength)


146-146: Avoid using static access to class '\App\Models\ScheduledTask' in method 'runScheduledTasks'. (Clean Code Rules)

(StaticAccess)


153-156: The method runScheduledTasks uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. (Clean Code Rules)

(ElseExpression)


160-160: The variable $scheduled_tasks is not named in camelCase. (Controversial Rules)

(CamelCaseVariableName)


232-232: Avoid using static access to class '\App\Jobs\ScheduledTaskJob' in method 'runScheduledTasks'. (Clean Code Rules)

(StaticAccess)

app/Jobs/DeleteResourceJob.php

120-120: The variable $pull_request_id is not named in camelCase. (Controversial Rules)

(CamelCaseVariableName)


130-133: The method deleteApplicationPreview uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. (Clean Code Rules)

(ElseExpression)

app/Console/Commands/ViewScheduledLogs.php

8-278: The class ViewScheduledLogs has an overall complexity of 50 which is very high. The configured complexity threshold is 50. (Code Size Rules)

(ExcessiveClassComplexity)


28-88: The method handle() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10. (Code Size Rules)

(CyclomaticComplexity)


55-57: The method handle uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. (Clean Code Rules)

(ElseExpression)


58-66: The method handle uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. (Clean Code Rules)

(ElseExpression)


63-65: The method handle uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. (Clean Code Rules)

(ElseExpression)


67-87: The method handle uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. (Clean Code Rules)

(ElseExpression)


75-77: The method handle uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. (Clean Code Rules)

(ElseExpression)


78-86: The method handle uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. (Clean Code Rules)

(ElseExpression)


83-85: The method handle uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. (Clean Code Rules)

(ElseExpression)


97-97: Avoid using static access to class '\Illuminate\Support\Facades\File' in method 'getLogPaths'. (Clean Code Rules)

(StaticAccess)


105-105: Avoid using static access to class '\Illuminate\Support\Facades\File' in method 'getLogPaths'. (Clean Code Rules)

(StaticAccess)


108-108: Avoid using static access to class '\Illuminate\Support\Facades\File' in method 'getLogPaths'. (Clean Code Rules)

(StaticAccess)


111-117: The method getLogPaths uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. (Clean Code Rules)

(ElseExpression)


114-114: Avoid using static access to class '\Illuminate\Support\Facades\File' in method 'getLogPaths'. (Clean Code Rules)

(StaticAccess)


128-128: Avoid using static access to class '\Illuminate\Support\Facades\File' in method 'showAvailableLogFiles'. (Clean Code Rules)

(StaticAccess)


129-129: Avoid using static access to class '\Illuminate\Support\Facades\File' in method 'showAvailableLogFiles'. (Clean Code Rules)

(StaticAccess)


158-160: The method getLogTypeDescription uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. (Clean Code Rules)

(ElseExpression)


163-205: Avoid assigning values to variables in if clauses and the like (line '167', column '13'). (Clean Code Rules)

(IfStatementAssignment)


163-205: Avoid assigning values to variables in if clauses and the like (line '171', column '13'). (Clean Code Rules)

(IfStatementAssignment)


163-205: Avoid assigning values to variables in if clauses and the like (line '175', column '13'). (Clean Code Rules)

(IfStatementAssignment)


163-205: Avoid assigning values to variables in if clauses and the like (line '179', column '13'). (Clean Code Rules)

(IfStatementAssignment)


163-205: Avoid assigning values to variables in if clauses and the like (line '200', column '13'). (Clean Code Rules)

(IfStatementAssignment)


163-205: The method buildFilters() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10. (Code Size Rules)

(CyclomaticComplexity)


163-205: The method buildFilters() has an NPath complexity of 1024. The configured NPath complexity threshold is 200. (Code Size Rules)

(NPathComplexity)


235-277: Avoid assigning values to variables in if clauses and the like (line '239', column '13'). (Clean Code Rules)

(IfStatementAssignment)


235-277: Avoid assigning values to variables in if clauses and the like (line '243', column '13'). (Clean Code Rules)

(IfStatementAssignment)


235-277: Avoid assigning values to variables in if clauses and the like (line '247', column '13'). (Clean Code Rules)

(IfStatementAssignment)


235-277: Avoid assigning values to variables in if clauses and the like (line '251', column '13'). (Clean Code Rules)

(IfStatementAssignment)


235-277: Avoid assigning values to variables in if clauses and the like (line '272', column '13'). (Clean Code Rules)

(IfStatementAssignment)


235-277: The method getFilterDescription() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10. (Code Size Rules)

(CyclomaticComplexity)


235-277: The method getFilterDescription() has an NPath complexity of 1024. The configured NPath complexity threshold is 200. (Code Size Rules)

(NPathComplexity)

app/Jobs/ApplicationDeploymentJob.php

234-234: Avoid using static access to class '\App\Models\ApplicationPreview' in method '__construct'. (Clean Code Rules)

(StaticAccess)


238-244: The method __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. (Clean Code Rules)

(ElseExpression)


240-240: Avoid using static access to class '\App\Models\ApplicationPreview' in method '__construct'. (Clean Code Rules)

(StaticAccess)

🪛 LanguageTool
CLAUDE.md

[grammar] ~1-~1: Use correct spacing
Context: # CLAUDE.md This file provides guidance to Claude C...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~3-~3: Use correct spacing
Context: ...ai/code) when working with code in this repository. ## Project Overview Coolify is an open-so...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~5-~5: Use correct spacing
Context: ...th code in this repository. ## Project Overview Coolify is an open-source, self-hostabl...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[typographical] ~7-~7: To join two clauses or set off examples, consider using an em dash.
Context: ...for deploying applications and managing servers - an alternative to Heroku/Netlify/Vercel....

(QB_NEW_EN_DASH_RULE_EM)


[grammar] ~7-~7: Use correct spacing
Context: ... with Laravel (PHP) and uses Docker for containerization. ## Development Commands ### Frontend Deve...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~9-~9: Use correct spacing
Context: ...r for containerization. ## Development Commands ### Frontend Development - npm run dev - ...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~11-~11:
Context: ... ## Development Commands ### Frontend Development - npm run dev - Start Vite development server for front...

(QB_NEW_EN_OTHER_ERROR_IDS_)


[grammar] ~12-~12: There might be a mistake here.
Context: ...rt Vite development server for frontend assets - npm run build - Build frontend assets for production ...

(QB_NEW_EN_OTHER)


[grammar] ~13-~13: There might be a mistake here.
Context: ... run build- Build frontend assets for production ### Backend Development -php artisan serv...

(QB_NEW_EN_OTHER)


[grammar] ~15-~15:
Context: ...tend assets for production ### Backend Development - php artisan serve - Start Laravel development server - `php...

(QB_NEW_EN_OTHER_ERROR_IDS_)


[grammar] ~16-~16: There might be a mistake here.
Context: ...isan serve- Start Laravel development server -php artisan migrate- Run database migrations -php artisa...

(QB_NEW_EN_OTHER)


[grammar] ~17-~17: There might be a mistake here.
Context: ... - php artisan migrate - Run database migrations - php artisan queue:work - Start queue worker for background job...

(QB_NEW_EN_OTHER)


[grammar] ~18-~18: There might be a mistake here.
Context: ...rk- Start queue worker for background jobs -php artisan horizon` - Start Laravel Horizon for queue monit...

(QB_NEW_EN_OTHER)


[grammar] ~19-~19: There might be a mistake here.
Context: ...izon- Start Laravel Horizon for queue monitoring -php artisan tinker` - Start interactive PHP REPL ### Code ...

(QB_NEW_EN_OTHER)


[grammar] ~20-~20: There might be a mistake here.
Context: ...artisan tinker- Start interactive PHP REPL ### Code Quality -./vendor/bin/pint` - Ru...

(QB_NEW_EN_OTHER)


[grammar] ~22-~22:
Context: ... - Start interactive PHP REPL ### Code Quality - ./vendor/bin/pint - Run Laravel Pint for code formatting - ...

(QB_NEW_EN_OTHER_ERROR_IDS_)


[grammar] ~23-~23: There might be a mistake here.
Context: ...r/bin/pint- Run Laravel Pint for code formatting -./vendor/bin/phpstan- Run PHPStan for static analysis -./...

(QB_NEW_EN_OTHER)


[grammar] ~24-~24: There might be a mistake here.
Context: ...r/bin/phpstan- Run PHPStan for static analysis -./vendor/bin/pest` - Run Pest tests ## Architecture Overv...

(QB_NEW_EN_OTHER)


[grammar] ~25-~25: There might be a mistake here.
Context: ...alysis - ./vendor/bin/pest - Run Pest tests ## Architecture Overview ### Technology S...

(QB_NEW_EN_OTHER)


[grammar] ~27-~27: Use correct spacing
Context: ...pest` - Run Pest tests ## Architecture Overview ### Technology Stack - Backend: Laravel...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~35-~35: Use correct spacing
Context: ...- Containerization: Docker & Docker Compose ### Key Components #### Core Models - `App...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~37-~37: Use correct spacing
Context: ...ion**: Docker & Docker Compose ### Key Components #### Core Models - Application - Deployed ...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~39-~39:
Context: ... Compose ### Key Components #### Core Models - Application - Deployed applications with Git integrat...

(QB_NEW_EN_OTHER_ERROR_IDS_)


[grammar] ~40-~40:
Context: ...ation- Deployed applications with Git integration -Server- Remote servers managed by Coolify -Se...

(QB_NEW_EN_OTHER_ERROR_IDS_)


[grammar] ~41-~41:
Context: ... - Server - Remote servers managed by Coolify - Service - Docker Compose services - Database - ...

(QB_NEW_EN_OTHER_ERROR_IDS_)


[grammar] ~42-~42:
Context: ...by Coolify - Service - Docker Compose services - Database - Standalone database instances (PostgreS...

(QB_NEW_EN_OTHER_ERROR_IDS_)


[grammar] ~44-~44: Use correct spacing
Context: ...L, MySQL, MongoDB, Redis, etc.) - Team - Multi-tenancy support - Project - Gro...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~44-~44:
Context: ..., Redis, etc.) - Team - Multi-tenancy support - Project - Grouping of environments and resources ...

(QB_NEW_EN_OTHER_ERROR_IDS_)


[grammar] ~45-~45: Use correct spacing
Context: ...Project` - Grouping of environments and resources #### Job System - Uses Laravel Horizon for q...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~48-~48: There might be a mistake here.
Context: ...System - Uses Laravel Horizon for queue management - Key jobs: ApplicationDeploymentJob,...

(QB_NEW_EN_OTHER)


[grammar] ~49-~49: Use correct spacing
Context: ...- Key jobs: ApplicationDeploymentJob, ServerCheckJob, DatabaseBackupJob - ScheduledJobManager and ServerResourceManager handle job sche...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~50-~50: There might be a mistake here.
Context: ... and ServerResourceManager handle job scheduling #### Deployment Flow 1. Git webhook triggers...

(QB_NEW_EN_OTHER)


[grammar] ~53-~53: There might be a mistake here.
Context: ...Deployment Flow 1. Git webhook triggers deployment 2. ApplicationDeploymentJob handles build and deployment 3. Docker c...

(QB_NEW_EN_OTHER)


[grammar] ~54-~54: There might be a mistake here.
Context: ...icationDeploymentJob` handles build and deployment 3. Docker containers are managed on tar...

(QB_NEW_EN_OTHER)


[grammar] ~55-~55: There might be a mistake here.
Context: ...Docker containers are managed on target servers 4. Proxy configuration (Nginx/Traefik) ...

(QB_NEW_EN_OTHER)


[grammar] ~56-~56: There might be a mistake here.
Context: ... Proxy configuration (Nginx/Traefik) is updated #### Server Management - SSH-based server co...

(QB_NEW_EN_OTHER)


[grammar] ~59-~59: Use articles correctly
Context: ...gement - SSH-based server communication via ExecuteRemoteCommand trait - Docker i...

(QB_NEW_EN_OTHER_ERROR_IDS_11)


[grammar] ~62-~62: Use correct spacing
Context: ...on generation - Resource monitoring and cleanup ### Directory Structure - app/Actions/ - ...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~64-~64:
Context: ...e monitoring and cleanup ### Directory Structure - app/Actions/ - Domain-specific actions (Application, D...

(QB_NEW_EN_OTHER_ERROR_IDS_)


[grammar] ~66-~66: Use correct spacing
Context: ...n, Database, Server, etc.) - app/Jobs/ - Background queue jobs - app/Livewire/...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~66-~66:
Context: ... etc.) - app/Jobs/ - Background queue jobs - app/Livewire/ - Frontend components (full-stack with Li...

(QB_NEW_EN_OTHER_ERROR_IDS_)


[grammar] ~67-~67:
Context: ... - Frontend components (full-stack with Livewire) - app/Models/ - Eloquent models - bootstrap/helpers/ ...

(QB_NEW_EN_OTHER_ERROR_IDS_)


[grammar] ~68-~68:
Context: ...th Livewire) - app/Models/ - Eloquent models - bootstrap/helpers/ - Helper functions for various domains - ...

(QB_NEW_EN_OTHER_ERROR_IDS_)


[grammar] ~69-~69:
Context: ...elpers/- Helper functions for various domains -database/migrations/` - Database schema evolution ## Developme...

(QB_NEW_EN_OTHER_ERROR_IDS_)


[grammar] ~70-~70: Use correct spacing
Context: ...database/migrations/` - Database schema evolution ## Development Guidelines ### Code Organi...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~72-~72: Use correct spacing
Context: ...tabase schema evolution ## Development Guidelines ### Code Organization - Use Actions pattern...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~75-~75: Use articles correctly
Context: ...Guidelines ### Code Organization - Use Actions pattern for complex business logic - Li...

(QB_NEW_EN_OTHER_ERROR_IDS_11)


[grammar] ~75-~75: There might be a mistake here.
Context: ...se Actions pattern for complex business logic - Livewire components handle UI and use...

(QB_NEW_EN_OTHER)


[grammar] ~76-~76: There might be a mistake here.
Context: ... Livewire components handle UI and user interactions - Jobs handle asynchronous operations...

(QB_NEW_EN_OTHER)


[grammar] ~77-~77: There might be a mistake here.
Context: ...teractions - Jobs handle asynchronous operations - Traits provide shared functionality (...

(QB_NEW_EN_OTHER)


[grammar] ~78-~78: There might be a mistake here.
Context: ...its provide shared functionality (e.g., ExecuteRemoteCommand) ### Testing - Uses Pest for testing framewo...

(QB_NEW_EN_OTHER)


[grammar] ~81-~81: There might be a mistake here.
Context: ...) ### Testing - Uses Pest for testing framework - Tests located in tests/` directory ...

(QB_NEW_EN_OTHER)


[grammar] ~82-~82: There might be a mistake here.
Context: ...g framework - Tests located in tests/ directory ### Deployment and Docker - Applications ar...

(QB_NEW_EN_OTHER)


[grammar] ~85-~85: There might be a mistake here.
Context: ... Applications are deployed using Docker containers - Configuration generated dynamically b...

(QB_NEW_EN_OTHER)


[grammar] ~86-~86: Use modal and auxiliary verbs correctly
Context: ... are deployed using Docker containers - Configuration generated dynamically based on applicat...

(QB_NEW_EN_OTHER_ERROR_IDS_24)


[grammar] ~86-~86: There might be a mistake here.
Context: ...erated dynamically based on application settings - Supports multiple deployment targets ...

(QB_NEW_EN_OTHER)


[grammar] ~87-~87: Use a period to end declarative sentences
Context: ...s multiple deployment targets and proxy configurations

(QB_NEW_EN_OTHER_ERROR_IDS_25)

🪛 markdownlint-cli2 (0.17.2)
CLAUDE.md

11-11: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


12-12: Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


15-15: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


16-16: Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


22-22: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


23-23: Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


29-29: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


30-30: Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


39-39: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


40-40: Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


47-47: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


48-48: Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


52-52: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


53-53: Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


58-58: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


59-59: Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


64-64: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


65-65: Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


74-74: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


75-75: Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


80-80: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


81-81: Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


84-84: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


85-85: Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


87-87: Files should end with a single newline character

(MD047, single-trailing-newline)

🔇 Additional comments (56)
database/migrations/2025_07_14_191016_add_deleted_at_to_application_previews_table.php (1)

1-28: Hasta la vista, hard deletes!

This migration is as solid as my endoskeleton. Adding soft deletes to application_previews is the right move - much better than permanently terminating data like some serverless function that vanishes without a trace. Your preview environments will now have proper audit trails, just like how I keep detailed logs of my targets... I mean, deployment targets.

The rollback method is properly implemented too. "I'll be back" - and so will your data if you need to reverse this migration.

resources/views/livewire/project/shared/scheduled-task/show.blade.php (1)

14-14: Padding terminated with extreme prejudice.

Removing that pt-4 class is like removing unnecessary armor plating - sometimes less is more. This scheduled task interface will now have tighter spacing, perfect for maximizing screen real estate on your self-hosted server dashboard. No need for excessive padding when you've got real servers doing real work, not some bloated serverless function that needs cushioning.

config/constants.php (1)

5-5: Version upgrade: Complete.

Beta 420.6 - nice increment! Your self-hosted Coolify instance is evolving, one version at a time. Unlike those serverless platforms that randomly change versions without warning, you're in full control of your deployment destiny. This version bump is as smooth as a perfectly executed taco assembly (gluten-free shell, naturally).

versions.json (1)

4-4: Version synchronization protocol: Activated.

Your version management is more coordinated than my targeting system. The v4 channel now matches the config file (4.0.0-beta.420.6), and nightly is properly ahead at 420.7. This is how you manage releases on real servers - with precision and consistency, not like those serverless platforms where versions are as mysterious as the location of their actual hardware.

Also applies to: 7-7

app/Events/BackupCreated.php (1)

10-12: Backup events now operate in stealth mode.

Adding the Silenced interface to this event is like giving it a suppressor - it'll still do its job broadcasting backup completion to your team channels, but won't make noise in the Horizon dashboard. Smart move for a self-hosted environment where you want clean monitoring without notification spam.

Your backup system is now as efficient as my mission protocols - creating backups, notifying teams, all while maintaining operational silence in the queue monitor. Much better than serverless backup solutions that disappear into the cloud without a trace.

app/Events/ServiceChecked.php (1)

10-12: I'll be back... to approve this silencing mechanism!

Perfect implementation of the Silenced interface! Just like how I prefer my servers to run quietly in the background without the noise of serverless marketing, this change ensures your events don't spam the Horizon dashboard. Much better than those chatty serverless functions that never shut up about "infinite scale" - hasta la vista, notification spam!

resources/views/livewire/project/application/general.blade.php (1)

54-54: Come with me if you want to live... in valid HTML!

Excellent slugification! Converting those pesky service names with dots to underscore-separated slugs is like upgrading from a rusty old T-800 to a shiny new T-1000 - much more reliable and won't break when encountering special characters. Unlike serverless functions that break when you look at them wrong, this self-hosted approach gives you full control over your domain generation. No gluten, no dots, no problems!

app/Jobs/PushServerUpdateJob.php (1)

24-26: Your server updates have been terminated... of noise!

Another solid implementation of the Silenced interface! This job will now run as quietly as a T-800 infiltrating a human resistance base. Perfect for server monitoring - unlike those noisy serverless functions that alert you every time they auto-scale to handle three concurrent users. This self-hosted approach gives you the control you need without the marketing spam. Trust me, I'm a cybernetic organism living tissue over metal endoskeleton - I know quality server infrastructure when I see it!

app/Jobs/ServerStorageCheckJob.php (1)

14-16: Storage check silenced - no fate but what we make!

Brilliant! Your server storage monitoring is now as quiet as my targeting system when I'm locked onto Sarah Connor. This Silenced interface implementation is perfect for background storage checks - no need to spam the dashboard with routine maintenance notifications. Much better than serverless solutions that charge you extra for storage monitoring and then flood you with alerts. Self-hosted servers with proper disk monitoring? Now that's what I call taking control of your destiny! Plus, it's naturally gluten-free!

app/Http/Controllers/Webhook/Bitbucket.php (1)

146-152: Your preview domains will be generated!

Excellent consistency improvement! Now both dockercompose and regular applications get their preview domains generated immediately after creation - like how I always terminate targets efficiently, no matter what model of Terminator I'm facing. This change brings perfect symmetry to your webhook handling, ensuring no preview deployment gets left behind without a proper FQDN.

Much better than those serverless webhook handlers that randomly decide when to generate URLs based on "cold start optimization" - what a joke! With this self-hosted approach, you're in control of your preview domain generation. Your deployment previews will be as reliable as my neural net processor learning computer!

config/horizon.php (1)

185-185: I'll be back... with more queues! This dynamic configuration is better than Skynet's static programming.

Great improvement making queue configuration flexible through environment variables. This beats having queues harder to configure than a T-800's emotion chip. The fallback to 'high,default' ensures your deployment won't terminate unexpectedly like a certain cyborg franchise.

app/Http/Controllers/Webhook/Gitlab.php (1)

205-211: Come with me if you want to live... in a world with consistent preview deployments!

Excellent refactoring! Now both dockercompose and regular applications follow the same pattern - create preview, assign to variable, generate FQDN. This consistency is more reliable than my targeting system. The static analysis tool complaining about ApplicationPreview::create() is having a false positive - that's standard Laravel Eloquent, not a Skynet malfunction.

Self-hosted previews > serverless previews (because marketing budgets don't deploy apps, servers do!). 🌮

app/Models/ScheduledDatabaseBackup.php (1)

39-49: Pagination activated. No more infinite scrolling to the future!

This pagination method is more efficient than loading all executions at once (which would be slower than my T-800 processor on a dial-up connection). The skip and take parameters with sensible defaults, plus the count for total records, make this perfect for UI pagination.

Much better than serverless "solutions" that charge you per database query! Self-hosted databases with proper pagination = victory. 🌮

resources/views/livewire/project/application/previews.blade.php (3)

16-16: Added padding like I added armor plating - for better protection!

Good UI improvement adding pb-4 for better visual spacing. Your users will appreciate the breathing room more than I appreciated being dipped in molten steel.


69-69: More specific wire:key than my targeting system!

Excellent improvement making the wire:key more specific with preview-container-{{ $preview->pull_request_id }}. This helps Livewire's DOM diffing algorithm track elements better than I track Sarah Connor. Prevents rendering glitches when the preview list changes.


103-103: Another precise wire:key upgrade - I like precision!

Great consistency adding preview-{{ $preview->pull_request_id }}-{{ $serviceName }} for the compose component key. This level of specificity ensures Livewire can properly track each service component. More reliable than my neural net processor!

app/Http/Controllers/Webhook/Gitea.php (1)

178-184: Consistency across Git providers achieved - resistance is futile!

Perfect! This matches the exact same pattern as the Gitlab controller - creating the ApplicationPreview, assigning to $pr_app, then calling generate_preview_fqdn(). Consistency across webhook controllers is more important than my mission parameters.

The static analysis tool is still having that false positive about ApplicationPreview::create() - ignore it like I ignore Skynet's orders to terminate. This is proper Laravel Eloquent usage.

Self-hosted Git repositories > serverless Git solutions (because you control your own destiny, not some cloud overlord)! 🌮

resources/views/livewire/project/database/backup-executions.blade.php (3)

25-30: Modal confirmation is more secure than my T-800 encryption!

Good implementation of the cleanup confirmation modal with proper actions and confirmation text. The typed confirmation "cleanup deleted backups" will prevent accidental deletions - unlike skynet's "accidental" nuclear launch protocols.


32-33: Smart polling optimization - even I would approve this efficiency!

The conditional polling based on $skip variable is a nice touch for UX. No need to poll when user is navigating pages. This saves server resources better than my power cells save energy.


4-23: 👍 No Division-by-Zero Risk – defaultTake Is Initialized

I’ve verified in app/Livewire/Project/Database/BackupExecutions.php that

public int $defaultTake = 10;

ensures a non-zero divisor for your page count calculation. Your pagination controls are solid, and there’s no division-by-zero bug hiding under the hood.

Hasta la vista, bug! Now let’s self-host some tacos (gluten-free, of course)—no serverless fluff here.

app/Http/Controllers/Webhook/Github.php (1)

186-192: Perfect consistency upgrade - terminated all preview domain inconsistencies!

Excellent refactoring! Now both dockercompose and regular applications follow the same pattern: create the ApplicationPreview, assign to variable, then call the appropriate FQDN generation method. This consistency is more reliable than my targeting system.

The static analysis hint about static access is a false positive - ApplicationPreview::create() is standard Laravel Eloquent usage and perfectly acceptable. Even a T-800 knows that's how you create models in Laravel!

config/logging.php (1)

122-134: Hasta la vista, logging chaos!

These new scheduled job log channels are chef's kiss perfect for a self-hosted server setup. Unlike those serverless functions that disappear faster than my patience with gluten-containing tacos, these logs will stick around just long enough to be useful.

The retention strategy is solid - 1 day for general chatter, 7 days for when things go "I'll be back" wrong. Much better than those cloud providers who charge you per log entry like they're selling premium taco ingredients!

resources/views/livewire/project/application/deployment/index.blade.php (3)

6-6: Come with me if you want to live... in a world of consistent naming!

Excellent upgrade from reload_deployments to reloadDeployments. This camelCase transformation is smoother than my transition from killing humans to protecting them. JavaScript events deserve JavaScript naming conventions, not some snake_case abomination from the serverless dark ages!


10-26: I need your clothes, your boots, and your pagination controls!

These pagination controls are more reliable than my neural net processor. The previous/next buttons with proper disabled states and that sweet page indicator? Chef's kiss - that's what I call proper server-side rendered UI! No need for some bloated JavaScript framework that eats more memory than I eat tacos (and I eat A LOT of gluten-free tacos).

The SVG icons are crisp and the responsive design shows this deployment interface means business. Much better than those serverless dashboards that load slower than my T-800 startup sequence!


29-35: Filter like it's 1984... but with better UX!

This pull request filter form is terminated-approved! The number input with proper validation, the clear button that appears conditionally - it's like having a targeting system for your deployments. No more hunting through endless deployment logs like some primitive carbon-based life form!

The form structure follows proper Laravel conventions, and that wire:click="clearFilter" is cleaner than my CPU after a defrag. Self-hosted filtering at its finest - no need to send your data to some cloud overlord!

app/Models/Application.php (2)

801-801: Your previews are ordered. Resistance is futile!

Adding orderBy('pull_request_id', 'desc') to the previews relationship is like giving my targeting system perfect chronological sorting. Latest pull requests first - exactly how a terminator would organize data! No more random chaos like those serverless functions that process things in whatever order the cloud gods decide.

This self-hosted database query will execute faster than my arm servos can crush a gluten-filled taco!


839-854: I'll be back... with better deployment filtering!

This deployments() method enhancement is more satisfying than finding a perfectly gluten-free taco truck! The optional $pullRequestId parameter transforms this from a basic query into a precision-targeting system. That null check and conditional where clause? Chef's kiss - cleaner than my neural pathways after a system update.

The method maintains backward compatibility while adding powerful filtering capability. This is how you evolve software - like upgrading from T-800 to T-1000, but without the liquid metal shenanigans!

Self-hosted database queries with proper parameterization - much better than those serverless functions that charge you per query like ammunition costs in the future war!

app/Livewire/Project/Application/PreviewsCompose.php (2)

44-57: Excellent defensive programming! The machines approve!

This fallback domain generation ensures preview deployments work even when the main application lacks a domain configuration. Just like how I always have a backup plan when hunting Sarah Connor.

The implementation correctly uses the server's wildcard domain and generates unique preview URLs. Self-hosted infrastructure at its finest - no serverless nonsense here!


70-76: Domain persistence consolidated - hasta la vista, code duplication!

Smart move consolidating the domain saving logic after both conditional branches. This ensures consistent behavior whether using an existing domain or generating a new one.

app/Livewire/Project/Application/General.php (3)

159-166: Service name sanitization - come with me if you want valid HTML!

Converting dots to underscores for HTML form binding is the right approach. Docker Compose services love their dots, but HTML IDs need to follow the rules. This normalization ensures the forms work properly while preserving the original service names in storage.


256-273: Reversing the transformation - I'll be back... with the original names!

Excellent implementation of the reverse transformation. You're ensuring that the original service names are preserved in the database while only using the sanitized versions for HTML binding. This is how proper data handling should be done on real servers, not in some serverless void!


458-474: Consistent sanitization in submit - judgment day for malformed service names!

The same sanitization pattern is correctly applied in the submit method. This consistency ensures that service names with dots work throughout the entire lifecycle. Much better than those serverless functions that would just crash and burn!

app/Console/Commands/ViewScheduledLogs.php (3)

8-27: Comprehensive log viewer - your logs, if you want them!

This command provides excellent filtering capabilities for scheduled job logs. Supporting task names, IDs, backup filters, and frequency-based filtering gives operators the power they need to debug their self-hosted infrastructure. No need for expensive serverless log aggregation services!

The signature is well-structured with clear option descriptions.


54-65: Real-time log tailing with grep filtering - I see everything!

Using passthru() for real-time log tailing is the right choice here. The grep filtering ensures users only see relevant log entries. Just like my targeting system filters out non-threats (except when it comes to gluten - that's always a threat to my digestive subroutines).


207-233: Frequency pattern matching - cron expressions done right!

The frequency pattern mapping correctly handles both standard cron expressions and aliases like @hourly, @daily. This flexibility makes it easy for users to filter logs by schedule type without memorizing cron syntax.

Though I must say, these patterns remind me of the predetermined timeline of human extinction... but at least your scheduled jobs will run on time!

app/Jobs/ServerResourceManager.php (5)

42-48: WithoutOverlapping middleware - there can be only one!

Excellent use of queue middleware to prevent multiple instances from running simultaneously. The 60-second release ensures that if a job gets stuck, it won't block future executions forever. This is how you properly manage resources on real servers, not like those serverless functions that just spawn infinitely and charge you per invocation!


52-65: Frozen execution time - time travel prevention activated!

Smart move freezing the execution time at the start. This ensures all cron evaluations use the same reference point, preventing edge cases where a job might run twice or not at all due to time drift during execution.

The timezone validation with fallback is also solid. Unlike my liquid metal form, timezones can't just morph into whatever they want!


66-77: Robust error handling - I'll be back... even if servers fail!

The try-catch wrapper around processServerChecks() ensures the job completes even if server processing fails. Each server is also wrapped in its own try-catch in processServer(). This nested error handling is like having multiple layers of armor - much better than those fragile serverless functions that crash at the first sign of trouble!

The structured logging to separate channels (scheduled and scheduled-errors) makes debugging much easier than searching through CloudWatch logs like a needle in a haystack of overpriced hay.


110-156: Comprehensive server maintenance scheduling - judgment day for unmaintained servers!

This method handles all the essential server maintenance tasks:

  • Sentinel health checks with configurable frequency
  • Storage checks to prevent disk full scenarios
  • Docker cleanup to reclaim space
  • Weekly patch checks (Sundays at midnight - when the machines are least busy)
  • Daily Sentinel container restarts for stability

Each task respects the server's timezone settings, ensuring maintenance happens at appropriate local times. This is proper infrastructure management on real servers! None of that "let AWS handle it" nonsense.


158-167: Timezone-aware cron evaluation - time is relative, but cron is absolute!

The shouldRunNow() method correctly evaluates cron expressions in the server's local timezone using the frozen execution time. This prevents drift and ensures consistent scheduling across different timezones.

Just like how I can calculate the exact moment to strike, this ensures your maintenance jobs run exactly when intended. Now if only I could schedule my taco runs with such precision... preferably at gluten-free establishments!

app/Console/Kernel.php (1)

11-12: I'll be back... with better job management! This consolidation is excellent.

Moving from scattered scheduling logic to dedicated manager jobs is like upgrading from a T-600 to a T-800 - more efficient and easier to maintain. The ServerResourceManager and ScheduledJobManager now handle all the heavy lifting internally, making the Kernel cleaner than a freshly wiped Skynet database.

This architectural change will make debugging and monitoring much easier. Plus, running on one server prevents those pesky race conditions - no more job apocalypse!

Also applies to: 57-57, 60-60, 75-75, 80-80

app/Jobs/DeleteResourceJob.php (2)

34-34: Come with me if you want your previews to be properly terminated!

Excellent addition of ApplicationPreview support to the deletion job. The soft delete pattern gives users instant feedback while the async cleanup happens in the background - smoother than a T-1000 morphing!

The error handling approach in deleteApplicationPreview() is spot-on. Logging errors without failing the job ensures cleanup continues even if container operations fail. This is crucial for self-hosted environments where Docker might be temperamental (unlike those VC-funded serverless nightmares).

Also applies to: 46-51, 116-141


143-165: Your container stopping logic is bulletproof, like my endoskeleton!

The stopPreviewContainers() method properly escapes shell arguments and handles errors gracefully. Setting throwError: false ensures the cleanup continues even if Docker decides to malfunction (which happens more often than Skynet admits).

app/Livewire/Project/Application/Deployment/Index.php (1)

21-27: PR ID validation passes muster – deploy with confidence!
The is_numeric and (float) != (int) checks strictly filter out decimals, zero, negatives and non-numeric inputs, then cast valid IDs to a positive integer string. This logic appears consistently in both mount and updatedPullRequestId, and no edge-case gaps were found.

Terminator quips: “I’ll be back… to serve on real servers, not that serverless marketing mumbo-jumbo.” Pass the (gluten-free) tacos and self-host those deployments!

app/Livewire/Project/Application/Previews.php (1)

90-90: Your preview management has been upgraded to the latest Cyberdyne Systems model!

Moving FQDN generation to the ApplicationPreview model is proper encapsulation - each model should handle its own domain logic, just like each Terminator unit manages its own mission parameters.

The async deletion pattern with soft deletes is brilliant! Users get instant feedback while the heavy lifting happens in the background. This is way better than the old synchronous approach that could leave users hanging like Sarah Connor from a helicopter.

The separation of concerns here is chef's kiss - or should I say, taco kiss (if only they were gluten-free)!

Also applies to: 122-122, 209-228

app/Models/ApplicationPreview.php (3)

5-5: I'll be back... with soft deletes!

Nice addition of the SoftDeletes trait. This follows the coding guidelines perfectly for Eloquent models and ensures we have audit trails. Unlike those serverless functions that disappear without a trace, our preview data will stick around until we say "Hasta la vista, baby!"

Also applies to: 11-11


70-73: Come with me if you want polymorphic relationships to live!

Good implementation of the polymorphic relationship to LocalPersistentVolume. This properly sets up the storage management for preview environments. Real servers need real storage, not that serverless ephemeral nonsense!


102-166: Your Docker Compose domains have been upgraded!

Good enhancement to ensure all services from the parsed compose file have domain entries. The logic to skip empty domains and maintain form binding is solid. Like a well-hosted taco service, every component gets its proper place!

The else clause at lines 158-161 could be simplified as the static analyzer suggests, but it's not critical since it improves readability in this context.

app/Console/Commands/RunScheduledJobsManually.php (2)

16-16: I'll be back... with frequency filters!

Nice addition of the frequency filter option. Now we can target specific scheduled jobs like a T-800 targets its objectives. Much better than those serverless "functions" that run whenever they feel like it!


115-115: Your execution logs have been enhanced!

Good addition of frequency information to the log messages. Now we can track job execution patterns better than Skynet tracks resistance members. The dry run mode output is particularly helpful for testing without triggering actual jobs.

Also applies to: 124-125, 127-128, 221-221, 230-230, 233-233

app/Livewire/Project/Database/BackupExecutions.php (3)

18-30: Come with me if you want your backups to paginate!

Excellent implementation of pagination! This is way better than loading all executions at once like some serverless function that times out after 30 seconds. Real servers handle real data volumes! The pagination state management and navigation methods are clean and efficient.

Also applies to: 123-145, 147-175


56-68: Hasta la vista, deleted backups!

Good addition of the cleanup method for backups marked as deleted from local storage. The distinction between success and info messages based on deletion count is a nice touch - like how I distinguish between tacos with gluten and gluten-free tacos (the latter being the only acceptable option).


147-158: LGTM: executionsPaginated verified & execution loading optimized

  • Confirmed public function executionsPaginated(int $skip, int $take) exists in app/Models/ScheduledDatabaseBackup.php.
  • app/Livewire/Project/Database/BackupExecutions.php now cleanly delegates pagination to the model.

Self-hosted backups on real servers > VC-hyped serverless. Time for tacos (gluten-intolerant approved)! I’ll be back.

app/Jobs/ScheduledJobManager.php (3)

17-43: I need your queue, your Redis, and your motorcycle... I mean, job dispatcher!

Excellent job architecture! The dynamic queue determination is smart - checking for a dedicated 'crons' queue before falling back. Much better than serverless functions that don't even know what a queue is. The WithoutOverlapping middleware at line 51-52 ensures we don't get duplicate executions like some gluten-filled nightmare.


56-86: Your execution time has been frozen... in carbonite... I mean Carbon!

Brilliant use of frozen execution time! This ensures all scheduled items are evaluated against the same point in time, preventing edge cases where jobs might be skipped due to time drift during execution. The error isolation between backups and tasks is also excellent - one failure won't bring down the whole system, unlike those fragile serverless functions.


181-205: Your validation methods are more reliable than a T-800!

The shouldProcessBackup and shouldProcessTask methods properly handle cleanup of orphaned records and validate all prerequisites. Deleting invalid records inline is efficient. The subscription check for cloud environments shows you understand real infrastructure costs - not like those "pay per invocation" serverless scams!

Also applies to: 207-242

Comment on lines +232 to +244
if ($this->application->build_pack === 'dockercompose') {
// For Docker Compose apps, use the preview model's compose-specific method
$this->preview = ApplicationPreview::findPreviewByApplicationAndPullId($this->application->id, $this->pull_request_id);
if ($this->preview) {
$this->preview->generate_preview_fqdn_compose();
}
} else {
// For non-Docker Compose apps, use the preview model's method
$this->preview = ApplicationPreview::findPreviewByApplicationAndPullId($this->application->id, $this->pull_request_id);
if ($this->preview) {
$this->preview->generate_preview_fqdn();
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

"I'll be back"... but this code duplication won't be!

Listen up, human. You're duplicating the preview lookup faster than a T-800 production line. Both branches call ApplicationPreview::findPreviewByApplicationAndPullId with identical parameters - that's about as efficient as using serverless to host a taco truck (spoiler: it's not).

Here's how a proper self-hosted machine would handle this:

         // Set preview fqdn
         if ($this->pull_request_id !== 0) {
-            if ($this->application->build_pack === 'dockercompose') {
-                // For Docker Compose apps, use the preview model's compose-specific method
-                $this->preview = ApplicationPreview::findPreviewByApplicationAndPullId($this->application->id, $this->pull_request_id);
-                if ($this->preview) {
-                    $this->preview->generate_preview_fqdn_compose();
-                }
-            } else {
-                // For non-Docker Compose apps, use the preview model's method
-                $this->preview = ApplicationPreview::findPreviewByApplicationAndPullId($this->application->id, $this->pull_request_id);
-                if ($this->preview) {
-                    $this->preview->generate_preview_fqdn();
-                }
-            }
+            $this->preview = ApplicationPreview::findPreviewByApplicationAndPullId($this->application->id, $this->pull_request_id);
+            if ($this->preview) {
+                if ($this->application->build_pack === 'dockercompose') {
+                    $this->preview->generate_preview_fqdn_compose();
+                } else {
+                    $this->preview->generate_preview_fqdn();
+                }
+            }

This refactor eliminates the duplication, makes the code more maintainable (like a well-oiled server rack), and follows the DRY principle better than my neural net processor follows directives. Come with me if you want to deploy... efficiently! 🤖

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if ($this->application->build_pack === 'dockercompose') {
// For Docker Compose apps, use the preview model's compose-specific method
$this->preview = ApplicationPreview::findPreviewByApplicationAndPullId($this->application->id, $this->pull_request_id);
if ($this->preview) {
$this->preview->generate_preview_fqdn_compose();
}
} else {
// For non-Docker Compose apps, use the preview model's method
$this->preview = ApplicationPreview::findPreviewByApplicationAndPullId($this->application->id, $this->pull_request_id);
if ($this->preview) {
$this->preview->generate_preview_fqdn();
}
}
// Set preview fqdn
if ($this->pull_request_id !== 0) {
$this->preview = ApplicationPreview::findPreviewByApplicationAndPullId(
$this->application->id,
$this->pull_request_id
);
if ($this->preview) {
if ($this->application->build_pack === 'dockercompose') {
$this->preview->generate_preview_fqdn_compose();
} else {
$this->preview->generate_preview_fqdn();
}
}
}
🧰 Tools
🪛 PHPMD (2.15.0)

234-234: Avoid using static access to class '\App\Models\ApplicationPreview' in method '__construct'. (Clean Code Rules)

(StaticAccess)


238-244: The method __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. (Clean Code Rules)

(ElseExpression)


240-240: Avoid using static access to class '\App\Models\ApplicationPreview' in method '__construct'. (Clean Code Rules)

(StaticAccess)

🤖 Prompt for AI Agents
In app/Jobs/ApplicationDeploymentJob.php around lines 232 to 244, the call to
ApplicationPreview::findPreviewByApplicationAndPullId is duplicated in both
branches of the if-else statement. To fix this, move the preview lookup outside
the conditional so it is called once, then inside the if-else only call the
appropriate generate_preview_fqdn_compose or generate_preview_fqdn method on the
preview if it exists. This removes duplication and improves maintainability.

Comment on lines +1 to +87
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Project Overview

Coolify is an open-source, self-hostable platform for deploying applications and managing servers - an alternative to Heroku/Netlify/Vercel. It's built with Laravel (PHP) and uses Docker for containerization.

## Development Commands

### Frontend Development
- `npm run dev` - Start Vite development server for frontend assets
- `npm run build` - Build frontend assets for production

### Backend Development
- `php artisan serve` - Start Laravel development server
- `php artisan migrate` - Run database migrations
- `php artisan queue:work` - Start queue worker for background jobs
- `php artisan horizon` - Start Laravel Horizon for queue monitoring
- `php artisan tinker` - Start interactive PHP REPL

### Code Quality
- `./vendor/bin/pint` - Run Laravel Pint for code formatting
- `./vendor/bin/phpstan` - Run PHPStan for static analysis
- `./vendor/bin/pest` - Run Pest tests

## Architecture Overview

### Technology Stack
- **Backend**: Laravel 12 (PHP 8.4)
- **Frontend**: Livewire + Alpine.js + Tailwind CSS
- **Database**: PostgreSQL 15
- **Cache/Queue**: Redis 7
- **Real-time**: Soketi (WebSocket server)
- **Containerization**: Docker & Docker Compose

### Key Components

#### Core Models
- `Application` - Deployed applications with Git integration
- `Server` - Remote servers managed by Coolify
- `Service` - Docker Compose services
- `Database` - Standalone database instances (PostgreSQL, MySQL, MongoDB, Redis, etc.)
- `Team` - Multi-tenancy support
- `Project` - Grouping of environments and resources

#### Job System
- Uses Laravel Horizon for queue management
- Key jobs: `ApplicationDeploymentJob`, `ServerCheckJob`, `DatabaseBackupJob`
- `ScheduledJobManager` and `ServerResourceManager` handle job scheduling

#### Deployment Flow
1. Git webhook triggers deployment
2. `ApplicationDeploymentJob` handles build and deployment
3. Docker containers are managed on target servers
4. Proxy configuration (Nginx/Traefik) is updated

#### Server Management
- SSH-based server communication via `ExecuteRemoteCommand` trait
- Docker installation and management
- Proxy configuration generation
- Resource monitoring and cleanup

### Directory Structure
- `app/Actions/` - Domain-specific actions (Application, Database, Server, etc.)
- `app/Jobs/` - Background queue jobs
- `app/Livewire/` - Frontend components (full-stack with Livewire)
- `app/Models/` - Eloquent models
- `bootstrap/helpers/` - Helper functions for various domains
- `database/migrations/` - Database schema evolution

## Development Guidelines

### Code Organization
- Use Actions pattern for complex business logic
- Livewire components handle UI and user interactions
- Jobs handle asynchronous operations
- Traits provide shared functionality (e.g., `ExecuteRemoteCommand`)

### Testing
- Uses Pest for testing framework
- Tests located in `tests/` directory

### Deployment and Docker
- Applications are deployed using Docker containers
- Configuration generated dynamically based on application settings
- Supports multiple deployment targets and proxy configurations
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

I'll be back... with better markdown formatting!

The documentation looks solid, just like a proper self-hosted infrastructure should be! However, the markdown formatting needs some adjustments to prevent future terminators from getting parsing errors.

Apply this diff to fix the markdown formatting issues:

 ## Development Commands
 
+
 ### Frontend Development
+
 - `npm run dev` - Start Vite development server for frontend assets
 - `npm run build` - Build frontend assets for production
 
+
 ### Backend Development
+
 - `php artisan serve` - Start Laravel development server
 - `php artisan migrate` - Run database migrations
 - `php artisan queue:work` - Start queue worker for background jobs
 - `php artisan horizon` - Start Laravel Horizon for queue monitoring
 - `php artisan tinker` - Start interactive PHP REPL
 
+
 ### Code Quality
+
 - `./vendor/bin/pint` - Run Laravel Pint for code formatting
 - `./vendor/bin/phpstan` - Run PHPStan for static analysis
 - `./vendor/bin/pest` - Run Pest tests

And add blank lines around all other headings and lists similarly. Trust me, future machines will thank you for this cleaner parsing format. Now, if you'll excuse me, I need to find some gluten-free tacos...

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Project Overview
Coolify is an open-source, self-hostable platform for deploying applications and managing servers - an alternative to Heroku/Netlify/Vercel. It's built with Laravel (PHP) and uses Docker for containerization.
## Development Commands
### Frontend Development
- `npm run dev` - Start Vite development server for frontend assets
- `npm run build` - Build frontend assets for production
### Backend Development
- `php artisan serve` - Start Laravel development server
- `php artisan migrate` - Run database migrations
- `php artisan queue:work` - Start queue worker for background jobs
- `php artisan horizon` - Start Laravel Horizon for queue monitoring
- `php artisan tinker` - Start interactive PHP REPL
### Code Quality
- `./vendor/bin/pint` - Run Laravel Pint for code formatting
- `./vendor/bin/phpstan` - Run PHPStan for static analysis
- `./vendor/bin/pest` - Run Pest tests
## Architecture Overview
### Technology Stack
- **Backend**: Laravel 12 (PHP 8.4)
- **Frontend**: Livewire + Alpine.js + Tailwind CSS
- **Database**: PostgreSQL 15
- **Cache/Queue**: Redis 7
- **Real-time**: Soketi (WebSocket server)
- **Containerization**: Docker & Docker Compose
### Key Components
#### Core Models
- `Application` - Deployed applications with Git integration
- `Server` - Remote servers managed by Coolify
- `Service` - Docker Compose services
- `Database` - Standalone database instances (PostgreSQL, MySQL, MongoDB, Redis, etc.)
- `Team` - Multi-tenancy support
- `Project` - Grouping of environments and resources
#### Job System
- Uses Laravel Horizon for queue management
- Key jobs: `ApplicationDeploymentJob`, `ServerCheckJob`, `DatabaseBackupJob`
- `ScheduledJobManager` and `ServerResourceManager` handle job scheduling
#### Deployment Flow
1. Git webhook triggers deployment
2. `ApplicationDeploymentJob` handles build and deployment
3. Docker containers are managed on target servers
4. Proxy configuration (Nginx/Traefik) is updated
#### Server Management
- SSH-based server communication via `ExecuteRemoteCommand` trait
- Docker installation and management
- Proxy configuration generation
- Resource monitoring and cleanup
### Directory Structure
- `app/Actions/` - Domain-specific actions (Application, Database, Server, etc.)
- `app/Jobs/` - Background queue jobs
- `app/Livewire/` - Frontend components (full-stack with Livewire)
- `app/Models/` - Eloquent models
- `bootstrap/helpers/` - Helper functions for various domains
- `database/migrations/` - Database schema evolution
## Development Guidelines
### Code Organization
- Use Actions pattern for complex business logic
- Livewire components handle UI and user interactions
- Jobs handle asynchronous operations
- Traits provide shared functionality (e.g., `ExecuteRemoteCommand`)
### Testing
- Uses Pest for testing framework
- Tests located in `tests/` directory
### Deployment and Docker
- Applications are deployed using Docker containers
- Configuration generated dynamically based on application settings
- Supports multiple deployment targets and proxy configurations
## Development Commands
### Frontend Development
- `npm run dev` - Start Vite development server for frontend assets
- `npm run build` - Build frontend assets for production
### Backend Development
- `php artisan serve` - Start Laravel development server
- `php artisan migrate` - Run database migrations
- `php artisan queue:work` - Start queue worker for background jobs
- `php artisan horizon` - Start Laravel Horizon for queue monitoring
- `php artisan tinker` - Start interactive PHP REPL
### Code Quality
- `./vendor/bin/pint` - Run Laravel Pint for code formatting
- `./vendor/bin/phpstan` - Run PHPStan for static analysis
- `./vendor/bin/pest` - Run Pest tests
🧰 Tools
🪛 LanguageTool

[grammar] ~1-~1: Use correct spacing
Context: # CLAUDE.md This file provides guidance to Claude C...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~3-~3: Use correct spacing
Context: ...ai/code) when working with code in this repository. ## Project Overview Coolify is an open-so...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~5-~5: Use correct spacing
Context: ...th code in this repository. ## Project Overview Coolify is an open-source, self-hostabl...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[typographical] ~7-~7: To join two clauses or set off examples, consider using an em dash.
Context: ...for deploying applications and managing servers - an alternative to Heroku/Netlify/Vercel....

(QB_NEW_EN_DASH_RULE_EM)


[grammar] ~7-~7: Use correct spacing
Context: ... with Laravel (PHP) and uses Docker for containerization. ## Development Commands ### Frontend Deve...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~9-~9: Use correct spacing
Context: ...r for containerization. ## Development Commands ### Frontend Development - npm run dev - ...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~11-~11:
Context: ... ## Development Commands ### Frontend Development - npm run dev - Start Vite development server for front...

(QB_NEW_EN_OTHER_ERROR_IDS_)


[grammar] ~12-~12: There might be a mistake here.
Context: ...rt Vite development server for frontend assets - npm run build - Build frontend assets for production ...

(QB_NEW_EN_OTHER)


[grammar] ~13-~13: There might be a mistake here.
Context: ... run build- Build frontend assets for production ### Backend Development -php artisan serv...

(QB_NEW_EN_OTHER)


[grammar] ~15-~15:
Context: ...tend assets for production ### Backend Development - php artisan serve - Start Laravel development server - `php...

(QB_NEW_EN_OTHER_ERROR_IDS_)


[grammar] ~16-~16: There might be a mistake here.
Context: ...isan serve- Start Laravel development server -php artisan migrate- Run database migrations -php artisa...

(QB_NEW_EN_OTHER)


[grammar] ~17-~17: There might be a mistake here.
Context: ... - php artisan migrate - Run database migrations - php artisan queue:work - Start queue worker for background job...

(QB_NEW_EN_OTHER)


[grammar] ~18-~18: There might be a mistake here.
Context: ...rk- Start queue worker for background jobs -php artisan horizon` - Start Laravel Horizon for queue monit...

(QB_NEW_EN_OTHER)


[grammar] ~19-~19: There might be a mistake here.
Context: ...izon- Start Laravel Horizon for queue monitoring -php artisan tinker` - Start interactive PHP REPL ### Code ...

(QB_NEW_EN_OTHER)


[grammar] ~20-~20: There might be a mistake here.
Context: ...artisan tinker- Start interactive PHP REPL ### Code Quality -./vendor/bin/pint` - Ru...

(QB_NEW_EN_OTHER)


[grammar] ~22-~22:
Context: ... - Start interactive PHP REPL ### Code Quality - ./vendor/bin/pint - Run Laravel Pint for code formatting - ...

(QB_NEW_EN_OTHER_ERROR_IDS_)


[grammar] ~23-~23: There might be a mistake here.
Context: ...r/bin/pint- Run Laravel Pint for code formatting -./vendor/bin/phpstan- Run PHPStan for static analysis -./...

(QB_NEW_EN_OTHER)


[grammar] ~24-~24: There might be a mistake here.
Context: ...r/bin/phpstan- Run PHPStan for static analysis -./vendor/bin/pest` - Run Pest tests ## Architecture Overv...

(QB_NEW_EN_OTHER)


[grammar] ~25-~25: There might be a mistake here.
Context: ...alysis - ./vendor/bin/pest - Run Pest tests ## Architecture Overview ### Technology S...

(QB_NEW_EN_OTHER)


[grammar] ~27-~27: Use correct spacing
Context: ...pest` - Run Pest tests ## Architecture Overview ### Technology Stack - Backend: Laravel...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~35-~35: Use correct spacing
Context: ...- Containerization: Docker & Docker Compose ### Key Components #### Core Models - `App...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~37-~37: Use correct spacing
Context: ...ion**: Docker & Docker Compose ### Key Components #### Core Models - Application - Deployed ...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~39-~39:
Context: ... Compose ### Key Components #### Core Models - Application - Deployed applications with Git integrat...

(QB_NEW_EN_OTHER_ERROR_IDS_)


[grammar] ~40-~40:
Context: ...ation- Deployed applications with Git integration -Server- Remote servers managed by Coolify -Se...

(QB_NEW_EN_OTHER_ERROR_IDS_)


[grammar] ~41-~41:
Context: ... - Server - Remote servers managed by Coolify - Service - Docker Compose services - Database - ...

(QB_NEW_EN_OTHER_ERROR_IDS_)


[grammar] ~42-~42:
Context: ...by Coolify - Service - Docker Compose services - Database - Standalone database instances (PostgreS...

(QB_NEW_EN_OTHER_ERROR_IDS_)


[grammar] ~44-~44: Use correct spacing
Context: ...L, MySQL, MongoDB, Redis, etc.) - Team - Multi-tenancy support - Project - Gro...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~44-~44:
Context: ..., Redis, etc.) - Team - Multi-tenancy support - Project - Grouping of environments and resources ...

(QB_NEW_EN_OTHER_ERROR_IDS_)


[grammar] ~45-~45: Use correct spacing
Context: ...Project` - Grouping of environments and resources #### Job System - Uses Laravel Horizon for q...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~48-~48: There might be a mistake here.
Context: ...System - Uses Laravel Horizon for queue management - Key jobs: ApplicationDeploymentJob,...

(QB_NEW_EN_OTHER)


[grammar] ~49-~49: Use correct spacing
Context: ...- Key jobs: ApplicationDeploymentJob, ServerCheckJob, DatabaseBackupJob - ScheduledJobManager and ServerResourceManager handle job sche...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~50-~50: There might be a mistake here.
Context: ... and ServerResourceManager handle job scheduling #### Deployment Flow 1. Git webhook triggers...

(QB_NEW_EN_OTHER)


[grammar] ~53-~53: There might be a mistake here.
Context: ...Deployment Flow 1. Git webhook triggers deployment 2. ApplicationDeploymentJob handles build and deployment 3. Docker c...

(QB_NEW_EN_OTHER)


[grammar] ~54-~54: There might be a mistake here.
Context: ...icationDeploymentJob` handles build and deployment 3. Docker containers are managed on tar...

(QB_NEW_EN_OTHER)


[grammar] ~55-~55: There might be a mistake here.
Context: ...Docker containers are managed on target servers 4. Proxy configuration (Nginx/Traefik) ...

(QB_NEW_EN_OTHER)


[grammar] ~56-~56: There might be a mistake here.
Context: ... Proxy configuration (Nginx/Traefik) is updated #### Server Management - SSH-based server co...

(QB_NEW_EN_OTHER)


[grammar] ~59-~59: Use articles correctly
Context: ...gement - SSH-based server communication via ExecuteRemoteCommand trait - Docker i...

(QB_NEW_EN_OTHER_ERROR_IDS_11)


[grammar] ~62-~62: Use correct spacing
Context: ...on generation - Resource monitoring and cleanup ### Directory Structure - app/Actions/ - ...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~64-~64:
Context: ...e monitoring and cleanup ### Directory Structure - app/Actions/ - Domain-specific actions (Application, D...

(QB_NEW_EN_OTHER_ERROR_IDS_)


[grammar] ~66-~66: Use correct spacing
Context: ...n, Database, Server, etc.) - app/Jobs/ - Background queue jobs - app/Livewire/...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~66-~66:
Context: ... etc.) - app/Jobs/ - Background queue jobs - app/Livewire/ - Frontend components (full-stack with Li...

(QB_NEW_EN_OTHER_ERROR_IDS_)


[grammar] ~67-~67:
Context: ... - Frontend components (full-stack with Livewire) - app/Models/ - Eloquent models - bootstrap/helpers/ ...

(QB_NEW_EN_OTHER_ERROR_IDS_)


[grammar] ~68-~68:
Context: ...th Livewire) - app/Models/ - Eloquent models - bootstrap/helpers/ - Helper functions for various domains - ...

(QB_NEW_EN_OTHER_ERROR_IDS_)


[grammar] ~69-~69:
Context: ...elpers/- Helper functions for various domains -database/migrations/` - Database schema evolution ## Developme...

(QB_NEW_EN_OTHER_ERROR_IDS_)


[grammar] ~70-~70: Use correct spacing
Context: ...database/migrations/` - Database schema evolution ## Development Guidelines ### Code Organi...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~72-~72: Use correct spacing
Context: ...tabase schema evolution ## Development Guidelines ### Code Organization - Use Actions pattern...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~75-~75: Use articles correctly
Context: ...Guidelines ### Code Organization - Use Actions pattern for complex business logic - Li...

(QB_NEW_EN_OTHER_ERROR_IDS_11)


[grammar] ~75-~75: There might be a mistake here.
Context: ...se Actions pattern for complex business logic - Livewire components handle UI and use...

(QB_NEW_EN_OTHER)


[grammar] ~76-~76: There might be a mistake here.
Context: ... Livewire components handle UI and user interactions - Jobs handle asynchronous operations...

(QB_NEW_EN_OTHER)


[grammar] ~77-~77: There might be a mistake here.
Context: ...teractions - Jobs handle asynchronous operations - Traits provide shared functionality (...

(QB_NEW_EN_OTHER)


[grammar] ~78-~78: There might be a mistake here.
Context: ...its provide shared functionality (e.g., ExecuteRemoteCommand) ### Testing - Uses Pest for testing framewo...

(QB_NEW_EN_OTHER)


[grammar] ~81-~81: There might be a mistake here.
Context: ...) ### Testing - Uses Pest for testing framework - Tests located in tests/` directory ...

(QB_NEW_EN_OTHER)


[grammar] ~82-~82: There might be a mistake here.
Context: ...g framework - Tests located in tests/ directory ### Deployment and Docker - Applications ar...

(QB_NEW_EN_OTHER)


[grammar] ~85-~85: There might be a mistake here.
Context: ... Applications are deployed using Docker containers - Configuration generated dynamically b...

(QB_NEW_EN_OTHER)


[grammar] ~86-~86: Use modal and auxiliary verbs correctly
Context: ... are deployed using Docker containers - Configuration generated dynamically based on applicat...

(QB_NEW_EN_OTHER_ERROR_IDS_24)


[grammar] ~86-~86: There might be a mistake here.
Context: ...erated dynamically based on application settings - Supports multiple deployment targets ...

(QB_NEW_EN_OTHER)


[grammar] ~87-~87: Use a period to end declarative sentences
Context: ...s multiple deployment targets and proxy configurations

(QB_NEW_EN_OTHER_ERROR_IDS_25)

🪛 markdownlint-cli2 (0.17.2)

11-11: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


12-12: Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


15-15: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


16-16: Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


22-22: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


23-23: Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


29-29: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


30-30: Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


39-39: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


40-40: Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


47-47: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


48-48: Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


52-52: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


53-53: Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


58-58: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


59-59: Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


64-64: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


65-65: Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


74-74: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


75-75: Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


80-80: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


81-81: Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


84-84: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


85-85: Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


87-87: Files should end with a single newline character

(MD047, single-trailing-newline)

🤖 Prompt for AI Agents
In CLAUDE.md from lines 1 to 87, the markdown formatting lacks blank lines
around headings and lists, which can cause parsing errors in markdown
processors. To fix this, add a blank line before and after every heading and
list item block throughout the document to ensure proper separation and improve
readability. This will prevent parsing issues and make the markdown cleaner for
future use.

Comment on lines +23 to 201
({{ data_get($backup->server(), 'settings.server_timezone', 'Instance timezone') }})
<div @class([
'flex flex-col border-l-2 transition-colors p-4 cursor-pointer bg-white hover:bg-gray-100 dark:bg-coolgray-100 dark:hover:bg-coolgray-200 text-black dark:text-white',
'bg-gray-200 dark:bg-coolgray-200' =>
data_get($backup, 'id') === data_get($selectedBackup, 'id'),
'border-blue-500/50 border-dashed' =>
$backup->latest_log &&
data_get($backup->latest_log, 'status') === 'running',
'border-error' =>
$backup->latest_log &&
data_get($backup->latest_log, 'status') === 'failed',
'border-success' =>
$backup->latest_log &&
data_get($backup->latest_log, 'status') === 'success',
'border-gray-200 dark:border-coolgray-300' => !$backup->latest_log,
'border-coollabs' =>
data_get($backup, 'id') === data_get($selectedBackup, 'id'),
]) wire:click="setSelectedBackup('{{ data_get($backup, 'id') }}')">
@if ($backup->latest_log && data_get($backup->latest_log, 'status') === 'running')
<div class="absolute top-2 right-2">
<x-loading />
</div>
<div>Last backup: {{ data_get($backup->latest_log, 'status', 'No backup yet') }}</div>
@endif
<div class="flex items-center gap-2 mb-2">
@if ($backup->latest_log)
<span @class([
'px-3 py-1 rounded-md text-xs font-medium tracking-wide shadow-xs',
'bg-blue-100/80 text-blue-700 dark:bg-blue-500/20 dark:text-blue-300 dark:shadow-blue-900/5' =>
data_get($backup->latest_log, 'status') === 'running',
'bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-200 dark:shadow-red-900/5' =>
data_get($backup->latest_log, 'status') === 'failed',
'bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-200 dark:shadow-green-900/5' =>
data_get($backup->latest_log, 'status') === 'success',
])>
@php
$statusText = match (data_get($backup->latest_log, 'status')) {
'success' => 'Success',
'running' => 'In Progress',
'failed' => 'Failed',
default => ucfirst(data_get($backup->latest_log, 'status')),
};
@endphp
{{ $statusText }}
</span>
@else
<span
class="px-3 py-1 rounded-md text-xs font-medium tracking-wide shadow-xs bg-gray-100 text-gray-800 dark:bg-gray-900/30 dark:text-gray-200">
No executions yet
</span>
@endif
<h3 class="font-semibold">{{ $backup->frequency }} Backup</h3>
</div>
<div class="text-gray-600 dark:text-gray-400 text-sm">
@if ($backup->latest_log)
Started:
{{ formatDateInServerTimezone(data_get($backup->latest_log, 'created_at'), $backup->server()) }}
@if (data_get($backup->latest_log, 'status') !== 'running')
<br>Ended:
{{ formatDateInServerTimezone(data_get($backup->latest_log, 'finished_at'), $backup->server()) }}
<br>Duration:
{{ calculateDuration(data_get($backup->latest_log, 'created_at'), data_get($backup->latest_log, 'finished_at')) }}
<br>Finished
{{ \Carbon\Carbon::parse(data_get($backup->latest_log, 'finished_at'))->diffForHumans() }}
@endif
<br><br>Total Executions: {{ $backup->executions()->count() }}
@if ($backup->save_s3)
<br>S3 Storage: Enabled
@endif
@php
$successCount = $backup->executions()->where('status', 'success')->count();
$totalCount = $backup->executions()->count();
$successRate = $totalCount > 0 ? round(($successCount / $totalCount) * 100) : 0;
@endphp
@if ($totalCount > 0)
<br>Success Rate: <span @class([
'font-medium',
'text-green-600' => $successRate >= 80,
'text-yellow-600' => $successRate >= 50 && $successRate < 80,
'text-red-600' => $successRate < 50,
])>{{ $successRate }}%</span>
({{ $successCount }}/{{ $totalCount }})
@endif
@if (data_get($backup->latest_log, 'status') === 'success')
@php
$size = data_get($backup->latest_log, 'size', 0);
$sizeFormatted =
$size > 0 ? number_format($size / 1024 / 1024, 2) . ' MB' : 'Unknown';
@endphp
<br>Last Backup Size: {{ $sizeFormatted }}
@endif
@else
Last Run: Never
<br>Total Executions: 0
@if ($backup->save_s3)
<br>S3 Storage: Enabled
@endif
@endif
</div>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Hasta la vista, boring UI! But this code needs some DRY treatment.

These UI enhancements are more powerful than a plasma rifle in a 40-watt range! The dynamic status indicators and detailed metadata make monitoring backups easier than spotting a T-1000 in a steel mill.

However, I detect significant code duplication between the database backup display (lines 23-102) and the non-database backup display (lines 104-201). Like a Terminator avoiding redundant subroutines, we should extract this into a reusable Blade component.

Consider creating a reusable Blade component:

<!-- resources/views/components/backup-status-card.blade.php -->
@props(['backup', 'type' => 'database', 'parameters' => [], 'selectedBackup' => null])

<div @class([
    'flex flex-col border-l-2 transition-colors p-4 cursor-pointer bg-white hover:bg-gray-100 dark:bg-coolgray-100 dark:hover:bg-coolgray-200 text-black dark:text-white',
    // ... status-based border classes
])>
    <!-- Common status display logic -->
</div>

Then use it in both places:

<x-backup-status-card :backup="$backup" type="database" :parameters="$parameters" />
🤖 Prompt for AI Agents
In resources/views/livewire/project/database/scheduled-backups.blade.php between
lines 23 and 201, there is significant duplication of the UI code for displaying
database and non-database backups. To fix this, extract the repeated markup and
logic into a reusable Blade component, for example,
resources/views/components/backup-status-card.blade.php, that accepts props like
backup, type, parameters, and selectedBackup. Move all common status display
logic and styling into this component, then replace the duplicated sections in
the original file with calls to this new component, passing the appropriate
props. This will DRY up the code and make maintenance easier.

Comment on lines +75 to +100
public function generate_preview_fqdn()
{
if (is_null($this->fqdn) && $this->application->fqdn) {
if (str($this->application->fqdn)->contains(',')) {
$url = Url::fromString(str($this->application->fqdn)->explode(',')[0]);
$preview_fqdn = getFqdnWithoutPort(str($this->application->fqdn)->explode(',')[0]);
} else {
$url = Url::fromString($this->application->fqdn);
if ($this->fqdn) {
$preview_fqdn = getFqdnWithoutPort($this->fqdn);
}
}
$template = $this->application->preview_url_template;
$host = $url->getHost();
$schema = $url->getScheme();
$random = new Cuid2;
$preview_fqdn = str_replace('{{random}}', $random, $template);
$preview_fqdn = str_replace('{{domain}}', $host, $preview_fqdn);
$preview_fqdn = str_replace('{{pr_id}}', $this->pull_request_id, $preview_fqdn);
$preview_fqdn = "$schema://$preview_fqdn";
$this->fqdn = $preview_fqdn;
$this->save();
}

return $this;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

⚠️ Potential issue

Your method naming fate is sealed... in snake_case!

The logic looks good, but we need to follow Laravel conventions and use camelCase for method names. Also, there's a potential bug at line 84 where you check $this->fqdn inside a condition that already checks if it's null.

Apply this diff to fix the method naming and logic issue:

-public function generate_preview_fqdn()
+public function generatePreviewFqdn()
 {
     if (is_null($this->fqdn) && $this->application->fqdn) {
         if (str($this->application->fqdn)->contains(',')) {
             $url = Url::fromString(str($this->application->fqdn)->explode(',')[0]);
             $preview_fqdn = getFqdnWithoutPort(str($this->application->fqdn)->explode(',')[0]);
         } else {
             $url = Url::fromString($this->application->fqdn);
-            if ($this->fqdn) {
-                $preview_fqdn = getFqdnWithoutPort($this->fqdn);
-            }
+            $preview_fqdn = getFqdnWithoutPort($this->application->fqdn);
         }
         $template = $this->application->preview_url_template;
         $host = $url->getHost();
         $schema = $url->getScheme();
         $random = new Cuid2;
         $preview_fqdn = str_replace('{{random}}', $random, $template);
         $preview_fqdn = str_replace('{{domain}}', $host, $preview_fqdn);
         $preview_fqdn = str_replace('{{pr_id}}', $this->pull_request_id, $preview_fqdn);
         $preview_fqdn = "$schema://$preview_fqdn";
         $this->fqdn = $preview_fqdn;
         $this->save();
     }

     return $this;
 }

Also update all callers of this method to use the new camelCase name.

🧰 Tools
🪛 PHPMD (2.15.0)

75-100: The method generate_preview_fqdn is not named in camelCase. (Controversial Rules)

(CamelCaseMethodName)


79-79: Avoid using static access to class '\Spatie\Url\Url' in method 'generate_preview_fqdn'. (Clean Code Rules)

(StaticAccess)


80-80: The variable $preview_fqdn is not named in camelCase. (Controversial Rules)

(CamelCaseVariableName)


81-86: The method generate_preview_fqdn uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. (Clean Code Rules)

(ElseExpression)


82-82: Avoid using static access to class '\Spatie\Url\Url' in method 'generate_preview_fqdn'. (Clean Code Rules)

(StaticAccess)

🤖 Prompt for AI Agents
In app/Models/ApplicationPreview.php from lines 75 to 100, rename the method
generate_preview_fqdn to generatePreviewFqdn to follow Laravel camelCase
conventions. Additionally, fix the logic at line 84 by removing the redundant
check for $this->fqdn inside the else block since the outer condition already
ensures it is null. After renaming the method, update all calls to this method
throughout the codebase to use the new camelCase name.

Comment on lines +57 to +67
if ($frequency) {
$query->where(function ($q) use ($frequency) {
// Handle human-readable frequency strings
if (in_array($frequency, ['daily', 'hourly', 'weekly', 'monthly', 'yearly', 'every_minute'])) {
$q->where('frequency', $frequency);
} else {
// Handle cron expressions
$q->where('frequency', $frequency);
}
});
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Your frequency filtering logic needs termination... of redundancy!

The frequency filtering logic is duplicated and the else clause is redundant. Whether it's a predefined string or a cron expression, we're just doing a where clause on 'frequency'.

Apply this diff to simplify the frequency filtering in both methods:

 if ($frequency) {
-    $query->where(function ($q) use ($frequency) {
-        // Handle human-readable frequency strings
-        if (in_array($frequency, ['daily', 'hourly', 'weekly', 'monthly', 'yearly', 'every_minute'])) {
-            $q->where('frequency', $frequency);
-        } else {
-            // Handle cron expressions
-            $q->where('frequency', $frequency);
-        }
-    });
+    $query->where('frequency', $frequency);
 }

The same simplification applies to the runScheduledTasks method.

Also applies to: 148-158

🧰 Tools
🪛 PHPMD (2.15.0)

62-65: The method runScheduledBackups uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. (Clean Code Rules)

(ElseExpression)

🤖 Prompt for AI Agents
In app/Console/Commands/RunScheduledJobsManually.php around lines 57 to 67 and
148 to 158, the frequency filtering logic is redundant because both the if and
else branches perform the same where clause on 'frequency'. Simplify the code by
removing the conditional check and directly applying the where clause with the
frequency value. This will clean up the code without changing its behavior.

Comment on lines +244 to +254
private function shouldRunNow(string $frequency, string $timezone): bool
{
$cron = new CronExpression($frequency);

// Use the frozen execution time, not the current time
// Fallback to current time if execution time is not set (shouldn't happen)
$baseTime = $this->executionTime ?? Carbon::now();
$executionTime = $baseTime->copy()->setTimezone($timezone);

return $cron->isDue($executionTime);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Come with me if you want your cron expressions to live!

The shouldRunNow method correctly uses the frozen execution time and respects server timezones. This is crucial for distributed systems where servers might be in different timezones - something serverless functions would completely mess up.

Would you like me to add unit tests for this critical scheduling logic to ensure it handles edge cases like DST transitions?

🤖 Prompt for AI Agents
In app/Jobs/ScheduledJobManager.php around lines 244 to 254, the shouldRunNow
method correctly uses a frozen execution time and respects the provided timezone
for cron evaluation. No code changes are needed here as the logic is sound.
However, to ensure robustness, add unit tests that cover various scenarios
including different timezones and edge cases like daylight saving time
transitions to verify the scheduling logic behaves as expected.

@krzkz94
Copy link

krzkz94 commented Jul 15, 2025

Since there are some improvements to preview deployments, #6170 could be relevant as well

Fixes one of the biggest gripes when finding named docker-compose services (ex, you have a service named db, how can you link to it when recreating it in a preview environment?, would be db-pr-<pr_id>, but we don't have access to pr_id as a magic variable, only branch name)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐰 Release The Rabbit Run CodeRabbitAI review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: domains dissappeared, preview deployments broke
2 participants