From 7d67824b0dec6c243ab80b0729fce06617324cc1 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Sun, 20 Aug 2023 13:20:19 -0400 Subject: [PATCH 1/7] Downgrade base to fix swoole issues --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7548ec70f4..33c368b8dd 100755 --- a/Dockerfile +++ b/Dockerfile @@ -29,7 +29,7 @@ ENV VITE_APPWRITE_GROWTH_ENDPOINT=$VITE_APPWRITE_GROWTH_ENDPOINT RUN npm ci RUN npm run build -FROM appwrite/base:0.4.3 as final +FROM appwrite/base:0.4.2 as final LABEL maintainer="team@appwrite.io" From 1e4a3cd020ca4142c98c2fc2c938de37cb21eeb6 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Sun, 20 Aug 2023 13:20:37 -0400 Subject: [PATCH 2/7] Fix graphql test --- tests/e2e/Services/GraphQL/FunctionsServerTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/e2e/Services/GraphQL/FunctionsServerTest.php b/tests/e2e/Services/GraphQL/FunctionsServerTest.php index 39a3abca05..ed7933db1a 100644 --- a/tests/e2e/Services/GraphQL/FunctionsServerTest.php +++ b/tests/e2e/Services/GraphQL/FunctionsServerTest.php @@ -25,6 +25,7 @@ class FunctionsServerTest extends Scope 'variables' => [ 'functionId' => ID::unique(), 'name' => 'Test Function', + 'entrypoint' => 'index.php', 'runtime' => 'php-8.0', 'execute' => [Role::any()->toString()], ] From e35f83df0c432b8cd3309ea68c649228ab3ca439 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Sun, 20 Aug 2023 13:20:55 -0400 Subject: [PATCH 3/7] Fix response filter tests --- src/Appwrite/Utopia/Response/Filters/V14.php | 8 ++++---- src/Appwrite/Utopia/Response/Filters/V15.php | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Appwrite/Utopia/Response/Filters/V14.php b/src/Appwrite/Utopia/Response/Filters/V14.php index ff16d1e34a..200823f37f 100644 --- a/src/Appwrite/Utopia/Response/Filters/V14.php +++ b/src/Appwrite/Utopia/Response/Filters/V14.php @@ -23,7 +23,7 @@ class V14 extends Filter break; case Response::MODEL_DOCUMENT: - // case Response::MODEL_DOMAIN: + case Response::MODEL_DOMAIN: case Response::MODEL_FUNCTION: case Response::MODEL_TEAM: case Response::MODEL_MEMBERSHIP: @@ -38,10 +38,10 @@ class V14 extends Filter $parsedResponse = $this->parseRemoveAttributesList($content, 'documents', ['$createdAt', '$updatedAt']); break; - // case Response::MODEL_DOMAIN_LIST: - // $parsedResponse = $this->parseRemoveAttributesList($content, 'domains', ['$createdAt', '$updatedAt']); + case Response::MODEL_DOMAIN_LIST: + $parsedResponse = $this->parseRemoveAttributesList($content, 'domains', ['$createdAt', '$updatedAt']); - // break; + break; case Response::MODEL_FUNCTION_LIST: $parsedResponse = $this->parseRemoveAttributesList($content, 'functions', ['$createdAt', '$updatedAt']); diff --git a/src/Appwrite/Utopia/Response/Filters/V15.php b/src/Appwrite/Utopia/Response/Filters/V15.php index 6925a16632..232feec201 100644 --- a/src/Appwrite/Utopia/Response/Filters/V15.php +++ b/src/Appwrite/Utopia/Response/Filters/V15.php @@ -50,7 +50,7 @@ class V15 extends Filter break; case Response::MODEL_DATABASE: case Response::MODEL_DEPLOYMENT: - // case Response::MODEL_DOMAIN: + case Response::MODEL_DOMAIN: case Response::MODEL_PLATFORM: case Response::MODEL_PROJECT: case Response::MODEL_TEAM: @@ -59,7 +59,7 @@ class V15 extends Filter break; case Response::MODEL_DATABASE_LIST: case Response::MODEL_DEPLOYMENT_LIST: - // case Response::MODEL_DOMAIN_LIST: + case Response::MODEL_DOMAIN_LIST: case Response::MODEL_PLATFORM_LIST: case Response::MODEL_PROJECT_LIST: case Response::MODEL_TEAM_LIST: @@ -72,9 +72,9 @@ class V15 extends Filter case Response::MODEL_DEPLOYMENT_LIST: $listKey = 'deployments'; break; - // case Response::MODEL_DOMAIN_LIST: - // $listKey = 'domains'; - // break; + case Response::MODEL_DOMAIN_LIST: + $listKey = 'domains'; + break; case Response::MODEL_PLATFORM_LIST: $listKey = 'platforms'; break; From 4c9c34d92944fb9f5318144075a03ac0fb5b153a Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Sun, 20 Aug 2023 13:21:14 -0400 Subject: [PATCH 4/7] Fix console test --- tests/e2e/Services/Console/ConsoleConsoleClientTest.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/e2e/Services/Console/ConsoleConsoleClientTest.php b/tests/e2e/Services/Console/ConsoleConsoleClientTest.php index 3c1e973821..bb6176cc62 100644 --- a/tests/e2e/Services/Console/ConsoleConsoleClientTest.php +++ b/tests/e2e/Services/Console/ConsoleConsoleClientTest.php @@ -24,10 +24,12 @@ class ConsoleConsoleClientTest extends Scope ], $this->getHeaders()), []); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(4, $response['body']); + $this->assertCount(6, $response['body']); $this->assertIsString($response['body']['_APP_DOMAIN_TARGET']); $this->assertIsInt($response['body']['_APP_STORAGE_LIMIT']); $this->assertIsInt($response['body']['_APP_FUNCTIONS_SIZE_LIMIT']); $this->assertIsString($response['body']['_APP_DOMAIN_TARGET']); + $this->assertIsString($response['body']['_APP_VCS_ENABLED']); + $this->assertIsString($response['body']['_APP_ASSISTANT_ENABLED']); } } From a1b10ef7a81407abae766540544b25c49a900005 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Sun, 20 Aug 2023 13:40:44 -0400 Subject: [PATCH 5/7] Fix graphql tests --- tests/e2e/Services/GraphQL/Base.php | 10 ++++------ tests/e2e/Services/GraphQL/FunctionsServerTest.php | 2 ++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/e2e/Services/GraphQL/Base.php b/tests/e2e/Services/GraphQL/Base.php index 4fd26a3286..07c1d55aec 100644 --- a/tests/e2e/Services/GraphQL/Base.php +++ b/tests/e2e/Services/GraphQL/Base.php @@ -1368,8 +1368,7 @@ trait Base total deployments { _id - buildStdout - buildStderr + buildLogs } } }'; @@ -1378,8 +1377,7 @@ trait Base functionsGetDeployment(functionId: $functionId, deploymentId: $deploymentId) { _id buildId - buildStdout - buildStderr + buildLogs } }'; case self::$CREATE_FUNCTION: @@ -1392,8 +1390,8 @@ trait Base } }'; case self::$UPDATE_FUNCTION: - return 'mutation updateFunction($functionId: String!, $name: String!, $execute: [String!]!, $events: [String], $schedule: String, $timeout: Int) { - functionsUpdate(functionId: $functionId, name: $name, execute: $execute, events: $events, schedule: $schedule, timeout: $timeout) { + return 'mutation updateFunction($functionId: String!, $name: String!, $execute: [String!]!, $runtime: String!, $entrypoint: String!, $events: [String], $schedule: String, $timeout: Int) { + functionsUpdate(functionId: $functionId, name: $name, execute: $execute, runtime: $runtime, entrypoint: $entrypoint, events: $events, schedule: $schedule, timeout: $timeout) { _id name runtime diff --git a/tests/e2e/Services/GraphQL/FunctionsServerTest.php b/tests/e2e/Services/GraphQL/FunctionsServerTest.php index ed7933db1a..fb97d10718 100644 --- a/tests/e2e/Services/GraphQL/FunctionsServerTest.php +++ b/tests/e2e/Services/GraphQL/FunctionsServerTest.php @@ -382,6 +382,8 @@ class FunctionsServerTest extends Scope 'functionId' => $function['_id'], 'name' => 'Test Function Updated', 'execute' => [Role::any()->toString()], + 'entrypoint' => 'index.php', + 'runtime' => 'php-8.0', 'vars' => [ 'name' => 'John Doe', 'age' => 42, From 02cee3d6879252b31b289d531d06d7ab1f1c0e13 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Sun, 20 Aug 2023 20:02:03 -0400 Subject: [PATCH 6/7] Revert base image downgrade --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 33c368b8dd..7548ec70f4 100755 --- a/Dockerfile +++ b/Dockerfile @@ -29,7 +29,7 @@ ENV VITE_APPWRITE_GROWTH_ENDPOINT=$VITE_APPWRITE_GROWTH_ENDPOINT RUN npm ci RUN npm run build -FROM appwrite/base:0.4.2 as final +FROM appwrite/base:0.4.3 as final LABEL maintainer="team@appwrite.io" From 6634a8b43b9d1db54c093020b969d28fbcbf2fd1 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Sun, 20 Aug 2023 20:04:47 -0400 Subject: [PATCH 7/7] Lint --- src/Executor/Executor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Executor/Executor.php b/src/Executor/Executor.php index 0170031f29..36f6ad0dc5 100644 --- a/src/Executor/Executor.php +++ b/src/Executor/Executor.php @@ -178,7 +178,7 @@ class Executor array $headers, string $runtimeEntrypoint = null, ) { - if(empty($headers['host'])) { + if (empty($headers['host'])) { $headers['host'] = App::getEnv('_APP_DOMAIN', ''); }