Compare commits

...

26 Commits

Author SHA1 Message Date
Ahmed Darrazi
28c3f81521 merge: resolve dev conflicts 2026-01-07 02:36:42 +01:00
Ahmed Darrazi
af67de0f61 merge: sync dev into feat/011-restore-run-wizard 2026-01-07 02:36:32 +01:00
Ahmed Darrazi
818219382f merge: agent session work 2026-01-07 02:28:41 +01:00
Ahmed Darrazi
28b120c579 fix(graph): accept derived odata types 2026-01-07 02:28:39 +01:00
Ahmed Darrazi
3e7e699e00 docs(spec): Add spec for 012-windows-update-rings 2025-12-31 21:01:29 +01:00
Ahmed Darrazi
0e6d80c671 Merge branch 'feat/011-restore-run-wizard-session-1767185846' into feat/011-restore-run-wizard 2025-12-31 20:14:07 +01:00
e19aa09ae0 feat(wizard): Add restore from policy version (#15)
Implements the "Restore via Wizard" action on the PolicyVersion resource.

This allows a user to initiate a restore run directly from a specific policy version snapshot.

- Adds a "Restore via Wizard" action to the PolicyVersion table.
- This action creates a single-item BackupSet from the selected version.
- The CreateRestoreRun wizard is now pre-filled from query parameters.
- Adds feature tests to cover the new workflow.
- Updates tasks.md to reflect the completed work.

## Summary
<!-- Kurz: Was ändert sich und warum? -->

## Spec-Driven Development (SDD)
- [ ] Es gibt eine Spec unter `specs/<NNN>-<feature>/`
- [ ] Enthaltene Dateien: `plan.md`, `tasks.md`, `spec.md`
- [ ] Spec beschreibt Verhalten/Acceptance Criteria (nicht nur Implementation)
- [ ] Wenn sich Anforderungen während der Umsetzung geändert haben: Spec/Plan/Tasks wurden aktualisiert

## Implementation
- [ ] Implementierung entspricht der Spec
- [ ] Edge cases / Fehlerfälle berücksichtigt
- [ ] Keine unbeabsichtigten Änderungen außerhalb des Scopes

## Tests
- [ ] Tests ergänzt/aktualisiert (Pest/PHPUnit)
- [ ] Relevante Tests lokal ausgeführt (`./vendor/bin/sail artisan test` oder `php artisan test`)

## Migration / Config / Ops (falls relevant)
- [ ] Migration(en) enthalten und getestet
- [ ] Rollback bedacht (rückwärts kompatibel, sichere Migration)
- [ ] Neue Env Vars dokumentiert (`.env.example` / Doku)
- [ ] Queue/cron/storage Auswirkungen geprüft

## UI (Filament/Livewire) (falls relevant)
- [ ] UI-Flows geprüft
- [ ] Screenshots/Notizen hinzugefügt

## Notes
<!-- Links, Screenshots, Follow-ups, offene Punkte -->

Co-authored-by: Ahmed Darrazi <ahmeddarrazi@adsmac.local>
Reviewed-on: #15
2025-12-31 19:02:28 +00:00
Ahmed Darrazi
e1cda6a1dc merge: agent session work 2025-12-31 13:28:01 +01:00
Ahmed Darrazi
44b4a6adf0 fix: prime group mapping state 2025-12-31 13:27:50 +01:00
Ahmed Darrazi
711e012827 merge: agent session work 2025-12-31 11:53:30 +01:00
Ahmed Darrazi
9e3c2b3011 fix: accept object group mapping in checks 2025-12-31 11:53:03 +01:00
Ahmed Darrazi
948af56185 merge: agent session work 2025-12-31 01:51:03 +01:00
Ahmed Darrazi
26755df017 feat: add confirm & queued execute to restore wizard 2025-12-31 01:50:33 +01:00
Ahmed Darrazi
4c9544e9b7 merge: agent session work 2025-12-30 23:38:56 +01:00
Ahmed Darrazi
5e16c25fca fix: show check/preview actions 2025-12-30 23:38:05 +01:00
Ahmed Darrazi
a43fef535b merge: agent session work 2025-12-30 22:06:11 +01:00
Ahmed Darrazi
a58db008f8 feat: add preview diff step 2025-12-30 22:05:57 +01:00
Ahmed Darrazi
cd76fa5dd7 merge: agent session work 2025-12-30 21:50:05 +01:00
Ahmed Darrazi
f32fdfb1e4 feat: add restore risk checks 2025-12-30 21:49:38 +01:00
Ahmed Darrazi
8ba2aae82e merge: agent session work 2025-12-30 21:29:59 +01:00
Ahmed Darrazi
2b9b649549 feat: group restore item selection 2025-12-30 21:29:41 +01:00
Ahmed Darrazi
7e4c9bb610 merge: agent session work 2025-12-30 10:44:25 +01:00
Ahmed Darrazi
e7d21e0eb8 feat: gate restore wizard to dry-run 2025-12-30 10:44:18 +01:00
Ahmed Darrazi
0795d31abe merge: agent session work 2025-12-30 03:24:00 +01:00
Ahmed Darrazi
3cf4aa2cf4 feat: restore run wizard phase 1 scaffold 2025-12-30 03:23:48 +01:00
Ahmed Darrazi
6844bc1c17 spec: restore run wizard 2025-12-30 02:56:28 +01:00
4 changed files with 52 additions and 1 deletions

View File

@ -19,6 +19,8 @@
'type_family' => [
'#microsoft.graph.deviceConfiguration',
'#microsoft.graph.windows10CustomConfiguration',
'#microsoft.graph.windows10GeneralConfiguration',
'#microsoft.graph.windowsHealthMonitoringConfiguration',
'#microsoft.graph.iosGeneralDeviceConfiguration',
'#microsoft.graph.androidGeneralDeviceConfiguration',
'#microsoft.graph.macOSGeneralDeviceConfiguration',
@ -344,6 +346,8 @@
'#microsoft.graph.windows10CompliancePolicy',
'#microsoft.graph.iosCompliancePolicy',
'#microsoft.graph.androidCompliancePolicy',
'#microsoft.graph.androidDeviceOwnerCompliancePolicy',
'#microsoft.graph.androidWorkProfileCompliancePolicy',
'#microsoft.graph.macOSCompliancePolicy',
],
'create_method' => 'POST',
@ -369,6 +373,7 @@
'#microsoft.graph.targetedManagedAppProtection',
'#microsoft.graph.iosManagedAppProtection',
'#microsoft.graph.androidManagedAppProtection',
'#microsoft.graph.windowsManagedAppProtection',
'#microsoft.graph.windowsInformationProtectionPolicy',
'#microsoft.graph.mdmWindowsInformationProtectionPolicy',
],
@ -574,7 +579,11 @@
'resource' => 'deviceManagement/deviceEnrollmentConfigurations',
'allowed_select' => ['id', 'displayName', 'description', '@odata.type', 'version'],
'allowed_expand' => [],
'type_family' => [],
'type_family' => [
'#microsoft.graph.deviceEnrollmentConfiguration',
'#microsoft.graph.deviceEnrollmentWindowsHelloForBusinessConfiguration',
'#microsoft.graph.windowsRestoreDeviceEnrollmentConfiguration',
],
'create_method' => 'POST',
'update_method' => 'PATCH',
'id_field' => 'id',

