## Summary - stabilize the active spec 293 post-cutover suite baseline around the current admin-panel and workspace-first runtime - align operations, provider, required-permissions, and action-surface expectations to canonical workspace-aware routes - add the monitoring operations workspace-membership guard and update the spec 293 classification artifacts - include the browser smoke screenshots captured during verification ## Validation - `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/Filament/PanelNavigationSegregationTest.php tests/Feature/ManagedEnvironment/LegacyTenantCoreGuardTest.php` - `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/OpsUx/CanonicalViewRunLinksTest.php tests/Feature/OpsUx/OperateHubShellTest.php tests/Feature/OpsUx/FailureSanitizationTest.php tests/Feature/OpsUx/NonLeakageWorkspaceOperationsTest.php` - `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/Guards/ActionSurfaceContractTest.php tests/Feature/ProviderConnections/NavigationPlacementTest.php tests/Feature/ProviderConnections/ProviderConnectionListAuthorizationTest.php tests/Feature/Verification/VerificationAuthorizationTest.php` - `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/Guards/Spec288NoLegacyRouteAndHelperGuardTest.php tests/Feature/Guards/Spec288ProviderCoreAndRoleAuthorityGuardTest.php tests/Feature/Guards/AdminWorkspaceRoutesGuardTest.php tests/Feature/Guards/ProviderBoundaryPlatformCoreGuardTest.php tests/Feature/ProviderConnections/LegacyRedirectTest.php tests/Feature/ManagedEnvironment/LegacyTenantCoreGuardTest.php tests/Feature/Spec080WorkspaceManagedTenantAdminMigrationTest.php tests/Feature/Rbac/ProviderConnectionWorkspaceFirstPolicyTest.php tests/Feature/Filament/ManagedEnvironmentAccessScopeManagementTest.php tests/Feature/Guards/BrowserLaneIsolationTest.php tests/Feature/Guards/CiLaneFailureClassificationContractTest.php tests/Feature/Guards/CiHeavyBrowserWorkflowContractTest.php tests/Unit/Auth/NoRoleStringChecksTest.php` - `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Browser/Spec281ProviderConnectionScopeSmokeTest.php tests/Browser/Spec285WorkspaceRbacEnvironmentAccessSmokeTest.php` - `cd apps/platform && ./vendor/bin/sail bin pint --dirty --format agent` ## Notes - remaining provider/verification failures are classified in `specs/293-post-cutover-suite-stabilization/failure-classification.md` as unrelated existing debt and are not folded into this slice Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #348
133 lines
5.2 KiB
PHP
133 lines
5.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Models\OperationRun;
|
|
use App\Models\ManagedEnvironment;
|
|
use App\Support\OperationRunLinks;
|
|
use App\Support\OpsUx\OperationRunUrl;
|
|
use App\Support\System\SystemOperationRunLinks;
|
|
use Illuminate\Support\Facades\File;
|
|
|
|
it('routes all OperationRun view links through OperationRunLinks', function (): void {
|
|
$files = File::allFiles(app_path());
|
|
|
|
$violations = [];
|
|
|
|
foreach ($files as $file) {
|
|
$path = $file->getRealPath();
|
|
if (! is_string($path)) {
|
|
continue;
|
|
}
|
|
|
|
// OperationRunLinks is the canonical wrapper.
|
|
if (str_ends_with($path, '/Support/OperationRunLinks.php')) {
|
|
continue;
|
|
}
|
|
|
|
$contents = File::get($path);
|
|
|
|
if (preg_match("/\\bOperationRunResource::getUrl\(\\s*'view'/", $contents) === 1
|
|
|| preg_match("/route\(\s*'filament\.admin\.resources\.operations\.view'/", $contents) === 1) {
|
|
$violations[] = $path;
|
|
}
|
|
}
|
|
|
|
expect($violations)->toBeEmpty();
|
|
})->group('ops-ux');
|
|
|
|
it('resolves tenantless operation run links to the canonical admin.operations.view route', function (): void {
|
|
$run = OperationRun::factory()->create();
|
|
|
|
$expectedUrl = route('admin.operations.view', [
|
|
'workspace' => (int) $run->workspace_id,
|
|
'run' => (int) $run->getKey(),
|
|
]);
|
|
|
|
expect(OperationRunLinks::tenantlessView($run))->toBe($expectedUrl);
|
|
expect(OperationRunLinks::tenantlessView((int) $run->getKey()))->toBe($expectedUrl);
|
|
})->group('ops-ux');
|
|
|
|
it('normalizes tenant-scoped callers onto the canonical tenantless run route', function (): void {
|
|
$tenant = ManagedEnvironment::factory()->create();
|
|
$run = OperationRun::factory()->for($tenant)->create();
|
|
|
|
$expectedUrl = route('admin.operations.view', [
|
|
'workspace' => (int) $run->workspace_id,
|
|
'run' => (int) $run->getKey(),
|
|
]);
|
|
|
|
expect(OperationRunLinks::view($run, $tenant))->toBe($expectedUrl)
|
|
->and(OperationRunLinks::view((int) $run->getKey(), $tenant))->toBe($expectedUrl);
|
|
})->group('ops-ux');
|
|
|
|
it('preserves tenant prefilter, requested tab, and problem class on canonical operations collection links', function (): void {
|
|
$tenant = ManagedEnvironment::factory()->create();
|
|
$workspaceId = (int) $tenant->workspace_id;
|
|
|
|
expect(OperationRunLinks::index($tenant, activeTab: 'active'))
|
|
->toBe(route('admin.operations.index', [
|
|
'workspace' => $workspaceId,
|
|
'managed_environment_id' => (int) $tenant->getKey(),
|
|
'activeTab' => 'active',
|
|
]))
|
|
->and(OperationRunLinks::index(
|
|
$tenant,
|
|
activeTab: OperationRun::PROBLEM_CLASS_ACTIVE_STALE_ATTENTION,
|
|
problemClass: OperationRun::PROBLEM_CLASS_ACTIVE_STALE_ATTENTION,
|
|
))
|
|
->toBe(route('admin.operations.index', [
|
|
'workspace' => $workspaceId,
|
|
'managed_environment_id' => (int) $tenant->getKey(),
|
|
'activeTab' => OperationRun::PROBLEM_CLASS_ACTIVE_STALE_ATTENTION,
|
|
'problemClass' => OperationRun::PROBLEM_CLASS_ACTIVE_STALE_ATTENTION,
|
|
]))
|
|
->and(OperationRunLinks::index(
|
|
$tenant,
|
|
activeTab: OperationRun::PROBLEM_CLASS_TERMINAL_FOLLOW_UP,
|
|
problemClass: OperationRun::PROBLEM_CLASS_TERMINAL_FOLLOW_UP,
|
|
))
|
|
->toBe(route('admin.operations.index', [
|
|
'workspace' => $workspaceId,
|
|
'managed_environment_id' => (int) $tenant->getKey(),
|
|
'activeTab' => OperationRun::PROBLEM_CLASS_TERMINAL_FOLLOW_UP,
|
|
'problemClass' => OperationRun::PROBLEM_CLASS_TERMINAL_FOLLOW_UP,
|
|
]));
|
|
})->group('ops-ux');
|
|
|
|
it('preserves helper-owned operation type filters on canonical operations collection links', function (): void {
|
|
$tenant = ManagedEnvironment::factory()->create();
|
|
|
|
expect(OperationRunLinks::index($tenant, operationType: 'inventory_sync'))
|
|
->toBe(route('admin.operations.index', [
|
|
'workspace' => (int) $tenant->workspace_id,
|
|
'managed_environment_id' => (int) $tenant->getKey(),
|
|
'tableFilters' => [
|
|
'type' => [
|
|
'value' => 'inventory.sync',
|
|
],
|
|
],
|
|
]));
|
|
})->group('ops-ux');
|
|
|
|
it('keeps the thin operation URL delegate on the canonical admin helpers', function (): void {
|
|
$tenant = ManagedEnvironment::factory()->create();
|
|
$run = OperationRun::factory()->for($tenant)->create();
|
|
|
|
expect(OperationRunUrl::view($run, $tenant))
|
|
->toBe(OperationRunLinks::view($run, $tenant))
|
|
->and(OperationRunUrl::index($tenant))
|
|
->toBe(OperationRunLinks::index($tenant));
|
|
})->group('ops-ux');
|
|
|
|
it('resolves system operation links through the canonical system helper family', function (): void {
|
|
$run = OperationRun::factory()->create();
|
|
|
|
expect(SystemOperationRunLinks::index())
|
|
->toBe(\App\Filament\System\Pages\Ops\Runs::getUrl(panel: 'system'))
|
|
->and(SystemOperationRunLinks::view($run))
|
|
->toBe(\App\Filament\System\Pages\Ops\ViewRun::getUrl(['run' => (int) $run->getKey()], panel: 'system'))
|
|
->and(SystemOperationRunLinks::view((int) $run->getKey()))
|
|
->toBe(\App\Filament\System\Pages\Ops\ViewRun::getUrl(['run' => (int) $run->getKey()], panel: 'system'));
|
|
})->group('ops-ux');
|