Fix executor builds broken by the jobs client injection

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 <noreply@anthropic.com>
This commit is contained in:
loks0nandClaude Fable 5 committed 2026-07-10 16:49:12 +01:00
1 parent e9a9a4162d
commit 03dbcb3639
2 files changed
+19 -5

No files matched your search

+14 -5
View File
@@ -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(), []);
+5
View File
@@ -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