[Feat] Resume Site Creation#1092
Open
RichardAnderson wants to merge 8 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a "resume / retry" capability for failed site installations. Sites can now be retried (web + API), the install pipeline records a named progress step and a UI-safe last_error, and the install steps (user creation, repo clone, FPM pool) are made idempotent so retries skip already-completed work. Job onQueue('ssh') calls are moved into the constructors of CreateJob, DeployJob, ExecuteCommandJob, and RollbackJob.
Changes:
- New
RetrySiteaction plus web/API routes, OpenAPI docs, banner UI with confirmation dialog, and a feature test. Sitegainsprogress_stepandlast_errorcolumns;AbstractSiteType::progress()accepts a step label;CreateJobrecords a sanitized error summary on failure and resets fields on success.AbstractSiteTypegetsuserExists/repositoryAlreadyCloned/fpmPoolExistsguards (with new Blade probe scripts); nginx/caddy vhost symlinks switch toln -sfnandcreate-pathdropsrm -rfformkdir -p.
Reviewed changes
Copilot reviewed 36 out of 37 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| app/Actions/Site/RetrySite.php | New action validating state and dispatching CreateJob. |
| app/Actions/Site/{CreateSite,Deploy,ExecuteCommand,Rollback}.php | Drop ->onQueue('ssh') (now in job constructors). |
| app/Http/Controllers/SiteController.php | Adds web sites.retry route. |
| app/Http/Controllers/API/SiteController.php | Adds API retry endpoint. |
| app/Http/Resources/SiteResource.php | Exposes progress_step and last_error. |
| app/Jobs/Site/CreateJob.php | Sets queue in constructor, resets/sets progress fields, adds safeErrorSummary. |
| app/Jobs/Site/{DeployJob,ExecuteCommandJob,RollbackJob}.php | Set queue in constructor. |
| app/Models/Site.php | New progress_step / last_error properties + fillable. |
| app/SiteTypes/AbstractSiteType.php | New idempotency helpers and progress($percent, $step) signature. |
| app/SiteTypes/{Wordpress,PHPSite,PHPMyAdmin,PHPBlank,NodeJS,MiseNodeJS,MiseBun,LoadBalancer}.php | Adopt step labels and cloneRepository(). |
| database/migrations/2026_05_16_155350_add_progress_step_and_last_error_to_sites_table.php | Schema migration for new columns. |
| public/api-docs/openapi/{sites.yaml,schemas/Site.yaml} | Documents retry endpoint and new fields. |
| resources/js/components/site-banners.tsx | Adds failed-install banner with retry dialog. |
| resources/js/pages/servers/components/header.tsx | Shows current install step inline and in tooltip. |
| resources/js/lib/utils.ts | New humanizeStep helper. |
| resources/js/types/site.d.ts | Adds typing for new fields. |
| resources/views/ssh/services/webserver/{nginx,caddy}/create-vhost.blade.php | Use ln -sfn with escapeshellarg. |
| resources/views/ssh/services/webserver/{nginx,caddy}/create-path.blade.php | Replace rm -rf + mkdir with mkdir -p. |
| resources/views/ssh/site/check-*.blade.php | New SSH probes for user / repo / FPM pool. |
| tests/Feature/RetrySiteTest.php | Coverage for retry flow, validation, and failure handling. |
Member
Author
|
Still draft, needs more testing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a robust retry mechanism for site installations, improves error handling and reporting for installation failures, and refines the behavior of several background jobs. It also enhances the tracking of installation progress and error details on the
Sitemodel, and adds various safety checks to the site setup process.Retry Mechanism & API Enhancements:
RetrySiteaction, allowing sites in aninstallation_failedstate to be retried. This is exposed via new API and web routes, with appropriate authorization and validation.Error Handling & Progress Tracking:
Sitemodel and resource to includeprogress_stepandlast_errorfields, enabling more detailed progress tracking and user-friendly error summaries. These fields are set and updated throughout the installation process and surfaced in API responses.CreateJobby setting a UI-safe error summary on failure, avoiding leaking sensitive or verbose exception messages, and resetting progress fields on success.Job Dispatching Consistency:
onQueue('ssh')from dispatch calls to the constructors ofCreateJob,DeployJob,ExecuteCommandJob, andRollbackJob, simplifying job dispatching throughout the codebase.Site Installation Safety & Idempotency:
AbstractSiteTypeto add idempotent checks for user creation, repository cloning, and FPM pool setup, reducing the risk of errors on retries or partial installations. Added helper methods to check for existing users, cloned repositories, and FPM pools.These changes collectively improve the reliability and user experience of site installations, especially in failure and retry scenarios.