From 049e3a26461c29ac1b89dcf045501c50b064d298 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 31 Oct 2022 18:11:55 +1300 Subject: [PATCH 1/3] Add missing status, buildStdout, buildStderr to getDeployment --- app/controllers/api/functions.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index d3a26b414..d4d232abc 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -873,6 +873,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); }); From 2bfbf4acaf68bb31af31ce1aad138fd50c86beb9 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 31 Oct 2022 18:17:13 +1300 Subject: [PATCH 2/3] Add check to tests --- tests/e2e/Services/Functions/FunctionsCustomServerTest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index 5e498368e..c7dd46782 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -568,6 +568,9 @@ class FunctionsCustomServerTest extends Scope ], $this->getHeaders())); $this->assertEquals(200, $function['headers']['status-code']); + $this->assertNotEmpty($function['body']['status']); + $this->assertNotEmpty($function['body']['buildStdout']); + $this->assertArrayHasKey('buildStderr', $function['body']); /** * Test for FAILURE From dad4e3a2f42d52c9533c87e1583527547e29ab7e Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 31 Oct 2022 18:19:55 +1300 Subject: [PATCH 3/3] Update changelog --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 340aec16d..958cc198c 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.3 ## Bugs