TenantAtlas/specs/056-remove-legacy-bulkops/quickstart.md
ahmido a97beefda3 056-remove-legacy-bulkops (#65)
Kurzbeschreibung

Versteckt die Rerun-Row-Action für archivierte (soft-deleted) RestoreRuns und verhindert damit fehlerhafte Neu-Starts aus dem Archiv; ergänzt einen Regressionstest.
Änderungen

Code: RestoreRunResource.php — Sichtbarkeit der rerun-Action geprüft auf ! $record->trashed() und defensive Abbruchprüfung im Action-Handler.
Tests: RestoreRunRerunTest.php — neuer Test rerun action is hidden for archived restore runs.
Warum

Archivierte RestoreRuns durften nicht neu gestartet werden; UI zeigte trotzdem die Option. Das führte zu verwirrendem Verhalten und möglichen Fehlern beim Enqueueing.
Verifikation / QA

Unit/Feature:
./vendor/bin/sail artisan test tests/Feature/RestoreRunRerunTest.php
Stil/format:
./vendor/bin/pint --dirty
Manuell (UI):
Als Tenant-Admin Filament → Restore Runs öffnen.
Filter Archived aktivieren (oder Trashed filter auswählen).
Sicherstellen, dass für archivierte Einträge die Rerun-Action nicht sichtbar ist.
Auf einem aktiven (nicht-archivierten) Run prüfen, dass Rerun sichtbar bleibt und wie erwartet eine neue RestoreRun erzeugt.
Wichtige Hinweise

Kein DB-Migration required.
Diese PR enthält nur den UI-/Filament-Fix; die zuvor gemachten operative Fixes für Queue/adapter-Reconciliation bleiben ebenfalls auf dem Branch (z. B. frühere commits während der Debugging-Session).
T055 (Schema squash) wurde bewusst zurückgestellt und ist nicht Teil dieses PRs.
Merge-Checklist

 Tests lokal laufen (RestoreRunRerunTest grünt)
 Pint läuft ohne ungepatchte Fehler
 Branch gepusht: 056-remove-legacy-bulkops (PR-URL: https://git.cloudarix.de/ahmido/TenantAtlas/compare/dev...056-remove-legacy-bulkops)

Co-authored-by: Ahmed Darrazi <ahmeddarrazi@adsmac.local>
Reviewed-on: #65
2026-01-19 23:27:52 +00:00

53 lines
2.1 KiB
Markdown

# Quickstart: Feature 056 — Remove Legacy BulkOperationRun
## Prerequisites
- Local dev via Laravel Sail
- Database migrations up to date
## Common commands (Sail-first)
- Boot: `./vendor/bin/sail up -d`
- Run migrations: `./vendor/bin/sail artisan migrate`
- Run targeted tests (Ops UX): `./vendor/bin/sail artisan test tests/Feature/OpsUx`
- Run a single test file: `./vendor/bin/sail artisan test tests/Feature/OpsUx/BulkEnqueueIdempotencyTest.php`
- Run legacy guard test: `./vendor/bin/sail artisan test tests/Feature/Guards/NoLegacyBulkOperationsTest.php`
- Run queue worker (local): `./vendor/bin/sail artisan queue:work --verbose --tries=3 --timeout=300`
- Format (required): `./vendor/bin/pint --dirty`
## Validation (targeted)
- Ops UX suite: `./vendor/bin/sail artisan test tests/Feature/OpsUx`
- Legacy reference guard: `./vendor/bin/sail artisan test tests/Feature/Guards/NoLegacyBulkOperationsTest.php`
## Ops commands
- Preview adapter reconciliation (dry run): `./vendor/bin/sail artisan ops:reconcile-adapter-runs --dry-run=true`
- Apply adapter reconciliation: `./vendor/bin/sail artisan ops:reconcile-adapter-runs --dry-run=false`
## What to build (high level)
- Replace all legacy bulk-run usage with the canonical OperationRun run model.
- Ensure all bulk actions are enqueue-only and visible in Monitoring → Operations.
- Enforce per-target scope concurrency limit (config-driven, default=1).
- Enforce bulk idempotency via deterministic fingerprinting.
- Remove legacy BulkOperationRun stack (model/service/table/UI).
- Add guardrails/tests to prevent reintroduction.
## Where to look first
- Legacy stack:
- `app/Models/BulkOperationRun.php`
- `app/Services/BulkOperationService.php`
- `database/migrations/*bulk_operation_runs*`
- Canonical run stack:
- `app/Models/OperationRun.php`
- `app/Services/OperationRunService.php`
- `app/Support/OperationCatalog.php`
- `app/Support/OpsUx/OperationSummaryKeys.php`
- Locking patterns to reuse:
- `app/Services/Inventory/InventoryConcurrencyLimiter.php`
- `app/Services/Inventory/InventorySyncService.php`