Route the VCS connect-time build (Functions/Update) through jobs

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) <noreply@anthropic.com>
This commit is contained in:
loks0nandClaude Opus 4.8 committed 2026-07-10 16:46:56 +01:00
1 parent b10c898e16
commit f48ff3f63b
1 file changed
+4 -1
@@ -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