TenantAtlas/specs/010-admin-templates/tasks.md
ahmido 61b0b1bc23 feat(010): Administrative Templates – restore from PolicyVersion + version visibility (#13)
Problem: Restore nutzt bisher den Snapshot aus dem BackupSet (BackupItem). Wenn der Snapshot “unvollständig”/nicht der gewünschte Stand ist, landen nach Restore nur wenige Admin-Template-Settings in Intune.
Lösung:
Neue Action “Restore to Intune” direkt an einer konkreten PolicyVersion (inkl. Dry-Run Toggle) → reproduzierbarer Rollback auf exakt diese Version.
Restore-UI zeigt jetzt PolicyVersion-Nummer (version: X) in der Item-Auswahl + BackupSet Items Tabelle hat eine Version-Spalte.
Implementierung:
RestoreService::executeFromPolicyVersion() erzeugt dafür einen kleinen, temporären BackupSet+BackupItem aus der Version und startet einen normalen RestoreRun.
Pest-Test: PolicyVersionRestoreToIntuneTest.php
Specs/TODO:
Offene Follow-ups sind dokumentiert in tasks.md unter “Open TODOs (Follow-up)”.
QA (GUI):
Inventory → Policies → <Policy> → Versions → Restore to Intune (erst Dry-Run, dann Execute)
Backups & Restore → Restore Runs → Create (bei Items steht version: X)
Backups & Restore → Backup Sets → <Set> (Version-Spalte)
Tests: PolicyVersionRestoreToIntuneTest.php

Co-authored-by: Ahmed Darrazi <ahmeddarrazi@adsmac.local>
Reviewed-on: #13
2025-12-30 01:50:05 +00:00

1.8 KiB

Tasks: Administrative Templates (Group Policy Configurations) (010)

Branch: feat/010-admin-templates | Date: 2025-12-29
Input: spec.md, plan.md

Phase 1: Contracts + Snapshot Hydration

  • T001 Extend config/graph_contracts.php for groupPolicyConfiguration (hydration/subresources metadata).
  • T002 Hydrate definitionValues (+ presentationValues) in app/Services/Intune/PolicySnapshotService.php.

Phase 2: Restore (Definition Values)

  • T003 Implement restore apply for definitionValues and presentationValues in app/Services/Intune/RestoreService.php.

Phase 3: UI Normalization

  • T004 Add GroupPolicyConfigurationNormalizer and register it (Policy “Normalized settings” is readable).
  • T009 Make Normalized diff labels readable for groupPolicyConfiguration and settingsCatalogPolicy.
  • T010 Ensure restore-created versions keep assignments + show scope tags independently.
  • T012 Add “Restore to Intune” from a specific PolicyVersion (rollback) + show policy version numbers in restore selection UI.

Phase 4: Tests + Verification

  • T005 Add tests for hydration + UI display.
  • T006 Add tests for restore definitionValues apply.
  • T007 Run tests (targeted).
  • T008 Run Pint (./vendor/bin/pint --dirty).
  • T011 Fix Admin Templates hydration paging (@odata.nextLink) and add coverage.

Open TODOs (Follow-up)

  • Improve Admin Templates value formatting to better match Intune UI (presentation values / multi-value rendering).
  • Add a small “snapshot completeness” indicator (e.g., definitionValues count) to reduce confusion when older/incomplete snapshots exist.
  • Implement remaining Windows “Templates” profile types (separate policy types/odata subtypes; new specs per type).