From f48ff3f63bb083617de46ebc32d99601172b7187 Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Wed, 8 Jul 2026 20:05:26 +0100 Subject: [PATCH] Route the VCS connect-time build (Functions/Update) through jobs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a function is connected to a repo (Functions/Update, first connect), redeployVcsFunction triggers the initial build. Inject the Jobs client and pass it through, so on _APP_BUILDS_BACKEND=orchestrator that build runs on the jobs-service like createVcsDeployment and the webhook path. Reuses the already jobs-capable redeployVcsFunction branch (functions + non-template only). Functions/Create's VCS deploy stays on the executor: it's a deprecated pre-1.7.0 compat path; modern clients create then call createVcsDeployment (already on jobs). Static-checked only — VCS isn't verifiable locally. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../Platform/Modules/Functions/Http/Functions/Update.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Update.php b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Update.php index 9f9e10ddca..ceb8ec7919 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Update.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Update.php @@ -14,6 +14,7 @@ use Appwrite\SDK\Response as SDKResponse; use Appwrite\Task\Validator\Cron; use Appwrite\Utopia\Response; use Executor\Executor; +use OpenRuntimes\Orchestrator\Jobs; use Utopia\Config\Config; use Utopia\Database\Database; use Utopia\Database\DateTime; @@ -111,6 +112,7 @@ class Update extends Base ->inject('project') ->inject('queueForEvents') ->inject('publisherForBuilds') + ->inject('jobs') ->inject('dbForPlatform') ->inject('gitHub') ->inject('executor') @@ -148,6 +150,7 @@ class Update extends Base Document $project, Event $queueForEvents, BuildPublisher $publisherForBuilds, + Jobs $jobs, Database $dbForPlatform, GitHub $github, Executor $executor, @@ -309,7 +312,7 @@ class Update extends Base // Redeploy logic if (!$isConnected && !empty($providerRepositoryId)) { - $this->redeployVcsFunction($request, $function, $project, $installation, $dbForProject, $publisherForBuilds, new Document(), $github, true, $platform); + $this->redeployVcsFunction($request, $function, $project, $installation, $dbForProject, $publisherForBuilds, new Document(), $github, true, $platform, jobs: $jobs); } // Inform scheduler if function is still active