From e887859cc0e849e3567911d124e9947d8172cb85 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 14 Jan 2026 00:57:40 +0000 Subject: [PATCH 1/2] feat: implement afterDeploymentSuccess hook in builds worker and invoke it post-deployment --- .../Modules/Functions/Workers/Builds.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php index 285f78319a..68027620e4 100644 --- a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php +++ b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php @@ -1024,6 +1024,11 @@ class Builds extends Action Console::log('Deployment activated'); } + $this->afterDeploymentSuccess( + $project, + $deployment, + ); + // Send realtime event after updating the associated resource so that Console will have the resource's deployment details when re-fetching. $queueForRealtime ->setPayload($deployment->getArrayCopy()) @@ -1256,6 +1261,19 @@ class Builds extends Action } } + protected function afterDeploymentSuccess( + Document $project, + Document $deployment, + ): void { + if (!($project instanceof Document)) { + throw new Exception('project must be an instance of Document'); + } + + if (!($deployment instanceof Document)) { + throw new Exception('deployment must be an instance of Document'); + } + } + protected function getRuntime(Document $resource, string $version): array { $runtimes = Config::getParam($version === 'v2' ? 'runtimes-v2' : 'runtimes', []); From 5469b783677cb50fd6c010032eaeb182ae41ab48 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 14 Jan 2026 00:59:22 +0000 Subject: [PATCH 2/2] feat: add afterDeploymentSuccess hook to handle post-deployment actions --- src/Appwrite/Platform/Modules/Functions/Workers/Builds.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php index 68027620e4..414696306f 100644 --- a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php +++ b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php @@ -1261,6 +1261,13 @@ class Builds extends Action } } + /** + * Hook to run after deployment is activated + * + * @param Document $project + * @param Document $deployment + * @return void + */ protected function afterDeploymentSuccess( Document $project, Document $deployment,