Enforce per-profile retention and repair Purge Old Backups button #203

Merged
jmiller merged 1 commits from fix/backup-retention-purge into main 2026-07-04 20:26:21 +00:00
Owner

Summary

Two related backup-management fixes.

Retention ("records / days to keep")

  • The retention fieldset was defined in profile.xml but never rendered in the profile editor, so retention_days/retention_count were invisible. Now rendered on the Archive tab.
  • Those columns were read by nothing, so no backup was ever pruned. Added RetentionManager::prune(), called from completeRecord() in both BackupEngine and SteppedBackupEngine after a backup finishes.
    • Policy: delete a complete/warning backup when either it is older than retention_days or it falls outside the newest retention_count copies. 0 = unlimited for that rule. Deleting a record also removes its archive + log file.
  • Corrected misleading language/schema text ("use global default" — no such global backup-retention setting exists) to "0 = unlimited".

Purge Old Backups button

  • The modal only opened via a fragile selector match on the toolbar button's inline onclick, which Joomla 6's Atum toolbar does not render — so the button did nothing. Now wraps Joomla.submitbutton to open the modal for the backups.purgeModal task, keeping the selector as a fallback.

Test plan

  • Profile editor → Archive tab shows "Keep Backups (days)" and "(count)".
  • Set count=2, run 3 backups → oldest pruned (archive + log removed).
  • Set days=1 → backups older than 1 day pruned on next run.
  • Purge Old Backups toolbar button opens the modal; purge deletes as expected.
## Summary Two related backup-management fixes. ### Retention ("records / days to keep") - The `retention` fieldset was defined in `profile.xml` but **never rendered** in the profile editor, so `retention_days`/`retention_count` were invisible. Now rendered on the **Archive** tab. - Those columns were **read by nothing**, so no backup was ever pruned. Added `RetentionManager::prune()`, called from `completeRecord()` in both `BackupEngine` and `SteppedBackupEngine` after a backup finishes. - Policy: delete a `complete`/`warning` backup when **either** it is older than `retention_days` **or** it falls outside the newest `retention_count` copies. `0` = unlimited for that rule. Deleting a record also removes its archive + log file. - Corrected misleading language/schema text ("use global default" — no such global backup-retention setting exists) to "0 = unlimited". ### Purge Old Backups button - The modal only opened via a fragile selector match on the toolbar button's inline `onclick`, which Joomla 6's Atum toolbar does not render — so the button did nothing. Now wraps `Joomla.submitbutton` to open the modal for the `backups.purgeModal` task, keeping the selector as a fallback. ## Test plan - [ ] Profile editor → Archive tab shows "Keep Backups (days)" and "(count)". - [ ] Set count=2, run 3 backups → oldest pruned (archive + log removed). - [ ] Set days=1 → backups older than 1 day pruned on next run. - [ ] Purge Old Backups toolbar button opens the modal; purge deletes as expected.
jmiller added 1 commit 2026-07-04 20:26:01 +00:00
fix: enforce per-profile retention and repair Purge Old Backups button
Universal: PR Check / Branch Policy (pull_request) Failing after 2s
Joomla: Extension CI / Release Readiness Check (pull_request) Failing after 5s
Generic: Project CI / Lint & Validate (pull_request) Successful in 12s
Universal: PR Check / Secret Scan (pull_request) Successful in 6s
Universal: PR Check / Validate PR (pull_request) Failing after 4s
Generic: Repo Health / Site Health (pull_request) Has been skipped
Generic: Repo Health / Access control (pull_request) Successful in 2s
RC Revert / Rename rc/ back to dev/ (pull_request) Has been skipped
Branch Cleanup / Delete merged branch (pull_request) Successful in 2s
Joomla: Metadata Validation / Validate Joomla Metadata (pull_request) Successful in 9s
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 27s
Joomla: Extension CI / Lint & Validate (pull_request) Failing after 39s
Universal: Build & Release / Promote to RC (pull_request) Has been skipped
Universal: Build & Release / Build & Release Pipeline (pull_request) Successful in 30s
Universal: Workflow Sync Trigger / Sync workflows to live repos (pull_request) Successful in 4m0s
Generic: Project CI / Tests (pull_request) Has been cancelled
Joomla: Extension CI / Tests (PHP 8.2) (pull_request) Has been cancelled
Joomla: Extension CI / Tests (PHP 8.3) (pull_request) Has been cancelled
Joomla: Extension CI / PHPStan Analysis (pull_request) Has been cancelled
Joomla: Extension CI / Build RC Pre-Release (pull_request) Has been cancelled
Universal: PR Check / Build RC Package (pull_request) Has been cancelled
Universal: PR Check / Report Issues (pull_request) Has been cancelled
Generic: Repo Health / Scripts governance (pull_request) Has been cancelled
Generic: Repo Health / Repository health (pull_request) Has been cancelled
Generic: Repo Health / Report: Scripts Governance (pull_request) Has been cancelled
Generic: Repo Health / Report: Repository Health (pull_request) Has been cancelled
10248b284a
Two related backup-management fixes.

Retention (records/days to keep):
- The retention fieldset was defined in profile.xml but never rendered
  in the profile editor, so retention_days/retention_count were invisible.
  Render the retention fieldset on the Archive tab.
- retention_days/retention_count were read by nothing, so they pruned no
  backups. Add RetentionManager::prune(), called from completeRecord() in
  both BackupEngine and SteppedBackupEngine after a backup finishes.
  Policy: delete a completed/warning backup when EITHER it is older than
  retention_days OR it falls outside the newest retention_count copies
  (0 = unlimited for that rule). Deleting a record also removes its
  archive and log file.
- Correct misleading language/schema text ("use global default" — no such
  global backup-retention setting exists) to "0 = unlimited".

Purge Old Backups button:
- The modal only opened via a fragile selector match on the toolbar
  button's inline onclick, which Joomla 6's Atum toolbar does not render,
  so the button did nothing. Wrap Joomla.submitbutton to open the modal
  for the backups.purgeModal task, keeping the selector as a fallback.
jmiller force-pushed fix/backup-retention-purge from 3bacf83d75 to 10248b284a 2026-07-04 20:26:01 +00:00 Compare
jmiller merged commit 2de2c5f917 into main 2026-07-04 20:26:21 +00:00
jmiller deleted branch fix/backup-retention-purge 2026-07-04 20:26:22 +00:00
Sign in to join this conversation.