mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
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.
This commit is contained in:
1 parent
567296ff34
commit
477cc61548
1 file changed
+6
-1
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user