Skip to content

Conversation

@insertish
Copy link
Member

@insertish insertish commented Feb 5, 2026

Description

This PR moves the implementations in the database backup utility file into the (existing) DatabaseBackupService. This service no longer extends from BaseService so it can be used in both maintenance and non-maintenance workers.

The DI for the service optionally pulls in the cron, job, and maintenance health repositories depending on what is available, hence allowing it to work in both contexts.

⚠️ One service to service dependency has been added, MaintenanceWorkerService <- DatabaseBackupService.

How Has This Been Tested?

Existing tests have been moved from maintenance-worker.service.spec.ts & backup.service.spec.ts into database-backup.service.spec.ts.

Additional tests have been written for:

  • Generated arguments for pg CLI, incl. in non-standard configurations.
  • Generated SQL & psql input, incl. in non-standard configurations.

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if applicable
  • I have no unrelated changes in the PR.
  • I have confirmed that any new dependencies are strictly necessary.
  • I have written tests for new code (if applicable)
  • I have followed naming conventions/patterns in the surrounding code
  • All code in src/services/ uses repositories implementations for database calls, filesystem operations, etc.
  • All code in src/repositories/ is pretty basic/simple and does not have any immich specific logic (that belongs in src/services/)

Please describe to which degree, if any, an LLM was used in creating this pull request.

No LLM use.

… name is not mangled

fixes #25633

Signed-off-by: izzy <me@insrt.uk>
Signed-off-by: izzy <me@insrt.uk>
…ible

chore: late fallback for username in parameter builder

Signed-off-by: izzy <me@insrt.uk>
Signed-off-by: izzy <me@insrt.uk>
Signed-off-by: izzy <me@insrt.uk>
@insertish insertish changed the base branch from main to fix/database-backup-db-names February 5, 2026 10:15
@insertish insertish moved this to In Progress in Yucca Feb 5, 2026
@insertish insertish added this to Yucca Feb 5, 2026
Base automatically changed from fix/database-backup-db-names to main February 5, 2026 18:59
@insertish insertish marked this pull request as ready for review February 6, 2026 13:34
@jrasm91 jrasm91 merged commit caeba50 into main Feb 10, 2026
57 checks passed
@jrasm91 jrasm91 deleted the refactor/database-backup-repository branch February 10, 2026 17:12
@github-project-automation github-project-automation bot moved this from In Progress to Done in Yucca Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants