fix: enable database detection and backup support for Docker Compose GitHub App deployments#8483
Closed
hussain-alsaibai wants to merge 1 commit intocoollabsio:v4.xfrom
Closed
Conversation
Contributor
|
This PR did not pass quality checks so it will be closed. If you believe this is a mistake please let us know. |
Author
|
Hi maintainers 👋 This PR was auto-closed by the quality gate, but I believe the code is solid and worth a manual review. The fix is targeted and minimal:
The account Happy to adjust the approach based on your feedback. Thanks! |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
Fixes #7528
Database services in Docker Compose files deployed via GitHub App (dockercompose buildpack) are now detected and backed up, matching the behavior of Empty Docker Compose and one-click service deployments.
Root Cause
parseDockerComposeFile()inbootstrap/helpers/shared.phphas two paths:isDatabaseImage(), createsServiceDatabaserecords ✅isDatabaseImage(), no backup support ❌Changes
New Files
app/Models/ApplicationDatabase.php— mirrors ServiceDatabase, supports scheduled backups via polymorphic relationshipapp/Policies/ApplicationDatabasePolicy.php— team-based authorizationdatabase/migrations/2025_02_19_000001_create_application_databases_table.phpdatabase/migrations/2025_02_19_000002_add_image_to_application_databases.phpModified Files
bootstrap/helpers/shared.php— addedisDatabaseImage()detection in Application path, createsApplicationDatabaserecords viafirstOrCreate()app/Models/Application.php— addeddatabases()hasMany relationshipapp/Models/ScheduledDatabaseBackup.php— updatedserver()to handle ApplicationDatabase morphapp/Providers/AuthServiceProvider.php— registered new policyResult
Backup scheduling reuses existing
ScheduledDatabaseBackupinfrastructure via polymorphic relationship — no new backup UI needed.