mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
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
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user