From 772251fb84819547c766e9b60dc3b1975aefc9de Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 14 Apr 2026 22:18:58 +1200 Subject: [PATCH] (fix): skip orphan projects and cleanup repositories --- src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php b/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php index 6e1db12c28..79e53265a6 100644 --- a/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php +++ b/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php @@ -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);