diff --git a/CHANGES.md b/CHANGES.md index 4dfb65733..576349fca 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ ## Bugs - Fix license detection for Flutter and Dart SDKs [#4435](https://github.com/appwrite/appwrite/pull/4435) +- Fix missing status, buildStderr and buildStderr from get deployment response [#4611](https://github.com/appwrite/appwrite/pull/4611) # Version 1.0.4 diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index f276cd235..7632e1092 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -874,6 +874,11 @@ App::get('/v1/functions/:functionId/deployments/:deploymentId') throw new Exception(Exception::DEPLOYMENT_NOT_FOUND); } + $build = $dbForProject->getDocument('builds', $deployment->getAttribute('buildId', '')); + $deployment->setAttribute('status', $build->getAttribute('status', 'processing')); + $deployment->setAttribute('buildStderr', $build->getAttribute('stderr', '')); + $deployment->setAttribute('buildStdout', $build->getAttribute('stdout', '')); + $response->dynamic($deployment, Response::MODEL_DEPLOYMENT); }); diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index 7694bf8ac..6d421484f 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -570,6 +570,9 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(200, $function['headers']['status-code']); $this->assertEquals(0, $function['body']['buildTime']); + $this->assertNotEmpty($function['body']['status']); + $this->assertNotEmpty($function['body']['buildStdout']); + $this->assertArrayHasKey('buildStderr', $function['body']); /** * Test for FAILURE