v0.13.0 — Report tool : timestamped backups + manual revert
The previous deploy mechanism kept the old version under {target}.old
just long enough to swap, then deleted it — no way back if the new
report had a runtime bug only visible at use time.
Now each deploy keeps the previous active version under
{FolderName}.backup-yyyyMMdd-HHmmss/. The N most recent are kept
(MaxBackups, default 3) and older ones are pruned in best-effort.
UI in Settings → Avancés → Outil Report :
- "Conserver N backups" input (0 = no history, back to v0.12 behavior)
- List of backups with date + size + cryptic folder name + per-row "↶ Revert"
- Confirmation dialog: "Revert to {date}? The currently deployed
version will itself be saved as a new backup, so you can switch back."
Implementation
- IReportToolDeployer: + ListBackupsAsync, + RevertAsync, + BackupInfo,
+ DeployStatus.BackupNotFound.
- ReportToolDeployer: deploy renames {target} → backup-{ts}; PruneOldBackups
trims to MaxBackups; RevertAsync atomically swaps current ↔ chosen
backup, the previous current becoming itself a fresh backup.
- ReportBackupViewModel + DataTemplate for the list rows.
- Strings: backup labels, "↶ Revert", confirmation message.
Caveats documented in the design discussion:
- Backups cover ONLY the report tool files. DB migrations are not reverted
(irreversible). If a migration broke the schema, that's a separate fix.
- No HTTP-HEAD post-deploy auto-revert: too fragile for false positives.
Revert stays a deliberate manual action.
Versions bumped to 0.13.0.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -107,6 +107,15 @@ public sealed class ReportToolConfig
|
||||
public string HtdocsRoot { get; set; } = @"C:\xampp\htdocs";
|
||||
public string FolderName { get; set; } = "ProserveReport";
|
||||
public bool AutoDeploy { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Nombre de backups horodatés à conserver dans htdocs après chaque deploy.
|
||||
/// Format des dossiers : <c>{FolderName}.backup-yyyyMMdd-HHmmss</c>.
|
||||
/// Permet le revert via Settings si le nouveau deploy a un bug visible.
|
||||
/// 3 par défaut = couvre les dernières releases sans grossir trop le disque.
|
||||
/// 0 = pas de backup (retourne au comportement v0.12.0).
|
||||
/// </summary>
|
||||
public int MaxBackups { get; set; } = 3;
|
||||
}
|
||||
|
||||
public sealed class LicenseConfig
|
||||
|
||||
Reference in New Issue
Block a user