diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2ed2b65ff7..d99c29999a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -4,7 +4,7 @@ on: [pull_request] jobs: tests: name: Unit & E2E - runs-on: self-hosted + runs-on: ubuntu-latest steps: - name: Checkout repository @@ -23,12 +23,14 @@ jobs: # Upstream bug causes buildkit pulls to fail so prefetch base images # https://github.com/moby/moby/issues/41864 run: | - echo "_APP_FUNCTIONS_RUNTIMES=php-8.0" >> .env + export COMPOSE_INTERACTIVE_NO_CLI + export DOCKER_BUILDKIT=1 + export COMPOSE_DOCKER_CLI_BUILD=1 + export BUILDKIT_PROGRESS=plain docker pull composer:2.0 - docker pull php:8.0-cli-alpine - docker compose build --progress=plain - docker compose up -d - sleep 10 + docker compose -f docker-compose.yml -f docker-compose.ci.yml build appwrite + docker compose -f docker-compose.yml -f docker-compose.ci.yml up -d + sleep 30 - name: Doctor run: docker compose exec -T appwrite doctor @@ -37,10 +39,3 @@ jobs: - name: Run Tests run: docker compose exec -T appwrite test --debug - - - name: Teardown - if: always() - run: | - docker ps -aq | xargs docker rm --force || true - docker volume prune --force || true - docker network prune --force || true \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a8968398bd..1e3c4ce911 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -378,7 +378,7 @@ To run end-2-end tests use: docker compose exec appwrite test /usr/src/code/tests/e2e ``` -To run end-2-end tests for a spcific service use: +To run end-2-end tests for a specific service use: ```bash docker compose exec appwrite test /usr/src/code/tests/e2e/Services/[ServiceName] diff --git a/README-CN.md b/README-CN.md index 82908f1425..88c57ddf3d 100644 --- a/README-CN.md +++ b/README-CN.md @@ -8,13 +8,16 @@

