From 9ffc23946c6c0966349cf2e0d6baae12e2a80005 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 1 Apr 2026 02:02:18 +0000 Subject: [PATCH] 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);