From 03dbcb36398677721a94a7195c571da3116e8136 Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Fri, 10 Jul 2026 13:43:32 +0100 Subject: [PATCH] Fix executor builds broken by the jobs client injection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Builds worker now injects the jobs client, but worker-builds got no _APP_JOBS_* env — withBaseUri('') throws, failing every executor build (Sites/Screenshots/Proxy CI suites hung). Pass the jobs + builds-backend env to worker-builds, and make the DI binding skip withBaseUri when _APP_JOBS_HOST is unset (executor-only installs never call it). Co-Authored-By: Claude Fable 5 --- app/init/resources.php | 19 ++++++++++++++----- docker-compose.yml | 5 +++++ 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/app/init/resources.php b/app/init/resources.php index e80f938fd7..d559213f5e 100644 --- a/app/init/resources.php +++ b/app/init/resources.php @@ -70,12 +70,21 @@ $container->set('localeCodes', fn () => array_map(fn ($locale) => $locale['code' $container->set('executor', fn () => new Executor(), []); -$container->set('jobs', fn () => new Jobs( - (new Client(new CurlAdapter())) - ->withBaseUri(System::getEnv('_APP_JOBS_HOST', '')) +$container->set('jobs', function () { + $client = (new Client(new CurlAdapter())) ->withBearerAuth(System::getEnv('_APP_JOBS_SECRET', '')) - ->withTimeout(30) -), []); + ->withTimeout(30); + + // No host on executor-only installs: keep the injection resolvable and + // fail at call time instead (the client is only used when + // _APP_BUILDS_BACKEND=orchestrator, which requires _APP_JOBS_HOST). + $host = System::getEnv('_APP_JOBS_HOST', ''); + if ($host !== '') { + $client = $client->withBaseUri($host); + } + + return new Jobs($client); +}, []); $container->set('telemetry', fn () => new NoTelemetry(), []); diff --git a/docker-compose.yml b/docker-compose.yml index 416f9e21d7..dbcf8a98cf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -515,6 +515,11 @@ services: - _APP_STORAGE_WASABI_BUCKET - _APP_DATABASE_SHARED_TABLES - _APP_DOMAIN_SITES + - _APP_BUILDS_BACKEND + - _APP_BUILDS_VOLUME + - _APP_JOBS_HOST + - _APP_JOBS_SECRET + - _APP_JOBS_ENDPOINT extra_hosts: - host.docker.internal:host-gateway