From 9ffc23946c6c0966349cf2e0d6baae12e2a80005 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 1 Apr 2026 02:02:18 +0000 Subject: [PATCH 1/3] Add validateGitDeployment hook method to Deployment trait Add a no-op protected method that Cloud can override to enforce billing/block checks before processing git deployments. The hook is called inside the foreach loop after project validation, so any exception it throws is caught and logged as an error. https://claude.ai/code/session_01HP1N9hHbqMzxm5QmaoGhyZ --- .../Platform/Modules/VCS/Http/GitHub/Deployment.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php b/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php index 04e2dbd406..106c9bb364 100644 --- a/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php +++ b/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php @@ -70,6 +70,8 @@ trait Deployment throw new Exception(Exception::PROJECT_NOT_FOUND, 'Repository references non-existent project'); } + $this->validateGitDeployment($project, $repository, $dbForPlatform, $authorization); + try { $dsn = new DSN($project->getAttribute('database')); $databaseName = $dsn->getHost(); @@ -561,6 +563,15 @@ trait Deployment } } + /** + * Validate a git deployment before processing. + * + * No-op in OSS — overridden in Cloud to enforce billing/block checks. + */ + protected function validateGitDeployment(Document $project, Document $repository, Database $dbForPlatform, Authorization $authorization): void + { + } + protected function getBuildQueueName(Document $project, Database $dbForPlatform, Authorization $authorization): string { return System::getEnv('_APP_BUILDS_QUEUE_NAME', Event::BUILDS_QUEUE_NAME); From b91506fc2dc78d9760d99a21d7e1563cbbe3a534 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 1 Apr 2026 02:03:59 +0000 Subject: [PATCH 2/3] Rename hook to beforeCreateGitDeployment https://claude.ai/code/session_01HP1N9hHbqMzxm5QmaoGhyZ --- src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php b/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php index 106c9bb364..f9174467ff 100644 --- a/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php +++ b/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php @@ -70,7 +70,7 @@ trait Deployment throw new Exception(Exception::PROJECT_NOT_FOUND, 'Repository references non-existent project'); } - $this->validateGitDeployment($project, $repository, $dbForPlatform, $authorization); + $this->beforeCreateGitDeployment($project, $repository, $dbForPlatform, $authorization); try { $dsn = new DSN($project->getAttribute('database')); @@ -568,7 +568,7 @@ trait Deployment * * No-op in OSS — overridden in Cloud to enforce billing/block checks. */ - protected function validateGitDeployment(Document $project, Document $repository, Database $dbForPlatform, Authorization $authorization): void + protected function beforeCreateGitDeployment(Document $project, Document $repository, Database $dbForPlatform, Authorization $authorization): void { } From b6e020389b0d7cd22176a8793865fa3436d5bc0a Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 1 Apr 2026 02:07:36 +0000 Subject: [PATCH 3/3] Remove docblock from beforeCreateGitDeployment hook https://claude.ai/code/session_01HP1N9hHbqMzxm5QmaoGhyZ --- src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php b/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php index f9174467ff..ae730c3f74 100644 --- a/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php +++ b/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php @@ -563,11 +563,6 @@ trait Deployment } } - /** - * Validate a git deployment before processing. - * - * No-op in OSS — overridden in Cloud to enforce billing/block checks. - */ protected function beforeCreateGitDeployment(Document $project, Document $repository, Database $dbForPlatform, Authorization $authorization): void { }