- + + +[![Hacktoberfest](https://img.shields.io/static/v1?label=hacktoberfest&message=friendly&color=191120&style=flat-square)](https://hacktoberfest.appwrite.io) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord?r=Github) -[![Docker Pulls](https://img.shields.io/docker/pulls/appwrite/appwrite?color=f02e65&style=flat-square)](https://hub.docker.com/r/appwrite/appwrite) -[![Build Status](https://img.shields.io/travis/com/appwrite/appwrite?style=flat-square)](https://travis-ci.com/appwrite/appwrite) +[![Build Status](https://img.shields.io/github/workflow/status/appwrite/appwrite/Tests?label=tests&style=flat-square)](https://github.com/appwrite/appwrite/actions) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) -[![翻译](https://img.shields.io/badge/translate-f02e65?style=flat-square)](docs/tutorials/add-translations.md) -[![周边商店](https://img.shields.io/badge/swag%20store-f02e65?style=flat-square)](https://store.appwrite.io) + + + + [English](README.md) | 简体中文 @@ -128,7 +131,7 @@ docker run -it --rm , #### 服务器 * ✅   [NodeJS](https://github.com/appwrite/sdk-for-node) (由 Appwrite 团队维护) -* ✅   [PHP](https://github.com/appwrite/sdk-for-php) (由 Appwr实验 团队维护) +* ✅   [PHP](https://github.com/appwrite/sdk-for-php) (由 Appwrite 团队维护) * ✅   [Dart](https://github.com/appwrite/sdk-for-dart) - (由 Appwrite 团队维护) * ✅   [Deno](https://github.com/appwrite/sdk-for-deno) - **公测** (由 Appwrite 团队维护) * ✅   [Ruby](https://github.com/appwrite/sdk-for-ruby) (由 Appwrite 团队维护) diff --git a/README.md b/README.md index e4c8b4ca3b..9519d38219 100644 --- a/README.md +++ b/README.md @@ -11,15 +11,17 @@

- + +[![Hacktoberfest](https://img.shields.io/static/v1?label=hacktoberfest&message=ready&color=191120&style=flat-square)](https://hacktoberfest.appwrite.io) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord?r=Github) -[![Docker Pulls](https://img.shields.io/docker/pulls/appwrite/appwrite?color=f02e65&style=flat-square)](https://hub.docker.com/r/appwrite/appwrite) [![Build Status](https://img.shields.io/github/workflow/status/appwrite/appwrite/Tests?label=tests&style=flat-square)](https://github.com/appwrite/appwrite/actions) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) -[![Translate](https://img.shields.io/badge/translate-f02e65?style=flat-square)](docs/tutorials/add-translations.md) -[![Swag Store](https://img.shields.io/badge/swag%20store-f02e65?style=flat-square)](https://store.appwrite.io) + + + + English | [简体中文](README-CN.md) @@ -31,7 +33,7 @@ Using Appwrite, you can easily integrate your app with user authentication & mul


- Appwrite - 100% open source alternative for Firebase | Product Hunt + Appwrite - 100% open source alternative for Firebase | Product Hunt

@@ -91,10 +93,10 @@ docker run -it --rm ^ #### PowerShell ```powershell -docker run -it --rm , - --volume /var/run/docker.sock:/var/run/docker.sock , - --volume ${pwd}/appwrite:/usr/src/code/appwrite:rw , - --entrypoint="install" , +docker run -it --rm ` + --volume /var/run/docker.sock:/var/run/docker.sock ` + --volume ${pwd}/appwrite:/usr/src/code/appwrite:rw ` + --entrypoint="install" ` appwrite/appwrite:1.0.1 ``` diff --git a/app/config/events.php b/app/config/events.php index 0a7d819142..6fe030d4bf 100644 --- a/app/config/events.php +++ b/app/config/events.php @@ -1,7 +1,7 @@ 'web', 'name' => 'Web', - 'version' => '10.0.0', + 'version' => '10.1.0', 'url' => 'https://github.com/appwrite/sdk-for-web', 'package' => 'https://www.npmjs.com/package/appwrite', 'enabled' => true, @@ -63,7 +63,7 @@ return [ [ 'key' => 'flutter', 'name' => 'Flutter', - 'version' => '8.0.0', + 'version' => '8.1.0', 'url' => 'https://github.com/appwrite/sdk-for-flutter', 'package' => 'https://pub.dev/packages/appwrite', 'enabled' => true, @@ -81,7 +81,7 @@ return [ [ 'key' => 'apple', 'name' => 'Apple', - 'version' => '1.0.0', + 'version' => '1.1.0', 'url' => 'https://github.com/appwrite/sdk-for-apple', 'package' => 'https://github.com/appwrite/sdk-for-apple', 'enabled' => true, @@ -116,7 +116,7 @@ return [ [ 'key' => 'android', 'name' => 'Android', - 'version' => '1.0.0', + 'version' => '1.1.0', 'url' => 'https://github.com/appwrite/sdk-for-android', 'package' => 'https://search.maven.org/artifact/io.appwrite/sdk-for-android', 'enabled' => true, @@ -162,7 +162,7 @@ return [ [ 'key' => 'web', 'name' => 'Console', - 'version' => '7.0.0', + 'version' => '7.1.0', 'url' => 'https://github.com/appwrite/sdk-for-console', 'package' => '', 'enabled' => true, @@ -180,7 +180,7 @@ return [ [ 'key' => 'cli', 'name' => 'Command Line', - 'version' => '1.0.0', + 'version' => '1.1.1', 'url' => 'https://github.com/appwrite/sdk-for-cli', 'package' => 'https://www.npmjs.com/package/appwrite-cli', 'enabled' => true, @@ -208,7 +208,7 @@ return [ [ 'key' => 'nodejs', 'name' => 'Node.js', - 'version' => '8.0.0', + 'version' => '8.1.0', 'url' => 'https://github.com/appwrite/sdk-for-node', 'package' => 'https://www.npmjs.com/package/node-appwrite', 'enabled' => true, @@ -226,7 +226,7 @@ return [ [ 'key' => 'deno', 'name' => 'Deno', - 'version' => '6.0.0', + 'version' => '6.1.0', 'url' => 'https://github.com/appwrite/sdk-for-deno', 'package' => 'https://deno.land/x/appwrite', 'enabled' => true, @@ -244,7 +244,7 @@ return [ [ 'key' => 'php', 'name' => 'PHP', - 'version' => '7.0.0', + 'version' => '7.1.0', 'url' => 'https://github.com/appwrite/sdk-for-php', 'package' => 'https://packagist.org/packages/appwrite/appwrite', 'enabled' => true, @@ -262,7 +262,7 @@ return [ [ 'key' => 'python', 'name' => 'Python', - 'version' => '1.0.0', + 'version' => '1.1.0', 'url' => 'https://github.com/appwrite/sdk-for-python', 'package' => 'https://pypi.org/project/appwrite/', 'enabled' => true, @@ -280,7 +280,7 @@ return [ [ 'key' => 'ruby', 'name' => 'Ruby', - 'version' => '7.0.0', + 'version' => '7.1.0', 'url' => 'https://github.com/appwrite/sdk-for-ruby', 'package' => 'https://rubygems.org/gems/appwrite', 'enabled' => true, @@ -298,7 +298,7 @@ return [ [ 'key' => 'go', 'name' => 'Go', - 'version' => '1.0.0', + 'version' => '1.1.0', 'url' => 'https://github.com/appwrite/sdk-for-go', 'package' => '', 'enabled' => false, @@ -316,7 +316,7 @@ return [ [ 'key' => 'java', 'name' => 'Java', - 'version' => '1.0.0', + 'version' => '1.1.0', 'url' => 'https://github.com/appwrite/sdk-for-java', 'package' => '', 'enabled' => false, @@ -334,7 +334,7 @@ return [ [ 'key' => 'dotnet', 'name' => '.NET', - 'version' => '1.0.0', + 'version' => '1.1.0', 'url' => 'https://github.com/appwrite/sdk-for-dotnet', 'package' => 'https://www.nuget.org/packages/Appwrite', 'enabled' => false, @@ -352,7 +352,7 @@ return [ [ 'key' => 'dart', 'name' => 'Dart', - 'version' => '7.0.0', + 'version' => '7.1.0', 'url' => 'https://github.com/appwrite/sdk-for-dart', 'package' => 'https://pub.dev/packages/dart_appwrite', 'enabled' => true, @@ -370,7 +370,7 @@ return [ [ 'key' => 'kotlin', 'name' => 'Kotlin', - 'version' => '1.0.0', + 'version' => '1.1.0', 'url' => 'https://github.com/appwrite/sdk-for-kotlin', 'package' => 'https://search.maven.org/artifact/io.appwrite/sdk-for-kotlin', 'enabled' => true, @@ -392,7 +392,7 @@ return [ [ 'key' => 'swift', 'name' => 'Swift', - 'version' => '1.0.0', + 'version' => '1.1.0', 'url' => 'https://github.com/appwrite/sdk-for-swift', 'package' => 'https://github.com/appwrite/sdk-for-swift', 'enabled' => true, diff --git a/app/config/providers.php b/app/config/providers.php index 98ad93b30c..62430faae1 100644 --- a/app/config/providers.php +++ b/app/config/providers.php @@ -17,7 +17,7 @@ return [ // Ordered by ABC. 'icon' => 'icon-apple', 'enabled' => true, 'sandbox' => false, - 'form' => 'apple.phtml', // Perperation for adding ability to customized OAuth UI forms, currently handled hardcoded. + 'form' => 'apple.phtml', // Preparation for adding ability to customized OAuth UI forms, currently handled hardcoded. 'beta' => true, 'mock' => false, ], diff --git a/app/config/variables.php b/app/config/variables.php index 33e626ef3b..104b60df26 100644 --- a/app/config/variables.php +++ b/app/config/variables.php @@ -413,7 +413,7 @@ return [ 'variables' => [ [ 'name' => '_APP_SMS_PROVIDER', - 'description' => "Provider used for delivering SMS for Phone authentication. Use the following format: 'sms://[USER]:[SECRET]@[PROVIDER]'. \n\nAvailable providers are twilio, text-magic and telesign.", + 'description' => "Provider used for delivering SMS for Phone authentication. Use the following format: 'sms://[USER]:[SECRET]@[PROVIDER]'. \n\nAvailable providers are twilio, text-magic, telesign, msg91, and vonage.", 'introduction' => '0.15.0', 'default' => '', 'required' => false, diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index ef94b251c8..a4a5ec776f 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -938,7 +938,7 @@ App::post('/v1/account/sessions/phone') 'userId' => $user->getId(), 'userInternalId' => $user->getInternalId(), 'type' => Auth::TOKEN_TYPE_PHONE, - 'secret' => $secret, + 'secret' => Auth::hash($secret), 'expire' => $expire, 'userAgent' => $request->getUserAgent('UNKNOWN'), 'ip' => $request->getIP(), @@ -2266,7 +2266,7 @@ App::post('/v1/account/verification/phone') 'userId' => $user->getId(), 'userInternalId' => $user->getInternalId(), 'type' => Auth::TOKEN_TYPE_PHONE, - 'secret' => $secret, + 'secret' => Auth::hash($secret), 'expire' => $expire, 'userAgent' => $request->getUserAgent('UNKNOWN'), 'ip' => $request->getIP(), diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 0543654824..5f6b2b51bb 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -935,6 +935,67 @@ App::delete('/v1/functions/:functionId/deployments/:deploymentId') $response->noContent(); }); +App::post('/v1/functions/:functionId/deployments/:deploymentId/builds/:buildId') + ->groups(['api', 'functions']) + ->desc('Create Build') + ->label('scope', 'functions.write') + ->label('event', 'functions.[functionId].deployments.[deploymentId].update') + ->label('audits.event', 'deployment.update') + ->label('audits.resource', 'function/{request.functionId}') + ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) + ->label('sdk.namespace', 'functions') + ->label('sdk.method', 'createBuild') + ->label('sdk.description', '/docs/references/functions/create-build.md') + ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) + ->label('sdk.response.model', Response::MODEL_NONE) + ->param('functionId', '', new UID(), 'Function ID.') + ->param('deploymentId', '', new UID(), 'Deployment ID.') + ->param('buildId', '', new UID(), 'Build unique ID.') + ->inject('response') + ->inject('dbForProject') + ->inject('project') + ->inject('events') + ->action(function (string $functionId, string $deploymentId, string $buildId, Response $response, Database $dbForProject, Document $project, Event $events) { + + $function = $dbForProject->getDocument('functions', $functionId); + $deployment = $dbForProject->getDocument('deployments', $deploymentId); + + if ($function->isEmpty()) { + throw new Exception(Exception::FUNCTION_NOT_FOUND); + } + + if ($deployment->isEmpty()) { + throw new Exception(Exception::DEPLOYMENT_NOT_FOUND); + } + + $build = Authorization::skip(fn () => $dbForProject->getDocument('builds', $buildId)); + + if ($build->isEmpty()) { + throw new Exception(Exception::BUILD_NOT_FOUND); + } + + if ($build->getAttribute('status') !== 'failed') { + throw new Exception(Exception::BUILD_IN_PROGRESS, 'Build not failed'); + } + + $events + ->setParam('functionId', $function->getId()) + ->setParam('deploymentId', $deployment->getId()); + + // Retry the build + $buildEvent = new Build(); + $buildEvent + ->setType(BUILD_TYPE_RETRY) + ->setResource($function) + ->setDeployment($deployment) + ->setProject($project) + ->trigger(); + + $response->noContent(); + }); + + + App::post('/v1/functions/:functionId/executions') ->groups(['api', 'functions']) ->desc('Create Execution') @@ -1258,65 +1319,6 @@ App::get('/v1/functions/:functionId/executions/:executionId') $response->dynamic($execution, Response::MODEL_EXECUTION); }); -App::post('/v1/functions/:functionId/deployments/:deploymentId/builds/:buildId') - ->groups(['api', 'functions']) - ->desc('Retry Build') - ->label('scope', 'functions.write') - ->label('event', 'functions.[functionId].deployments.[deploymentId].update') - ->label('audits.event', 'deployment.update') - ->label('audits.resource', 'function/{request.functionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'retryBuild') - ->label('sdk.description', '/docs/references/functions/retry-build.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) - ->param('functionId', '', new UID(), 'Function ID.') - ->param('deploymentId', '', new UID(), 'Deployment ID.') - ->param('buildId', '', new UID(), 'Build unique ID.') - ->inject('response') - ->inject('dbForProject') - ->inject('project') - ->inject('events') - ->action(function (string $functionId, string $deploymentId, string $buildId, Response $response, Database $dbForProject, Document $project, Event $events) { - - $function = $dbForProject->getDocument('functions', $functionId); - $deployment = $dbForProject->getDocument('deployments', $deploymentId); - - if ($function->isEmpty()) { - throw new Exception(Exception::FUNCTION_NOT_FOUND); - } - - if ($deployment->isEmpty()) { - throw new Exception(Exception::DEPLOYMENT_NOT_FOUND); - } - - $build = Authorization::skip(fn () => $dbForProject->getDocument('builds', $buildId)); - - if ($build->isEmpty()) { - throw new Exception(Exception::BUILD_NOT_FOUND); - } - - if ($build->getAttribute('status') !== 'failed') { - throw new Exception(Exception::BUILD_IN_PROGRESS, 'Build not failed'); - } - - $events - ->setParam('functionId', $function->getId()) - ->setParam('deploymentId', $deployment->getId()); - - // Retry the build - $buildEvent = new Build(); - $buildEvent - ->setType(BUILD_TYPE_RETRY) - ->setResource($function) - ->setDeployment($deployment) - ->setProject($project) - ->trigger(); - - $response->noContent(); - }); - // Variables App::post('/v1/functions/:functionId/variables') diff --git a/composer.json b/composer.json index cad6b65fd2..973aec8539 100644 --- a/composer.json +++ b/composer.json @@ -77,7 +77,7 @@ } ], "require-dev": { - "appwrite/sdk-generator": "0.26.0", + "appwrite/sdk-generator": "0.28.*", "ext-fileinfo": "*", "phpunit/phpunit": "9.5.20", "squizlabs/php_codesniffer": "^3.6", diff --git a/composer.lock b/composer.lock index e16a1f6879..7d3444e417 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "fca1e9492b5c12b6dbf6607418ca8ec8", + "content-hash": "568151395a8877f87d9bdce048adc2dc", "packages": [ { "name": "adhocore/jwt", @@ -2840,16 +2840,16 @@ "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "0.26.0", + "version": "0.28.1", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "b356ccc0f0188422741fb79f2a52da087809ca26" + "reference": "ed8d3daa66589733b49b11c053d524cdf576ffee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/b356ccc0f0188422741fb79f2a52da087809ca26", - "reference": "b356ccc0f0188422741fb79f2a52da087809ca26", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/ed8d3daa66589733b49b11c053d524cdf576ffee", + "reference": "ed8d3daa66589733b49b11c053d524cdf576ffee", "shasum": "" }, "require": { @@ -2884,9 +2884,9 @@ "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", "support": { "issues": "https://github.com/appwrite/sdk-generator/issues", - "source": "https://github.com/appwrite/sdk-generator/tree/0.26.0" + "source": "https://github.com/appwrite/sdk-generator/tree/0.28.1" }, - "time": "2022-09-13T18:39:36+00:00" + "time": "2022-09-22T09:15:54+00:00" }, { "name": "doctrine/instantiator", diff --git a/docker-compose.ci.yml b/docker-compose.ci.yml new file mode 100644 index 0000000000..21d5e5d296 --- /dev/null +++ b/docker-compose.ci.yml @@ -0,0 +1,48 @@ +services: + appwrite: + image: appwrite-dev + + appwrite-realtime: + image: appwrite-dev + + appwrite-worker-audits: + image: appwrite-dev + + appwrite-worker-webhooks: + image: appwrite-dev + + appwrite-worker-deletes: + image: appwrite-dev + + appwrite-worker-databases: + image: appwrite-dev + + appwrite-worker-builds: + image: appwrite-dev + + appwrite-worker-certificates: + image: appwrite-dev + + appwrite-worker-functions: + image: appwrite-dev + + appwrite-executor: + image: appwrite-dev + + appwrite-worker-mails: + image: appwrite-dev + + appwrite-worker-messaging: + image: appwrite-dev + + appwrite-maintenance: + image: appwrite-dev + + appwrite-usage-timeseries: + image: appwrite-dev + + appwrite-usage-database: + image: appwrite-dev + + appwrite-schedule: + image: appwrite-dev diff --git a/docker-compose.yml b/docker-compose.yml index 32b46a17d2..b63273d4c4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -73,10 +73,10 @@ services: build: context: . args: - - DEBUG=false - - TESTING=true - - VERSION=dev - ports: + DEBUG: false + TESTING: true + VERSION: dev + ports: - 9501:80 networks: - appwrite @@ -833,7 +833,7 @@ services: # MailCatcher - An SMTP server. Catches all system emails and displays them in a nice UI. # RequestCatcher - An HTTP server. Catches all system https calls and displays them using a simple HTTP API. Used to debug & tests webhooks and HTTP tasks # RedisCommander - A nice UI for exploring Redis data - # Resque - A nice UI for exploring Reddis pub/sub, view the different queues workloads, pending and failed tasks + # Resque - A nice UI for exploring Redis pub/sub, view the different queues workloads, pending and failed tasks # Chronograf - A nice UI for exploring InfluxDB data # Webgrind - A nice UI for exploring and debugging code-level stuff diff --git a/phpunit.xml b/phpunit.xml index 4074fe0f1c..4012c8c276 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -6,7 +6,7 @@ convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" - stopOnFailure="true" + stopOnFailure="false" > diff --git a/src/Appwrite/Auth/Auth.php b/src/Appwrite/Auth/Auth.php index f4cea0166e..dbe74af0d2 100644 --- a/src/Appwrite/Auth/Auth.php +++ b/src/Appwrite/Auth/Auth.php @@ -336,7 +336,7 @@ class Auth $token->isSet('secret') && $token->isSet('expire') && $token->getAttribute('type') == Auth::TOKEN_TYPE_PHONE && - $token->getAttribute('secret') === $secret && + $token->getAttribute('secret') === self::hash($secret) && DateTime::formatTz($token->getAttribute('expire')) >= DateTime::formatTz(DateTime::now()) ) { return (string) $token->getId(); diff --git a/src/Appwrite/Extend/Exception.php b/src/Appwrite/Extend/Exception.php index a32bbb5e97..d25cfb0d40 100644 --- a/src/Appwrite/Extend/Exception.php +++ b/src/Appwrite/Extend/Exception.php @@ -12,7 +12,7 @@ class Exception extends \Exception * Naming the error types based on the following convention * _ * - * Appwrite has the follwing entities: + * Appwrite has the following entities: * - General * - Users * - Teams diff --git a/tests/e2e/Services/Functions/FunctionsCustomClientTest.php b/tests/e2e/Services/Functions/FunctionsCustomClientTest.php index 6a0d87c214..56b72e4468 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomClientTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomClientTest.php @@ -116,7 +116,7 @@ class FunctionsCustomClientTest extends Scope $this->assertEquals(202, $deployment['headers']['status-code']); // Wait for deployment to be built. - sleep(10); + sleep(20); $function = $this->client->call(Client::METHOD_PATCH, '/functions/' . $function['body']['$id'] . '/deployments/' . $deploymentId, [ 'content-type' => 'application/json', @@ -228,7 +228,7 @@ class FunctionsCustomClientTest extends Scope $deploymentId = $deployment['body']['$id'] ?? ''; // Wait for deployment to be built. - sleep(10); + sleep(20); $this->assertEquals(202, $deployment['headers']['status-code']); @@ -252,7 +252,7 @@ class FunctionsCustomClientTest extends Scope $executionId = $execution['body']['$id'] ?? ''; - sleep(10); + sleep(20); $executions = $this->client->call(Client::METHOD_GET, '/functions/' . $functionId . '/executions/' . $executionId, [ 'content-type' => 'application/json', @@ -326,7 +326,7 @@ class FunctionsCustomClientTest extends Scope $deploymentId = $deployment['body']['$id'] ?? ''; // Wait for deployment to be built. - sleep(10); + sleep(20); $this->assertEquals(202, $deployment['headers']['status-code']); @@ -395,7 +395,7 @@ class FunctionsCustomClientTest extends Scope $this->assertEquals(202, $execution['headers']['status-code']); - sleep(10); + sleep(20); $base = $this->client->call(Client::METHOD_GET, '/functions/' . $functionId . '/executions', [ 'content-type' => 'application/json', @@ -556,7 +556,7 @@ class FunctionsCustomClientTest extends Scope $this->assertEquals(202, $deployment['headers']['status-code']); // Wait for deployment to be built. - sleep(10); + sleep(20); $function = $this->client->call(Client::METHOD_PATCH, '/functions/' . $functionId . '/deployments/' . $deploymentId, [ 'content-type' => 'application/json', diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index 768c89ba27..9cae9af339 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -373,7 +373,7 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals('index.php', $deployment['body']['entrypoint']); // Wait for deployment to build. - sleep(30); + sleep(60); return array_merge($data, ['deploymentId' => $deploymentId]); } @@ -610,7 +610,7 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals('', $execution['body']['stderr']); $this->assertEquals(0, $execution['body']['duration']); - sleep(5); + sleep(10); $execution = $this->client->call(Client::METHOD_GET, '/functions/' . $data['functionId'] . '/executions/' . $executionId, array_merge([ 'content-type' => 'application/json', @@ -637,7 +637,7 @@ class FunctionsCustomServerTest extends Scope * Test for FAILURE */ - sleep(10); + sleep(20); return array_merge($data, ['executionId' => $executionId]); } @@ -881,7 +881,7 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(202, $deployment['headers']['status-code']); // Allow build step to run - sleep(20); + sleep(40); $execution = $this->client->call(Client::METHOD_POST, '/functions/' . $functionId . '/executions', array_merge([ 'content-type' => 'application/json', @@ -894,7 +894,7 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(202, $execution['headers']['status-code']); - sleep(10); + sleep(20); $executions = $this->client->call(Client::METHOD_GET, '/functions/' . $functionId . '/executions', array_merge([ 'content-type' => 'application/json', @@ -965,7 +965,7 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(202, $deployment['headers']['status-code']); // Allow build step to run - sleep(10); + sleep(20); $deployment = $this->client->call(Client::METHOD_PATCH, '/functions/' . $functionId . '/deployments/' . $deploymentId, array_merge([ 'content-type' => 'application/json', @@ -988,7 +988,7 @@ class FunctionsCustomServerTest extends Scope $executionId = $execution['body']['$id'] ?? ''; - sleep(10); + sleep(20); $executions = $this->client->call(Client::METHOD_GET, '/functions/' . $functionId . '/executions/' . $executionId, array_merge([ 'content-type' => 'application/json', @@ -1087,7 +1087,7 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(202, $deployment['headers']['status-code']); // Allow build step to run - sleep(10); + sleep(20); $execution = $this->client->call(Client::METHOD_POST, '/functions/' . $functionId . '/executions', array_merge([ 'content-type' => 'application/json', @@ -1103,7 +1103,7 @@ class FunctionsCustomServerTest extends Scope $executionId = $execution['body']['$id'] ?? ''; - sleep(10); + sleep(20); $executions = $this->client->call(Client::METHOD_GET, '/functions/' . $functionId . '/executions/' . $executionId, array_merge([ 'content-type' => 'application/json', @@ -1200,7 +1200,7 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(202, $deployment['headers']['status-code']); // Allow build step to run - sleep(30); + sleep(60); $execution = $this->client->call(Client::METHOD_POST, '/functions/' . $functionId . '/executions', array_merge([ 'content-type' => 'application/json', @@ -1216,7 +1216,7 @@ class FunctionsCustomServerTest extends Scope $executionId = $execution['body']['$id'] ?? ''; - sleep(30); + sleep(60); $executions = $this->client->call(Client::METHOD_GET, '/functions/' . $functionId . '/executions/' . $executionId, array_merge([ 'content-type' => 'application/json', @@ -1314,7 +1314,7 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(202, $deployment['headers']['status-code']); // Allow build step to run - sleep(40); + sleep(80); $execution = $this->client->call(Client::METHOD_POST, '/functions/' . $functionId . '/executions', array_merge([ 'content-type' => 'application/json', @@ -1330,7 +1330,7 @@ class FunctionsCustomServerTest extends Scope $executionId = $execution['body']['$id'] ?? ''; - sleep(10); + sleep(20); $executions = $this->client->call(Client::METHOD_GET, '/functions/' . $functionId . '/executions/' . $executionId, array_merge([ 'content-type' => 'application/json', @@ -1428,7 +1428,7 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(202, $deployment['headers']['status-code']); // Allow build step to run - sleep(30); + sleep(60); $execution = $this->client->call(Client::METHOD_POST, '/functions/' . $functionId . '/executions', array_merge([ 'content-type' => 'application/json', @@ -1444,7 +1444,7 @@ class FunctionsCustomServerTest extends Scope $executionId = $execution['body']['$id'] ?? ''; - sleep(10); + sleep(20); $executions = $this->client->call(Client::METHOD_GET, '/functions/' . $functionId . '/executions/' . $executionId, array_merge([ 'content-type' => 'application/json', diff --git a/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php b/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php index db520bf502..f2f4b27260 100644 --- a/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php +++ b/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php @@ -634,7 +634,7 @@ class WebhooksCustomServerTest extends Scope $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); // wait for timeout function to complete - sleep(10); + sleep(20); $webhook = $this->getLastRequest(); $signatureExpected = self::getWebhookSignature($webhook, $this->getProject()['signatureKey']);