## Summary - move the Laravel application into `apps/platform` and keep the repository root for orchestration, docs, and tooling - update the local command model, Sail/Docker wiring, runtime paths, and ignore rules around the new platform location - add relocation quickstart/contracts plus focused smoke coverage for bootstrap, command model, routes, and runtime behavior ## Validation - `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/PlatformRelocation` - integrated browser smoke validated `/up`, `/`, `/admin`, `/admin/choose-workspace`, and tenant route semantics for `200`, `403`, and `404` ## Remaining Rollout Checks - validate Dokploy build context and working-directory assumptions against the new `apps/platform` layout - confirm web, queue, and scheduler processes all start from the expected working directory in staging/production - verify no legacy volume mounts or asset-publish paths still point at the old root-level `public/` or `storage/` locations Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #213
88 lines
3.1 KiB
PHP
88 lines
3.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Models\BackupItem;
|
|
use App\Models\PolicyVersion;
|
|
use App\Support\BackupQuality\BackupQualityResolver;
|
|
use App\Support\RedactionIntegrity;
|
|
|
|
it('derives metadata-only and assignment degradations from backup item metadata', function (): void {
|
|
$summary = app(BackupQualityResolver::class)->forBackupItem(new BackupItem([
|
|
'payload' => [],
|
|
'assignments' => [],
|
|
'metadata' => [
|
|
'source' => 'metadata_only',
|
|
'assignments_fetch_failed' => true,
|
|
'has_orphaned_assignments' => true,
|
|
'integrity_warning' => 'Protected values are intentionally hidden.',
|
|
'assignment_capture_reason' => 'separate_role_assignments',
|
|
],
|
|
]));
|
|
|
|
expect($summary->snapshotMode)->toBe('metadata_only')
|
|
->and($summary->hasAssignmentIssues)->toBeTrue()
|
|
->and($summary->hasOrphanedAssignments)->toBeTrue()
|
|
->and($summary->hasIntegrityWarning())->toBeTrue()
|
|
->and($summary->degradationFamilies)->toBe([
|
|
'metadata_only',
|
|
'assignment_capture_issue',
|
|
'orphaned_assignments',
|
|
'integrity_warning',
|
|
])
|
|
->and($summary->qualityHighlights)->toContain(
|
|
'Metadata only',
|
|
'Assignment fetch failed',
|
|
'Orphaned assignments',
|
|
'Integrity warning',
|
|
);
|
|
});
|
|
|
|
it('uses unknown quality only when backup item metadata cannot justify a stronger claim', function (): void {
|
|
$resolver = app(BackupQualityResolver::class);
|
|
|
|
$unknownSummary = $resolver->forBackupItem(new BackupItem([
|
|
'payload' => [],
|
|
'assignments' => [],
|
|
'metadata' => [],
|
|
]));
|
|
|
|
$assignmentIssueSummary = $resolver->forBackupItem(new BackupItem([
|
|
'payload' => [],
|
|
'assignments' => [],
|
|
'metadata' => [
|
|
'assignments_fetch_failed' => true,
|
|
],
|
|
]));
|
|
|
|
expect($unknownSummary->degradationFamilies)->toBe(['unknown_quality'])
|
|
->and($unknownSummary->compactSummary)->toBe('Unknown quality')
|
|
->and($assignmentIssueSummary->degradationFamilies)->toBe(['assignment_capture_issue'])
|
|
->and($assignmentIssueSummary->qualityHighlights)->not->toContain('Unknown quality');
|
|
});
|
|
|
|
it('derives policy version integrity warnings from existing redaction context', function (): void {
|
|
$summary = app(BackupQualityResolver::class)->forPolicyVersion(new PolicyVersion([
|
|
'snapshot' => [
|
|
'id' => 'policy-1',
|
|
'displayName' => 'Policy One',
|
|
],
|
|
'metadata' => [
|
|
'assignments_fetch_failed' => true,
|
|
],
|
|
'secret_fingerprints' => [
|
|
'snapshot' => ['/clientSecret' => 'abc123'],
|
|
'assignments' => [],
|
|
'scope_tags' => [],
|
|
],
|
|
]));
|
|
|
|
expect($summary->snapshotMode)->toBe('full')
|
|
->and($summary->hasAssignmentIssues)->toBeTrue()
|
|
->and($summary->integrityWarning)->toBe(RedactionIntegrity::protectedValueNote())
|
|
->and($summary->degradationFamilies)->toBe([
|
|
'assignment_capture_issue',
|
|
'integrity_warning',
|
|
]);
|
|
});
|