diff --git a/app/config/collections.php b/app/config/collections.php index 6789237c9..e6d67f08c 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -1481,8 +1481,8 @@ $collections = [ ], [ '$collection' => Database::SYSTEM_COLLECTION_RULES, - 'label' => 'Env', - 'key' => 'env', + 'label' => 'Runtime', + 'key' => 'runtime', 'type' => Database::SYSTEM_VAR_TYPE_TEXT, 'default' => '', 'required' => false, diff --git a/app/workers/functions.php b/app/workers/functions.php index 8bf719e60..4dfab9a24 100644 --- a/app/workers/functions.php +++ b/app/workers/functions.php @@ -330,12 +330,12 @@ class FunctionsV1 Authorization::reset(); - $runtime = (isset($runtimes[$function->getAttribute('env', '')])) - ? $runtimes[$function->getAttribute('env', '')] + $runtime = (isset($runtimes[$function->getAttribute('runtime', '')])) + ? $runtimes[$function->getAttribute('runtime', '')] : null; if(\is_null($runtime)) { - throw new Exception('Environment "'.$function->getAttribute('env', '').' is not supported'); + throw new Exception('Runtime "'.$function->getAttribute('runtime', '').' is not supported'); } $vars = \array_merge($function->getAttribute('vars', []), [ diff --git a/src/Appwrite/Utopia/Response/Model/Func.php b/src/Appwrite/Utopia/Response/Model/Func.php index 94690a946..6d5bf8c01 100644 --- a/src/Appwrite/Utopia/Response/Model/Func.php +++ b/src/Appwrite/Utopia/Response/Model/Func.php @@ -47,9 +47,9 @@ class Func extends Model 'default' => '', 'example' => 'enabled', ]) - ->addRule('env', [ + ->addRule('runtime', [ 'type' => self::TYPE_STRING, - 'description' => 'Function execution environment.', + 'description' => 'Function execution runtime.', 'default' => '', 'example' => 'python-3.8', ]) diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index b3140a769..cf0a1cafc 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -43,7 +43,7 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(201, $response1['headers']['status-code']); $this->assertNotEmpty($response1['body']['$id']); $this->assertEquals('Test', $response1['body']['name']); - $this->assertEquals('php-8.0', $response1['body']['env']); + $this->assertEquals('php-8.0', $response1['body']['runtime']); $this->assertIsInt($response1['body']['dateCreated']); $this->assertIsInt($response1['body']['dateUpdated']); $this->assertEquals('', $response1['body']['tag']); diff --git a/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php b/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php index 0ef01ec85..0d3678eaf 100644 --- a/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php +++ b/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php @@ -306,7 +306,7 @@ class WebhooksCustomServerTest extends Scope 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ 'name' => 'Test', - 'env' => 'php-8.0', + 'runtime' => 'php-8.0', 'execute' => ['*'], 'timeout' => 10, ]); @@ -348,7 +348,7 @@ class WebhooksCustomServerTest extends Scope 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ 'name' => 'Test', - 'env' => 'php-8.0', + 'runtime' => 'php-8.0', 'execute' => ['*'], 'vars' => [ 'key1' => 'value1',