(fix): skip orphan projects and cleanup repositories

This commit is contained in:
Jake Barnby
2026-04-14 22:18:58 +12:00
parent 39a396810a
commit 772251fb84
@@ -69,7 +69,9 @@ trait Deployment
$project = $authorization->skip(fn () => $dbForPlatform->getDocument('projects', $projectId));
if ($project->isEmpty()) {
throw new Exception(Exception::PROJECT_NOT_FOUND, 'Repository references non-existent project');
Console::warning("Repository {$repositoryId} references non-existent project {$projectId}, cleaning up");
$authorization->skip(fn () => $dbForPlatform->deleteDocument('repositories', $repositoryId));
continue;
}
$this->beforeCreateGitDeployment($project, $repository, $dbForPlatform, $authorization);