Problem: Beim Hinzufügen zu einem Backup Set kann ein lokaler “Reuse” dazu führen, dass ein Backup nicht den aktuellen Intune-Stand reflektiert, wenn last_synced_at nicht frisch ist. Lösung: BackupService führt beim Add immer orchestrated capture aus (Graph Fetch), damit “Backup = current state” gilt. Trotzdem kein unnötiges Version-Wachstum: PolicyCaptureOrchestrator re-used bestehende PolicyVersions via Snapshot-Hash, wenn sich nichts geändert hat. Tests: Added BackupServiceVersionReuseTest.php Specs: Updated spec.md + plan.md + tasks checked off. Co-authored-by: Ahmed Darrazi <ahmeddarrazi@adsmac.local> Reviewed-on: #22
783 B
783 B
Plan: Backup Version Reuse (016)
Branch: 016-backup-version-reuse
Date: 2026-01-02
Input: spec.md
Goal
Reduce unnecessary PolicyVersion creation when policies are added to backup sets by reusing an existing suitable latest version where safe.
Approach
- Always capture from Intune when a policy is added to a backup set (admin expectation: "backup = current state").
- Rely on
PolicyCaptureOrchestratorsnapshot-hash reuse to avoid redundantPolicyVersioncreation when nothing changed. - Still respect capture options (assignments / scope tags) via orchestrator backfill behavior.
- Add tests for both reuse and capture paths.
Out of scope
- UI toggles/config flags unless required.
- Cross-policy dedup or historical compaction.