From da76f469327eeb50489a21d91df4be54fbed16a4 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Thu, 21 May 2026 13:39:32 +0530 Subject: [PATCH] Fix orchestrator artifact upload CI failures --- app/http.php | 6 +++++- .../Platform/Modules/Functions/Http/Deployments/Create.php | 2 +- src/Appwrite/Platform/Modules/Functions/Workers/Builds.php | 2 +- .../Platform/Modules/Sites/Http/Deployments/Create.php | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/http.php b/app/http.php index 6dc415f000..5618f4e263 100644 --- a/app/http.php +++ b/app/http.php @@ -55,7 +55,11 @@ $container->set('pools', function ($register) { return $register->get('pools'); }, ['register']); -$payloadSize = 12 * (1024 * 1024); // 12MB - adding slight buffer for headers and other data that might be sent with the payload - update later with valid testing +$payloadSize = \max( + 12 * (1024 * 1024), + (int) System::getEnv('_APP_STORAGE_LIMIT', 0), + (int) System::getEnv('_APP_COMPUTE_SIZE_LIMIT', 0) +) + (2 * 1024 * 1024); // Add a small buffer for multipart/request overhead. $totalWorkers = intval(System::getEnv('_APP_CPU_NUM', swoole_cpu_num())) * intval(System::getEnv('_APP_WORKER_PER_CORE', 6)); $swoole = new Server( diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Create.php b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Create.php index 9af5491598..ed0eaa0d39 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Create.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Create.php @@ -363,7 +363,7 @@ class Create extends Action $metadata = null; - if ($chunksUploaded === $chunks) { + if (!$deployment->isEmpty()) { $queueForEvents ->setParam('functionId', $function->getId()) ->setParam('deploymentId', $deployment->getId()); diff --git a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php index 03c9af0f7f..e4cc4f5ed1 100644 --- a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php +++ b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php @@ -1358,7 +1358,7 @@ class Builds extends Action . " && if [ -d {$escapedOutputPath} ]; then cp -R {$escapedOutputPath}/. /tmp/build-output/;" . ' elif [ -d /usr/code ]; then cp -R /usr/code/. /tmp/build-output/; fi'; } else { - $escapedOutputDirectoryError = \escapeshellarg("Error: Output directory {$outputDirectory} is empty or does not exist."); + $escapedOutputDirectoryError = \escapeshellarg("Error: No such file or directory: output directory {$outputDirectory} is empty or does not exist."); $buildCommand .= " && if [ -d {$escapedOutputPath} ] && [ \"$(find {$escapedOutputPath} -mindepth 1 -print -quit)\" ]; then" . " mkdir -p /tmp/build-output && cp -R {$escapedOutputPath}/. /tmp/build-output/;" . " else echo {$escapedOutputDirectoryError} >&2; exit 1; fi"; diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php index d27755d106..2bb8d440f7 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php @@ -435,7 +435,7 @@ class Create extends Action $metadata = null; - if ($chunksUploaded === $chunks) { + if (!$deployment->isEmpty()) { $queueForEvents ->setParam('siteId', $site->getId()) ->setParam('deploymentId', $deployment->getId());