From 477cc61548388a2891135447832116e14a75357a Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Mon, 10 Aug 2026 10:25:28 +0530 Subject: [PATCH] fix(specs): fail the task when a spec cannot be generated The CLI reports a throw through its error hooks and then carries on, so a spec that failed to generate left the task reporting success. The missing file was met further down the pipeline, by the SDK build, which reads a spec that isn't there as specs never having been run -- pointing at the wrong step and hiding the reason in one marked green. A platform that cannot be generated now says so and stops, which is what lets the SDK preview workflow catch it here rather than in cloud. --- src/Appwrite/Platform/Tasks/Specs.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Tasks/Specs.php b/src/Appwrite/Platform/Tasks/Specs.php index 45208d234d..0957537a47 100644 --- a/src/Appwrite/Platform/Tasks/Specs.php +++ b/src/Appwrite/Platform/Tasks/Specs.php @@ -779,7 +779,12 @@ class Specs extends Action $parsedSpecs = $specs->parse(); $this->verifyParsedSpec($parsedSpecs); } catch (\RuntimeException $e) { - throw new \RuntimeException("Spec generation failed for {$platform} ({$format}): " . $e->getMessage(), 0, $e); + // The CLI reports a throw and carries on, so a spec that + // failed to generate leaves the task reporting success and + // the missing file is met further down the pipeline, where + // it reads as specs never having been run. + Console::error("Spec generation failed for {$platform} ({$format}): " . $e->getMessage()); + Console::exit(1); } $encodedSpecs = \json_encode($parsedSpecs, JSON_PRETTY_PRINT);