Pull Request Opened
PR #49 opened: refactor: remove CoolifyResource model, derive app UUID from API
Summary
- BREAKING CHANGE: Removes database storage for Coolify resource info
- Application UUIDs are now derived from the Coolify API by matching the current git repository
- Only
COOLIFY_PROJECT_UUIDis stored in.env, everything else is fetched from API
Changes
- Remove
CoolifyResourcemodel and migration - Add
Coolify::getApplicationUuid()that fetches apps from API and matches by git repo - Add
Coolify::getCurrentGitRepository()helper - Update
ProvisionCommandto writeCOOLIFY_PROJECT_UUIDto.envinstead of database - Update all commands (
DeployCommand,LogsCommand,StatusCommand,RestartCommand,RollbackCommand) to useCoolify::getApplicationUuid() - Update
DashboardStatsControllerto derive app info from API - Simplify
EnvironmentController(multi-environment support removed) - Update all tests for new architecture
Why
The previous approach of storing Coolify details in a local database was flawed because:
- Running
migrate:fresh --seedwould wipe the Coolify configuration - The data was redundant - it can all be derived from the Coolify API
- Simpler architecture: just store the project UUID in
.envand fetch everything else
Test plan
- All 230 tests pass
- Lint passes
+358
additions
-463
deletions
29
files changed