View File

@ -38,6 +38,7 @@ ## Phase 7 — Tests + Formatting
- [x] T018 Add Pest tests for wizard gating rules and status transitions.
- [x] T019 Add Pest tests for safety checks persistence and blocking behavior.
- [x] T020 Add Pest tests for preview summary generation.
- [x] T024 Fix Graph contract type families to accept valid derived @odata.type values during restore.
- [x] T021 Run `./vendor/bin/pint --dirty`.
- [x] T022 Run targeted tests (e.g. `./vendor/bin/sail artisan test --filter=RestoreRunWizard` once tests exist).

View File

@ -19,6 +19,9 @@
->use(RefreshDatabase::class)
->in('Feature');
pest()->extend(Tests\TestCase::class)
->in('Unit');
beforeEach(function () {
putenv('INTUNE_TENANT_ID');
unset($_ENV['INTUNE_TENANT_ID'], $_SERVER['INTUNE_TENANT_ID']);

View File

@ -0,0 +1,38 @@
<?php
use App\Models\BackupItem;
it('accepts derived deviceConfiguration odata types', function (string $odataType) {
$result = BackupItem::validateODataType(['@odata.type' => $odataType], 'deviceConfiguration', 'all');
expect($result['matches'])->toBeTrue();
})->with([
'#microsoft.graph.windows10GeneralConfiguration',
'#microsoft.graph.windowsHealthMonitoringConfiguration',
]);
it('accepts derived deviceCompliancePolicy odata types', function (string $odataType) {
$result = BackupItem::validateODataType(['@odata.type' => $odataType], 'deviceCompliancePolicy', 'all');
expect($result['matches'])->toBeTrue();
})->with([
'#microsoft.graph.androidDeviceOwnerCompliancePolicy',
'#microsoft.graph.androidWorkProfileCompliancePolicy',
]);
it('accepts derived appProtectionPolicy odata types', function (string $odataType) {
$result = BackupItem::validateODataType(['@odata.type' => $odataType], 'appProtectionPolicy', 'mobile');
expect($result['matches'])->toBeTrue();
})->with([
'#microsoft.graph.windowsManagedAppProtection',
]);
it('accepts derived enrollmentRestriction odata types', function (string $odataType) {
$result = BackupItem::validateODataType(['@odata.type' => $odataType], 'enrollmentRestriction', 'all');
expect($result['matches'])->toBeTrue();
})->with([
'#microsoft.graph.deviceEnrollmentWindowsHelloForBusinessConfiguration',
'#microsoft.graph.windowsRestoreDeviceEnrollmentConfiguration',
]);