feat/005-bulk-operations #5

Merged
ahmido merged 25 commits from feat/005-bulk-operations into dev 2025-12-25 13:32:37 +00:00
Owner

Summary

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

## 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 -->
ahmido added 21 commits 2025-12-25 03:14:05 +00:00
Feature 004 (Assignments & Scope Tags):
- Use fallback strategy for assignments read (direct + $expand)
- Use POST /directoryObjects/getByIds for stable group resolution
- POST /assign only (not PATCH) for assignments write
- Handle 204 No Content responses

Feature 005 (Bulk Operations):
- Policies: Local delete only (ignored_at flag, no Graph DELETE)
- Policy Versions: Eligibility checks + retention policy
- BulkOperationRun model for progress tracking
- Livewire polling for UI updates (not automatic)
- Chunked processing + circuit breaker (abort >50% fail)
- array $ids in Job constructor (not Collection)
Changes:
- Replace POST /assign with standard CRUD operations
- Restore strategy: DELETE existing + POST new assignments
- Graph Contract: assignments_create/update/delete_path + methods
- Handle 201 Created (POST) and 204 No Content (DELETE)
- Fail-soft: continue if individual assignment fails

Based on: Microsoft Learn Graph API docs + real-world usage patterns
Adds:
- plan.md: Technical context, constitution check, phases
- research.md: 7 research decisions (progress tracking, chunking, type-to-confirm)
- data-model.md: BulkOperationRun model, schema changes, query patterns
- quickstart.md: Developer onboarding, testing workflows, debugging

Key Decisions:
- BulkOperationRun model + Livewire polling for progress
- collect()->chunk(10) for memory-efficient processing
- Filament form + validation for type-to-confirm
- ignored_at flag to prevent sync re-adding deleted policies
- Eligibility scopes for safe Policy Version pruning

Estimated: 26-34 hours (3 phases for P1/P2 features)
Next: /speckit.tasks to generate task breakdown
98 tasks across 10 phases organized by user story:
- Phase 1-2: Setup + Foundational (13 tasks)
- Phase 3-4: US1 Bulk Delete + US2 Export (22 tasks) - MVP
- Phase 5: US5 Type-to-Confirm (7 tasks)
- Phase 6: US6 Progress Tracking (12 tasks)
- Phase 7-9: US3 Prune + US4 Delete Runs + Backup Sets (31 tasks)
- Phase 10: Polish + QA (13 tasks)

MVP Scope: 35 tasks (16-22 hours)
Full P1/P2: 85 tasks (26-34 hours)
Production Ready: 98 tasks (30-40 hours)

Each user story independently testable:
- US1: Bulk delete policies (local, ignored_at flag)
- US2: Bulk export to backup set
- US3: Prune old policy versions (eligibility checks)
- US4: Delete restore runs (skip running)
- US5: Type-to-confirm for ≥20 items
- US6: Progress tracking with Livewire polling

Parallel opportunities identified:
- All tests per story can run parallel
- User stories can be worked on by different devs
- Models/jobs in different files can be created parallel

Critical path to MVP: T001→T007→T014→T024 (12-16 hours)
- Add bulk restore + archived-only force delete actions
- Add jobs + tests for bulk restore/force delete
- Treat restore_run status 'partial' as deletable for hygiene
- Update feature tasks checklist
- Rename Policies bulk action to 'Ignore Policies'
- Align archived filter labels across resources
- Fix Housekeeping tests by setting current tenant
- Add BulkBackupSetDeleteJob with tenant isolation and skip reasons
- Add BackupSetResource bulk archive action with 10+ type-to-confirm
- Add unit + feature tests and mark Phase 9 tasks complete
- Add archived-only bulk restore + force delete actions
- Add jobs with tenant isolation + skip reasons
- Restore also restores backup items; force delete removes items
- Add unit + feature tests
- Add tenantpilot.bulk_operations config (chunk size, poll interval)
- Use config chunk size across all bulk jobs
- Make progress widget polling interval configurable
- Document settings in README + feature quickstart; mark tasks done
Normalize RestoreRun status in isDeletable() so 'Partial'/'completed-with-errors' variants can be archived.
Treat previewed as deletable for hygiene; keeps partial deletable too.
ahmido added 1 commit 2025-12-25 03:20:08 +00:00
ahmido added 1 commit 2025-12-25 12:27:25 +00:00
ahmido added 1 commit 2025-12-25 12:44:20 +00:00
ahmido added 1 commit 2025-12-25 13:28:02 +00:00
ahmido merged commit d62c8825a1 into dev 2025-12-25 13:32:37 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: ahmido/TenantAtlas#5
No description provided.