Implements Spec 092 legacy purge. Key changes: - Remove legacy Inventory landing page + view; link Inventory entry directly to Inventory Items. - Update Drift landing copy to "operation runs"; remove URL heuristic from context bar. - Remove legacy redirect shim route and assert 404 for old bookmarks. - Staged job payload change: remove legacy ctor arg; keep legacy field for deserialization compatibility; new payload omits field. - Remove legacy notification artifact. - Remove legacy test shim + update tests; strengthen guard suite with scoped exception for job compat field. - Add spec/plan/tasks/checklist artifacts under specs/092-legacy-purge-final. Tests: - Focused Pest suite for guards, legacy routes, redirect behavior, job compatibility, drift copy. - Pint run: `vendor/bin/sail bin pint --dirty`. Notes: - Deploy B final removal of `backupScheduleRunId` should occur only after the compatibility window defined in the spec. Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #110
9.2 KiB
| description |
|---|
| Task list for Spec 092 implementation |
Tasks: Legacy Purge (Runs / Routes / UI / Test Shims)
Input: Design documents from /specs/092-legacy-purge-final/
Available docs: plan.md (required), spec.md (required), research.md, data-model.md, quickstart.md, contracts/
Tests: Required (Pest) — this feature changes runtime behavior (routes, queue payload compatibility, and UI).
Phase 1: Setup (Shared Infrastructure)
Purpose: Establish a safe baseline for a repo-wide purge.
- T001 Capture baseline by running focused tests (no code changes):
tests/Feature/Operations/LegacyRunRoutesNotFoundTest.php,tests/Feature/078/TenantListRedirectTest.php - T002 Capture baseline formatting state by running
vendor/bin/sail bin pint --dirty
Phase 2: Foundational (Blocking Prerequisites)
Purpose: Shared guard rails and spec consistency that must be correct before story work.
- T003 Confirm legacy identifier glossary in
specs/092-legacy-purge-final/spec.mdtargets only removed legacy deep-link endpoints / redirect shims (and does not treat the canonical/admin/t/{tenant:external_id}/...tenant-plane prefix as legacy by itself) - T004 [P] Inventory legacy hotspots and annotate in
specs/092-legacy-purge-final/research.md(confirm current matches:app/Jobs/RunBackupScheduleJob.php,app/Notifications/BackupScheduleRunDispatchedNotification.php,app/Filament/Pages/InventoryLanding.php,resources/views/filament/partials/context-bar.blade.php,routes/web.php,tests/Pest.php,tests/Support/LegacyModels/InventorySyncRun.php) - T005 Update guard scan exclusions in
tests/Feature/Guards/NoLegacyRunsTest.phpto explicitly excludedocs/**(even if not scanned today) and confirm exclusions includedatabase/migrations/**,references/**
Checkpoint: Foundation ready — user story implementation can begin.
Phase 3: User Story 1 — Operate without legacy concepts (Priority: P1) 🎯 MVP
Goal: Remove legacy artifacts from primary navigation/UX and staged-purge the legacy job field.
Independent Test: Navigate Inventory and Drift entry points; verify no redirect-only landing page, no legacy “inventory sync runs” copy, and no legacy URL heuristics are required. Run the focused tests listed under this story.
Tests for User Story 1
- T006 [P] [US1] Add/adjust UI copy assertion test for Drift landing in
tests/Feature/Monitoring/ortests/Feature/Drift/(create if absent) to ensure “operation runs” is present and “inventory sync runs” is absent (view:resources/views/filament/pages/drift-landing.blade.php) - T007 [P] [US1] Add compatibility test for Deploy A job payload in
tests/Feature/BackupScheduling/RunBackupScheduleJobCompatibilityTest.php(new) ensuring the job can be constructed without the legacy argument and older payloads still deserialize
Implementation for User Story 1
- T008 [P] [US1] Remove dead notification
app/Notifications/BackupScheduleRunDispatchedNotification.phpand update any references (if any) to avoid unused legacy artifacts - T009 [P] [US1] Remove redirect-only Inventory landing page
app/Filament/Pages/InventoryLanding.phpand deleteresources/views/filament/pages/inventory-landing.blade.php - T010 [P] [US1] Update related links in
app/Support/OperationRunLinks.phpto link directly to the canonical Inventory Items index (removeInventoryLanding::getUrl(...)usage) - T011 [P] [US1] Remove InventoryLanding exemption entry from
app/Support/Ui/ActionSurface/ActionSurfaceExemptions.php - T012 [US1] Update Drift landing copy in
resources/views/filament/pages/drift-landing.blade.phpto replace “inventory sync runs” with “operation runs” - T013 [US1] Remove legacy URL heuristic from
resources/views/filament/partials/context-bar.blade.php(removestr_starts_with($path, '/admin/t/')) and derive tenant-scoped behavior from route params + workspace/tenant context only
Deploy A — job payload compatibility release (part of FR-002)
- T014 [US1] Make
backupScheduleRunIdoptional inapp/Jobs/RunBackupScheduleJob.php(compat) and stop passing dummy values at dispatch sites (search dispatchers) so new dispatches don’t require a placeholder argument - T015 [US1] Update tests that assume
backupScheduleRunId === 0(tests/Feature/BackupScheduling/DispatchIdempotencyTest.php,tests/Feature/BackupScheduling/RunNowRetryActionsTest.php) to match the compatibility behavior
Deploy B — final purge (scheduled after compatibility window)
- T016 [US1] Remove
backupScheduleRunIdfromapp/Jobs/RunBackupScheduleJob.phpentirely and delete/adjust any remaining references in app + tests
Checkpoint: US1 complete — UI entry points are canonical, and the staged job cleanup is delivered (Deploy A ready; Deploy B planned/executable).
Phase 4: User Story 2 — Legacy deep links fail fast (Priority: P2)
Goal: Remove redirect shims and ensure legacy endpoints return 404 Not Found.
Independent Test: Requests to legacy tenant-scoped endpoints return 404 and do not redirect.
Tests for User Story 2
- T017 [P] [US2] Extend
tests/Feature/Operations/LegacyRunRoutesNotFoundTest.phpto include/admin/t/{tenant}/operationsand confirm it returns 404
Implementation for User Story 2
- T018 [US2] Remove legacy redirect shim route
/admin/t/{tenant:external_id}/operationsfromroutes/web.php - T019 [US2] Update
tests/Feature/078/TenantListRedirectTest.phpto assert404 Not Found(no redirect) for the legacy operations list URL - T020 [US2] Ensure the legacy-routes contract stays accurate by updating
specs/092-legacy-purge-final/contracts/legacy-routes.openapi.yamlif the covered legacy endpoints list changes
Checkpoint: US2 complete — old bookmarks fail fast and deterministically (404).
Phase 5: User Story 3 — Prevent reintroduction (Priority: P3)
Goal: Remove test shims and strengthen guards so legacy patterns cannot reappear.
Independent Test: Reintroduce a forbidden identifier in a non-excluded path and confirm guard tests fail; remove it and confirm suite passes.
Tests for User Story 3
- T021 [P] [US3] Update guard test patterns in
tests/Feature/Guards/NoLegacyRunsTest.phpto includebackupScheduleRunId,BackupScheduleRunDispatchedNotification, and the legacy UI phrase “inventory sync runs”, while keeping exclusions aligned with the spec
Implementation for User Story 3
- T022 [US3] Remove legacy test shim require in
tests/Pest.php(require_once __DIR__.'/Support/LegacyModels/InventorySyncRun.php';) - T023 [US3] Delete
tests/Support/LegacyModels/InventorySyncRun.phpand update all tests that import/useApp\Models\InventorySyncRunto use canonicalApp\Models\OperationRunpatterns instead (e.g.,tests/Feature/Inventory/InventorySyncButtonTest.php,tests/Feature/RunStartAuthorizationTest.php) - T024 [US3] Update
tests/Feature/Guards/NoLegacyRunBackfillTest.phpto remove references to legacy shim types (InventorySyncRun/EntraGroupSyncRun/BackupScheduleRun) if they’re no longer meaningful after the purge
Checkpoint: US3 complete — reintroduction is blocked automatically.
Phase 6: Polish & Cross-Cutting Concerns
Purpose: Finish the purge with verification and repo hygiene.
- T025 Run
vendor/bin/sail bin pint --dirtyand ensure formatting is clean - T026 Run the minimal full targeted suite for this change:
vendor/bin/sail artisan test --compact tests/Feature/Guards/NoLegacyRunsTest.phpvendor/bin/sail artisan test --compact tests/Feature/Operations/LegacyRunRoutesNotFoundTest.phpvendor/bin/sail artisan test --compact tests/Feature/078/TenantListRedirectTest.phpvendor/bin/sail artisan test --compact tests/Feature/BackupScheduling
- T027 Confirm no migration files were modified (guardrail for FR-009)
Dependencies & Execution Order
- Phase 1 → Phase 2 is required.
- US1 (Phase 3) can start after Phase 2.
- US2 (Phase 4) can start after Phase 2 and is mostly independent of US1.
- US3 (Phase 5) can start after Phase 2, but some changes may be easier after US1 removes the primary app-level legacy artifacts.
- Deploy B task (T016) must be scheduled after the compatibility window for queued jobs (operational constraint), even if code is ready.
Dependency Graph (User Stories)
Foundation (Phase 2)
├─> US1 (P1): UI + staged job cleanup (Deploy A)
├─> US2 (P2): Remove redirects; legacy deep links 404
└─> US3 (P3): Remove test shims; strengthen guards
US1 (Deploy A) ──(compat window elapsed)──> US1 (Deploy B final purge)
Parallel Execution Examples
US1 parallelizable tasks
- T008 (notification removal), T009 (InventoryLanding removal), T010 (OperationRunLinks update), and T011 (exemption removal) can be done in parallel.
- T006 (Drift copy test) can be authored in parallel with T012.
US2 parallelizable tasks
- T017 (extend 404 tests) can be done in parallel with T018/T019.
Implementation Strategy
- MVP scope: US1 (Phase 3) + Deploy A (T014–T015) only.
- Then: US2 (Phase 4) to enforce 404 behavior.
- Then: US3 (Phase 5) to remove shims and lock in guards.
- Finally: Deploy B (T016) after the compatibility window.