Skip to content

fix: ensure prod database backup runs and can be disabled#33

Merged
konradmichalik merged 1 commit into
mainfrom
fix/prod-database-backup
Jun 23, 2026
Merged

fix: ensure prod database backup runs and can be disabled#33
konradmichalik merged 1 commit into
mainfrom
fix/prod-database-backup

Conversation

@konradmichalik

@konradmichalik konradmichalik commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix the production database:backup task silently failing (or never running) on Symfony/TYPO3 deployments
  • Make db_sync_tool available wherever the backup task runs, and honor disabling it
  • Point the backup config at the project root instead of the vendor directory

Root cause

The database:backup task is wired into prod deploys by the Symfony/TYPO3 presets, but the variables it relies on were defined only in the feature-deployment config group, which those presets never load. Combined with a missing disable-guard and a vendor-relative config path, the task could not locate its config and could not be turned off.

Changes

  • deployer/sync/config/set.php — define db_sync_tool default in the sync config group, the file that belongs to the database:backup task, so it is defined on every deploy that can run the task
  • deployer/sync/task/database_backup.php — add the db_sync_tool === false disable guard (mirroring feature:sync) so backups can be turned off; correct the fallback debug message
  • deployer/symfony/config/set.php — resolve sync_database_backup_config project-relative (./.deployment/...) instead of __DIR__, which pointed into vendor/ and never existed
  • deployer/typo3/task/deploy_database.php — same project-relative path fix

Test plan

  • Run a prod deploy with a valid ./.deployment/db-sync-tool/backup-prod.yaml and confirm the backup is generated
  • Set db_sync_tool to false and confirm the backup step is skipped without error

Summary by CodeRabbit

Release Notes

Chores

  • Updated database backup configuration file paths from absolute to relative paths across all deployment environments for better portability and flexibility
  • Introduced new configuration option that allows database backups to be selectively enabled or disabled based on specific deployment needs
  • Enhanced the database backup task to automatically check and respect the new configuration setting before executing backups
  • Improved overall consistency in how database backup configurations are handled across different deployment scenarios

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f8cf767f-5212-4368-8f31-ebd356f82529

📥 Commits

Reviewing files that changed from the base of the PR and between a3ff89c and 15c488b.

📒 Files selected for processing (4)
  • deployer/symfony/config/set.php
  • deployer/sync/config/set.php
  • deployer/sync/task/database_backup.php
  • deployer/typo3/task/deploy_database.php

📝 Walkthrough

Walkthrough

The database:backup Deployer task gains an early-return guard controlled by a new db_sync_tool config flag: when the flag is false, the task logs a skip message and exits. The "tool unavailable" debug message is updated to say "database backup." Separately, sync_database_backup_config is changed from an absolute __DIR__-based path to a relative ./ path in both the symfony and typo3 config files.

Changes

Database backup skip guard and path normalization

Layer / File(s) Summary
db_sync_tool config flag and backup skip guard
deployer/sync/config/set.php, deployer/sync/task/database_backup.php
Adds a db_sync_tool config entry and an early-return guard in database:backup that skips execution when the flag is false; also fixes the "tool unavailable" debug message to say "database backup" instead of "database sync".
sync_database_backup_config path changed to relative
deployer/symfony/config/set.php, deployer/typo3/task/deploy_database.php
Replaces __DIR__ . '/.deployment/db-sync-tool/backup-prod.yaml' with './.deployment/db-sync-tool/backup-prod.yaml' in both framework config files.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~4 minutes

Poem

🐇 Hop hop, the backup now may skip,
With a flag that gives the task the slip.
No more __DIR__ in the path — just ./ it goes,
A relative hop wherever the deployer flows.
Small changes, tidy paws — the rabbit approves! 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main changes: fixing production database backup execution and adding the ability to disable it.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/prod-database-backup

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 PHPStan (2.2.2)

PHPStan was skipped because the config uses disallowed bootstrapFiles, bootstrapFile, or includes directives.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@konradmichalik konradmichalik merged commit 0b0685e into main Jun 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant