From 9ad270ec14326cddb00bcd07d68f59ab7400cdfa Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 15 Sep 2022 19:38:00 +1200 Subject: [PATCH 01/21] Remove Android, Kotlin, Apple and Swift from beta --- app/config/platforms.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/config/platforms.php b/app/config/platforms.php index 8755f4614..502ec2850 100644 --- a/app/config/platforms.php +++ b/app/config/platforms.php @@ -85,7 +85,7 @@ return [ 'url' => 'https://github.com/appwrite/sdk-for-apple', 'package' => 'https://github.com/appwrite/sdk-for-apple', 'enabled' => true, - 'beta' => true, + 'beta' => false, 'dev' => false, 'hidden' => false, 'family' => APP_PLATFORM_CLIENT, @@ -120,7 +120,7 @@ return [ 'url' => 'https://github.com/appwrite/sdk-for-android', 'package' => 'https://search.maven.org/artifact/io.appwrite/sdk-for-android', 'enabled' => true, - 'beta' => true, + 'beta' => false, 'dev' => false, 'hidden' => false, 'family' => APP_PLATFORM_CLIENT, @@ -374,7 +374,7 @@ return [ 'url' => 'https://github.com/appwrite/sdk-for-kotlin', 'package' => 'https://search.maven.org/artifact/io.appwrite/sdk-for-kotlin', 'enabled' => true, - 'beta' => true, + 'beta' => false, 'dev' => false, 'hidden' => false, 'family' => APP_PLATFORM_SERVER, @@ -396,7 +396,7 @@ return [ 'url' => 'https://github.com/appwrite/sdk-for-swift', 'package' => 'https://github.com/appwrite/sdk-for-swift', 'enabled' => true, - 'beta' => true, + 'beta' => false, 'dev' => false, 'hidden' => false, 'family' => APP_PLATFORM_SERVER, From 97df10e6b8ae1db39c7644f943f17646661723de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 17 Oct 2022 11:45:38 +0000 Subject: [PATCH 02/21] Fix project pagination in usage containers --- CHANGES.md | 4 ++++ src/Appwrite/Usage/Calculators/Database.php | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 5e742d140..3856038c8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,7 @@ +# Version 1.0.4 + +- Fix project pagination in DB usage collector [#X](X) + # Version 1.0.3 ## Bugs - Fix document audit deletion [#4429](https://github.com/appwrite/appwrite/pull/4429) diff --git a/src/Appwrite/Usage/Calculators/Database.php b/src/Appwrite/Usage/Calculators/Database.php index 74179fab0..85dcae319 100644 --- a/src/Appwrite/Usage/Calculators/Database.php +++ b/src/Appwrite/Usage/Calculators/Database.php @@ -132,7 +132,6 @@ class Database extends Calculator $results = []; $sum = $limit; $latestDocument = null; - $this->database->setNamespace('_' . $projectId); while ($sum === $limit) { try { @@ -140,6 +139,8 @@ class Database extends Calculator if ($latestDocument !== null) { $paginationQueries[] = Query::cursorAfter($latestDocument); } + + $this->database->setNamespace('_' . $projectId); $results = $this->database->find($collection, \array_merge($paginationQueries, $queries)); } catch (\Exception $e) { if (is_callable($this->errorHandler)) { From 837422145dbce146d62bebed8eca4cca35ace19b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 17 Oct 2022 11:46:42 +0000 Subject: [PATCH 03/21] Update changelog url --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 3856038c8..daee820eb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,6 @@ # Version 1.0.4 -- Fix project pagination in DB usage collector [#X](X) +- Fix project pagination in DB usage collector [#4517](https://github.com/appwrite/appwrite/pull/4517) # Version 1.0.3 ## Bugs From 32f2333ab6656e744c0d15374cb66b3adb262a40 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Wed, 26 Oct 2022 16:38:40 +0200 Subject: [PATCH 04/21] test: mysql adapter --- app/controllers/api/databases.php | 2 +- app/init.php | 2 +- app/realtime.php | 2 +- app/tasks/maintenance.php | 2 +- app/tasks/migrate.php | 2 +- app/tasks/usage.php | 2 +- docker-compose.yml | 2 +- src/Appwrite/Resque/Worker.php | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 19264454e..ec8a479ae 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -20,7 +20,7 @@ use Utopia\Database\Database; use Utopia\Database\Document; use Utopia\Database\DateTime; use Utopia\Database\Query; -use Utopia\Database\Adapter\MariaDB; +use Utopia\Database\Adapter\MySQL as MariaDB; use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\Permissions; diff --git a/app/init.php b/app/init.php index 054721d43..a9893801c 100644 --- a/app/init.php +++ b/app/init.php @@ -52,7 +52,7 @@ use MaxMind\Db\Reader; use PHPMailer\PHPMailer\PHPMailer; use Utopia\Cache\Adapter\Redis as RedisCache; use Utopia\Cache\Cache; -use Utopia\Database\Adapter\MariaDB; +use Utopia\Database\Adapter\MySQL as MariaDB; use Utopia\Database\Document; use Utopia\Database\Database; use Utopia\Database\Validator\Structure; diff --git a/app/realtime.php b/app/realtime.php index be87c3d6e..21ebb02d9 100644 --- a/app/realtime.php +++ b/app/realtime.php @@ -20,7 +20,7 @@ use Utopia\Database\Database; use Utopia\Database\DateTime; use Utopia\Cache\Adapter\Redis as RedisCache; use Utopia\Cache\Cache; -use Utopia\Database\Adapter\MariaDB; +use Utopia\Database\Adapter\MySQL as MariaDB; use Utopia\Database\Document; use Utopia\Database\Query; use Utopia\Database\Validator\Authorization; diff --git a/app/tasks/maintenance.php b/app/tasks/maintenance.php index 42b5ed00d..02445e117 100644 --- a/app/tasks/maintenance.php +++ b/app/tasks/maintenance.php @@ -9,7 +9,7 @@ use Appwrite\Event\Delete; use Utopia\App; use Utopia\Cache\Cache; use Utopia\CLI\Console; -use Utopia\Database\Adapter\MariaDB; +use Utopia\Database\Adapter\MySQL as MariaDB; use Utopia\Database\Database; use Utopia\Database\DateTime; use Utopia\Cache\Adapter\Redis as RedisCache; diff --git a/app/tasks/migrate.php b/app/tasks/migrate.php index f0ab71a96..53e101c53 100644 --- a/app/tasks/migrate.php +++ b/app/tasks/migrate.php @@ -7,7 +7,7 @@ use Appwrite\Migration\Migration; use Utopia\App; use Utopia\Cache\Cache; use Utopia\Cache\Adapter\Redis as RedisCache; -use Utopia\Database\Adapter\MariaDB; +use Utopia\Database\Adapter\MySQL as MariaDB; use Utopia\Database\Database; use Utopia\Database\Query; use Utopia\Database\Validator\Authorization; diff --git a/app/tasks/usage.php b/app/tasks/usage.php index 48876557a..7b8d20b0f 100644 --- a/app/tasks/usage.php +++ b/app/tasks/usage.php @@ -12,7 +12,7 @@ use Utopia\App; use Utopia\Cache\Adapter\Redis as RedisCache; use Utopia\Cache\Cache; use Utopia\CLI\Console; -use Utopia\Database\Adapter\MariaDB; +use Utopia\Database\Adapter\MySQL as MariaDB; use Utopia\Database\Database as UtopiaDatabase; use Utopia\Database\Validator\Authorization; use Utopia\Registry\Registry; diff --git a/docker-compose.yml b/docker-compose.yml index ea9241a9d..1785af59c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -693,7 +693,7 @@ services: - _APP_REDIS_PASS mariadb: - image: mariadb:10.7 # fix issues when upgrading using: mysql_upgrade -u root -p + image: mysql:8.0.31 # fix issues when upgrading using: mysql_upgrade -u root -p container_name: appwrite-mariadb <<: *x-logging networks: diff --git a/src/Appwrite/Resque/Worker.php b/src/Appwrite/Resque/Worker.php index dd7cebd08..6c1ac478c 100644 --- a/src/Appwrite/Resque/Worker.php +++ b/src/Appwrite/Resque/Worker.php @@ -7,7 +7,7 @@ use Utopia\Cache\Cache; use Utopia\Cache\Adapter\Redis as RedisCache; use Utopia\CLI\Console; use Utopia\Database\Database; -use Utopia\Database\Adapter\MariaDB; +use Utopia\Database\Adapter\MySQL as MariaDB; use Utopia\Storage\Device; use Utopia\Storage\Storage; use Utopia\Storage\Device\Local; From 08e44f065646d7ab174a5b56395c4ae60c2c2720 Mon Sep 17 00:00:00 2001 From: fogelito Date: Wed, 26 Oct 2022 22:14:39 +0300 Subject: [PATCH 05/21] some changes --- app/config/collections.php | 32 ++-- composer.json | 4 +- composer.lock | 354 ++++--------------------------------- 3 files changed, 57 insertions(+), 333 deletions(-) diff --git a/app/config/collections.php b/app/config/collections.php index d8f65da78..f2904065c 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -2076,7 +2076,7 @@ $collections = [ '$id' => ID::custom('name'), 'type' => Database::VAR_STRING, 'format' => '', - 'size' => 2048, + 'size' => 128, 'signed' => true, 'required' => false, 'default' => null, @@ -2209,14 +2209,14 @@ $collections = [ '$id' => ID::custom('_key_search'), 'type' => Database::INDEX_FULLTEXT, 'attributes' => ['search'], - 'lengths' => [2048], + 'lengths' => [], 'orders' => [Database::ORDER_ASC], ], [ '$id' => ID::custom('_key_name'), 'type' => Database::INDEX_KEY, 'attributes' => ['name'], - 'lengths' => [2048], + 'lengths' => [], 'orders' => [Database::ORDER_ASC], ], [ @@ -2230,21 +2230,21 @@ $collections = [ '$id' => ID::custom('_key_runtime'), 'type' => Database::INDEX_KEY, 'attributes' => ['runtime'], - 'lengths' => [2048], + 'lengths' => [70], 'orders' => [Database::ORDER_ASC], ], [ '$id' => ID::custom('_key_deployment'), 'type' => Database::INDEX_KEY, 'attributes' => ['deployment'], - 'lengths' => [Database::LENGTH_KEY], + 'lengths' => [], 'orders' => [Database::ORDER_ASC], ], [ '$id' => ID::custom('_key_schedule'), 'type' => Database::INDEX_KEY, 'attributes' => ['schedule'], - 'lengths' => [128], + 'lengths' => [], 'orders' => [Database::ORDER_ASC], ], [ @@ -2403,14 +2403,14 @@ $collections = [ '$id' => ID::custom('_key_resource'), 'type' => Database::INDEX_KEY, 'attributes' => ['resourceId'], - 'lengths' => [Database::LENGTH_KEY], + 'lengths' => [], 'orders' => [Database::ORDER_ASC], ], [ '$id' => ID::custom('_key_resource_type'), 'type' => Database::INDEX_KEY, 'attributes' => ['resourceType'], - 'lengths' => [Database::LENGTH_KEY], + 'lengths' => [], 'orders' => [Database::ORDER_ASC], ], [ @@ -2424,7 +2424,7 @@ $collections = [ '$id' => ID::custom('_key_entrypoint'), 'type' => Database::INDEX_KEY, 'attributes' => ['entrypoint'], - 'lengths' => [2048], + 'lengths' => [768], 'orders' => [Database::ORDER_ASC], ], [ @@ -2438,7 +2438,7 @@ $collections = [ '$id' => ID::custom('_key_buildId'), 'type' => Database::INDEX_KEY, 'attributes' => ['buildId'], - 'lengths' => [Database::LENGTH_KEY], + 'lengths' => [], 'orders' => [Database::ORDER_ASC], ], [ @@ -2939,14 +2939,14 @@ $collections = [ '$id' => ID::custom('_fulltext_name'), 'type' => Database::INDEX_FULLTEXT, 'attributes' => ['name'], - 'lengths' => [1024], + 'lengths' => [], 'orders' => [Database::ORDER_ASC], ], [ '$id' => ID::custom('_key_search'), 'type' => Database::INDEX_FULLTEXT, 'attributes' => ['search'], - 'lengths' => [2048], + 'lengths' => [768], 'orders' => [Database::ORDER_ASC], ], [ @@ -2960,7 +2960,7 @@ $collections = [ '$id' => ID::custom('_key_name'), 'type' => Database::INDEX_KEY, 'attributes' => ['name'], - 'lengths' => [128], + 'lengths' => [], 'orders' => [Database::ORDER_ASC], ], [ @@ -3397,21 +3397,21 @@ $collections = [ '$id' => ID::custom('_key_name'), 'type' => Database::INDEX_KEY, 'attributes' => ['name'], - 'lengths' => [2048], + 'lengths' => [768], 'orders' => [Database::ORDER_ASC], ], [ '$id' => ID::custom('_key_signature'), 'type' => Database::INDEX_KEY, 'attributes' => ['signature'], - 'lengths' => [2048], + 'lengths' => [768], 'orders' => [Database::ORDER_ASC], ], [ '$id' => ID::custom('_key_mimeType'), 'type' => Database::INDEX_KEY, 'attributes' => ['mimeType'], - 'lengths' => [127], + 'lengths' => [], 'orders' => [Database::ORDER_ASC], ], [ diff --git a/composer.json b/composer.json index 47317ed5e..c7eabd88b 100644 --- a/composer.json +++ b/composer.json @@ -48,10 +48,10 @@ "utopia-php/abuse": "0.14.*", "utopia-php/analytics": "0.2.*", "utopia-php/audit": "0.15.*", - "utopia-php/cache": "0.6.*", + "utopia-php/cache": "0.6.0 as 0.7.0", "utopia-php/cli": "0.13.*", "utopia-php/config": "0.2.*", - "utopia-php/database": "0.26.*", + "utopia-php/database": "0.27.1 as 0.26.99", "utopia-php/locale": "0.4.*", "utopia-php/registry": "0.5.*", "utopia-php/preloader": "0.2.*", diff --git a/composer.lock b/composer.lock index f6f29452a..bcdd4493f 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": "08fdd139ad1285b02c4b4e555679e7de", + "content-hash": "ba3dec52b69a3781e59167a83df50503", "packages": [ { "name": "adhocore/jwt", @@ -345,79 +345,6 @@ }, "time": "2022-06-20T22:56:59+00:00" }, - { - "name": "composer/package-versions-deprecated", - "version": "1.11.99.5", - "source": { - "type": "git", - "url": "https://github.com/composer/package-versions-deprecated.git", - "reference": "b4f54f74ef3453349c24a845d22392cd31e65f1d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/b4f54f74ef3453349c24a845d22392cd31e65f1d", - "reference": "b4f54f74ef3453349c24a845d22392cd31e65f1d", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.1.0 || ^2.0", - "php": "^7 || ^8" - }, - "replace": { - "ocramius/package-versions": "1.11.99" - }, - "require-dev": { - "composer/composer": "^1.9.3 || ^2.0@dev", - "ext-zip": "^1.13", - "phpunit/phpunit": "^6.5 || ^7" - }, - "type": "composer-plugin", - "extra": { - "class": "PackageVersions\\Installer", - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "PackageVersions\\": "src/PackageVersions" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be" - } - ], - "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", - "support": { - "issues": "https://github.com/composer/package-versions-deprecated/issues", - "source": "https://github.com/composer/package-versions-deprecated/tree/1.11.99.5" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2022-01-17T14:14:24+00:00" - }, { "name": "dragonmantank/cron-expression", "version": "v3.3.1", @@ -693,16 +620,16 @@ }, { "name": "guzzlehttp/psr7", - "version": "2.4.1", + "version": "2.4.3", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "69568e4293f4fa993f3b0e51c9723e1e17c41379" + "reference": "67c26b443f348a51926030c83481b85718457d3d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/69568e4293f4fa993f3b0e51c9723e1e17c41379", - "reference": "69568e4293f4fa993f3b0e51c9723e1e17c41379", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/67c26b443f348a51926030c83481b85718457d3d", + "reference": "67c26b443f348a51926030c83481b85718457d3d", "shasum": "" }, "require": { @@ -792,7 +719,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.4.1" + "source": "https://github.com/guzzle/psr7/tree/2.4.3" }, "funding": [ { @@ -808,7 +735,7 @@ "type": "tidelift" } ], - "time": "2022-08-28T14:45:39+00:00" + "time": "2022-10-26T14:07:24+00:00" }, { "name": "influxdb/influxdb-php", @@ -876,61 +803,6 @@ }, "time": "2020-12-26T17:45:17+00:00" }, - { - "name": "jean85/pretty-package-versions", - "version": "1.6.0", - "source": { - "type": "git", - "url": "https://github.com/Jean85/pretty-package-versions.git", - "reference": "1e0104b46f045868f11942aea058cd7186d6c303" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/1e0104b46f045868f11942aea058cd7186d6c303", - "reference": "1e0104b46f045868f11942aea058cd7186d6c303", - "shasum": "" - }, - "require": { - "composer/package-versions-deprecated": "^1.8.0", - "php": "^7.0|^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0|^8.5|^9.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Jean85\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Alessandro Lai", - "email": "alessandro.lai85@gmail.com" - } - ], - "description": "A wrapper for ocramius/package-versions to get pretty versions strings", - "keywords": [ - "composer", - "package", - "release", - "versions" - ], - "support": { - "issues": "https://github.com/Jean85/pretty-package-versions/issues", - "source": "https://github.com/Jean85/pretty-package-versions/tree/1.6.0" - }, - "time": "2021-02-04T16:20:16+00:00" - }, { "name": "matomo/device-detector", "version": "6.0.0", @@ -1000,74 +872,6 @@ }, "time": "2022-04-11T09:58:17+00:00" }, - { - "name": "mongodb/mongodb", - "version": "1.8.0", - "source": { - "type": "git", - "url": "https://github.com/mongodb/mongo-php-library.git", - "reference": "953dbc19443aa9314c44b7217a16873347e6840d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mongodb/mongo-php-library/zipball/953dbc19443aa9314c44b7217a16873347e6840d", - "reference": "953dbc19443aa9314c44b7217a16873347e6840d", - "shasum": "" - }, - "require": { - "ext-hash": "*", - "ext-json": "*", - "ext-mongodb": "^1.8.1", - "jean85/pretty-package-versions": "^1.2", - "php": "^7.0 || ^8.0", - "symfony/polyfill-php80": "^1.19" - }, - "require-dev": { - "squizlabs/php_codesniffer": "^3.5, <3.5.5", - "symfony/phpunit-bridge": "5.x-dev" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.8.x-dev" - } - }, - "autoload": { - "files": [ - "src/functions.php" - ], - "psr-4": { - "MongoDB\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Andreas Braun", - "email": "andreas.braun@mongodb.com" - }, - { - "name": "Jeremy Mikola", - "email": "jmikola@gmail.com" - } - ], - "description": "MongoDB driver library", - "homepage": "https://jira.mongodb.org/browse/PHPLIB", - "keywords": [ - "database", - "driver", - "mongodb", - "persistence" - ], - "support": { - "issues": "https://github.com/mongodb/mongo-php-library/issues", - "source": "https://github.com/mongodb/mongo-php-library/tree/1.8.0" - }, - "time": "2020-11-25T12:26:02+00:00" - }, { "name": "mustangostang/spyc", "version": "0.6.3", @@ -1656,89 +1460,6 @@ ], "time": "2022-02-25T11:15:52+00:00" }, - { - "name": "symfony/polyfill-php80", - "version": "v1.26.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-05-10T07:21:04+00:00" - }, { "name": "utopia-php/abuse", "version": "0.14.0", @@ -1897,16 +1618,16 @@ }, { "name": "utopia-php/cache", - "version": "0.6.1", + "version": "0.6.0", "source": { "type": "git", "url": "https://github.com/utopia-php/cache.git", - "reference": "9889235a6d3da6cbb1f435201529da4d27c30e79" + "reference": "8ea1353a4bbab617e23c865a7c97b60d8074aee3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/cache/zipball/9889235a6d3da6cbb1f435201529da4d27c30e79", - "reference": "9889235a6d3da6cbb1f435201529da4d27c30e79", + "url": "https://api.github.com/repos/utopia-php/cache/zipball/8ea1353a4bbab617e23c865a7c97b60d8074aee3", + "reference": "8ea1353a4bbab617e23c865a7c97b60d8074aee3", "shasum": "" }, "require": { @@ -1944,9 +1665,9 @@ ], "support": { "issues": "https://github.com/utopia-php/cache/issues", - "source": "https://github.com/utopia-php/cache/tree/0.6.1" + "source": "https://github.com/utopia-php/cache/tree/0.6.0" }, - "time": "2022-08-10T08:12:46+00:00" + "time": "2022-04-04T12:30:05+00:00" }, { "name": "utopia-php/cli", @@ -2054,29 +1775,29 @@ }, { "name": "utopia-php/database", - "version": "0.26.0", + "version": "0.27.1", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "d172af2541137c83a86d066f82f48914b5a3a610" + "reference": "7e6ee3002a66ba94d1644b6fdfd668248132b527" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/d172af2541137c83a86d066f82f48914b5a3a610", - "reference": "d172af2541137c83a86d066f82f48914b5a3a610", + "url": "https://api.github.com/repos/utopia-php/database/zipball/7e6ee3002a66ba94d1644b6fdfd668248132b527", + "reference": "7e6ee3002a66ba94d1644b6fdfd668248132b527", "shasum": "" }, "require": { - "ext-mongodb": "*", - "ext-pdo": "*", - "ext-redis": "*", - "mongodb/mongodb": "1.8.0", "php": ">=8.0", - "utopia-php/cache": "0.6.*", + "utopia-php/cache": "0.7.*", "utopia-php/framework": "0.*.*" }, "require-dev": { + "ext-mongodb": "*", + "ext-pdo": "*", + "ext-redis": "*", "fakerphp/faker": "^1.14", + "mongodb/mongodb": "1.8.0", "phpunit/phpunit": "^9.4", "swoole/ide-helper": "4.8.0", "utopia-php/cli": "^0.11.0", @@ -2092,16 +1813,6 @@ "license": [ "MIT" ], - "authors": [ - { - "name": "Eldad Fux", - "email": "eldad@appwrite.io" - }, - { - "name": "Brandon Leckemby", - "email": "brandon@appwrite.io" - } - ], "description": "A simple library to manage application persistency using multiple database adapters", "keywords": [ "database", @@ -2112,9 +1823,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.26.0" + "source": "https://github.com/utopia-php/database/tree/0.27.1" }, - "time": "2022-10-03T17:12:01+00:00" + "time": "2022-10-26T18:19:32+00:00" }, { "name": "utopia-php/domains", @@ -5357,7 +5068,20 @@ "time": "2022-09-28T08:42:51+00:00" } ], - "aliases": [], + "aliases": [ + { + "package": "utopia-php/cache", + "version": "0.6.0.0", + "alias": "0.7.0", + "alias_normalized": "0.7.0.0" + }, + { + "package": "utopia-php/database", + "version": "0.27.1.0", + "alias": "0.26.99", + "alias_normalized": "0.26.99.0" + } + ], "minimum-stability": "stable", "stability-flags": [], "prefer-stable": false, @@ -5383,5 +5107,5 @@ "platform-overrides": { "php": "8.0" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.2.0" } From 8e8801b11cb27dc2bea75ac444eee0f94635be1b Mon Sep 17 00:00:00 2001 From: fogelito Date: Wed, 26 Oct 2022 23:05:25 +0300 Subject: [PATCH 06/21] adapter change --- app/controllers/api/databases.php | 2 +- app/init.php | 2 +- app/realtime.php | 2 +- app/tasks/maintenance.php | 2 +- app/tasks/migrate.php | 2 +- app/tasks/usage.php | 2 +- src/Appwrite/Resque/Worker.php | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index ec8a479ae..19264454e 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -20,7 +20,7 @@ use Utopia\Database\Database; use Utopia\Database\Document; use Utopia\Database\DateTime; use Utopia\Database\Query; -use Utopia\Database\Adapter\MySQL as MariaDB; +use Utopia\Database\Adapter\MariaDB; use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\Permissions; diff --git a/app/init.php b/app/init.php index a9893801c..054721d43 100644 --- a/app/init.php +++ b/app/init.php @@ -52,7 +52,7 @@ use MaxMind\Db\Reader; use PHPMailer\PHPMailer\PHPMailer; use Utopia\Cache\Adapter\Redis as RedisCache; use Utopia\Cache\Cache; -use Utopia\Database\Adapter\MySQL as MariaDB; +use Utopia\Database\Adapter\MariaDB; use Utopia\Database\Document; use Utopia\Database\Database; use Utopia\Database\Validator\Structure; diff --git a/app/realtime.php b/app/realtime.php index 21ebb02d9..be87c3d6e 100644 --- a/app/realtime.php +++ b/app/realtime.php @@ -20,7 +20,7 @@ use Utopia\Database\Database; use Utopia\Database\DateTime; use Utopia\Cache\Adapter\Redis as RedisCache; use Utopia\Cache\Cache; -use Utopia\Database\Adapter\MySQL as MariaDB; +use Utopia\Database\Adapter\MariaDB; use Utopia\Database\Document; use Utopia\Database\Query; use Utopia\Database\Validator\Authorization; diff --git a/app/tasks/maintenance.php b/app/tasks/maintenance.php index 02445e117..42b5ed00d 100644 --- a/app/tasks/maintenance.php +++ b/app/tasks/maintenance.php @@ -9,7 +9,7 @@ use Appwrite\Event\Delete; use Utopia\App; use Utopia\Cache\Cache; use Utopia\CLI\Console; -use Utopia\Database\Adapter\MySQL as MariaDB; +use Utopia\Database\Adapter\MariaDB; use Utopia\Database\Database; use Utopia\Database\DateTime; use Utopia\Cache\Adapter\Redis as RedisCache; diff --git a/app/tasks/migrate.php b/app/tasks/migrate.php index 53e101c53..f0ab71a96 100644 --- a/app/tasks/migrate.php +++ b/app/tasks/migrate.php @@ -7,7 +7,7 @@ use Appwrite\Migration\Migration; use Utopia\App; use Utopia\Cache\Cache; use Utopia\Cache\Adapter\Redis as RedisCache; -use Utopia\Database\Adapter\MySQL as MariaDB; +use Utopia\Database\Adapter\MariaDB; use Utopia\Database\Database; use Utopia\Database\Query; use Utopia\Database\Validator\Authorization; diff --git a/app/tasks/usage.php b/app/tasks/usage.php index 7b8d20b0f..48876557a 100644 --- a/app/tasks/usage.php +++ b/app/tasks/usage.php @@ -12,7 +12,7 @@ use Utopia\App; use Utopia\Cache\Adapter\Redis as RedisCache; use Utopia\Cache\Cache; use Utopia\CLI\Console; -use Utopia\Database\Adapter\MySQL as MariaDB; +use Utopia\Database\Adapter\MariaDB; use Utopia\Database\Database as UtopiaDatabase; use Utopia\Database\Validator\Authorization; use Utopia\Registry\Registry; diff --git a/src/Appwrite/Resque/Worker.php b/src/Appwrite/Resque/Worker.php index 6c1ac478c..dd7cebd08 100644 --- a/src/Appwrite/Resque/Worker.php +++ b/src/Appwrite/Resque/Worker.php @@ -7,7 +7,7 @@ use Utopia\Cache\Cache; use Utopia\Cache\Adapter\Redis as RedisCache; use Utopia\CLI\Console; use Utopia\Database\Database; -use Utopia\Database\Adapter\MySQL as MariaDB; +use Utopia\Database\Adapter\MariaDB; use Utopia\Storage\Device; use Utopia\Storage\Storage; use Utopia\Storage\Device\Local; From 013f4d55c275e0fe72b59d06f8ec3afaa6c8b53d Mon Sep 17 00:00:00 2001 From: fogelito Date: Wed, 26 Oct 2022 23:07:04 +0300 Subject: [PATCH 07/21] docker-compose.yml --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 1785af59c..ea9241a9d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -693,7 +693,7 @@ services: - _APP_REDIS_PASS mariadb: - image: mysql:8.0.31 # fix issues when upgrading using: mysql_upgrade -u root -p + image: mariadb:10.7 # fix issues when upgrading using: mysql_upgrade -u root -p container_name: appwrite-mariadb <<: *x-logging networks: From a5e67db604ba8912450554e5e29c61656728ced3 Mon Sep 17 00:00:00 2001 From: fogelito Date: Wed, 26 Oct 2022 23:12:46 +0300 Subject: [PATCH 08/21] fulltext --- app/config/collections.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/config/collections.php b/app/config/collections.php index f2904065c..17c7bef35 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -2230,7 +2230,7 @@ $collections = [ '$id' => ID::custom('_key_runtime'), 'type' => Database::INDEX_KEY, 'attributes' => ['runtime'], - 'lengths' => [70], + 'lengths' => [768], 'orders' => [Database::ORDER_ASC], ], [ @@ -2946,7 +2946,7 @@ $collections = [ '$id' => ID::custom('_key_search'), 'type' => Database::INDEX_FULLTEXT, 'attributes' => ['search'], - 'lengths' => [768], + 'lengths' => [], 'orders' => [Database::ORDER_ASC], ], [ @@ -3383,7 +3383,7 @@ $collections = [ '$id' => ID::custom('_key_search'), 'type' => Database::INDEX_FULLTEXT, 'attributes' => ['search'], - 'lengths' => [2048], + 'lengths' => [], 'orders' => [Database::ORDER_ASC], ], [ From 049e3a26461c29ac1b89dcf045501c50b064d298 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 31 Oct 2022 18:11:55 +1300 Subject: [PATCH 09/21] 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 10/21] 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 11/21] 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 From 983f885b3f7ddf3f3133e0cc4b0d2d0eaf0716b7 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Mon, 31 Oct 2022 12:47:41 +0100 Subject: [PATCH 12/21] fix: builds worker buildTime --- app/workers/builds.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/workers/builds.php b/app/workers/builds.php index f31db88ab..5f33ed401 100644 --- a/app/workers/builds.php +++ b/app/workers/builds.php @@ -183,7 +183,6 @@ class BuildsV1 extends Worker /* Also update the deployment buildTime */ $deployment->setAttribute('buildTime', $response['duration']); - $deployment = $dbForProject->updateDocument('deployments', $deployment->getId(), $deployment); Console::success("Build id: $buildId created"); From aff7c59097e7a87f8f91cb6b6290de5c34435b94 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 31 Oct 2022 12:02:51 +0000 Subject: [PATCH 13/21] feat: update database library --- app/controllers/api/projects.php | 2 +- app/http.php | 2 +- app/preload.php | 1 + composer.json | 4 +- composer.lock | 368 ++++--------------------------- 5 files changed, 46 insertions(+), 331 deletions(-) diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index bfea863d2..360f0be81 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -125,7 +125,7 @@ App::post('/v1/projects') $collections = Config::getParam('collections', []); $dbForProject->setNamespace("_{$project->getInternalId()}"); - $dbForProject->create(App::getEnv('_APP_DB_SCHEMA', 'appwrite')); + $dbForProject->create(); $audit = new Audit($dbForProject); $audit->setup(); diff --git a/app/http.php b/app/http.php index 4d15cab30..f27bf8235 100644 --- a/app/http.php +++ b/app/http.php @@ -94,7 +94,7 @@ $http->on('start', function (Server $http) use ($payloadSize, $register) { try { $redis->flushAll(); Console::success('[Setup] - Creating database: appwrite...'); - $dbForConsole->create(App::getEnv('_APP_DB_SCHEMA', 'appwrite')); + $dbForConsole->create(); } catch (\Exception $e) { Console::success('[Setup] - Skip: metadata table already exists'); } diff --git a/app/preload.php b/app/preload.php index bf8b0bfd1..878993641 100644 --- a/app/preload.php +++ b/app/preload.php @@ -35,6 +35,7 @@ foreach ( realpath(__DIR__ . '/../vendor/symfony'), realpath(__DIR__ . '/../vendor/mongodb'), realpath(__DIR__ . '/../vendor/utopia-php/websocket'), // TODO: remove workerman autoload + realpath(__DIR__ . '/../vendor/utopia-php/cache'), // TODO: remove memcache autoload ] as $key => $value ) { if ($value !== false) { diff --git a/composer.json b/composer.json index 47317ed5e..119ab4e75 100644 --- a/composer.json +++ b/composer.json @@ -48,10 +48,10 @@ "utopia-php/abuse": "0.14.*", "utopia-php/analytics": "0.2.*", "utopia-php/audit": "0.15.*", - "utopia-php/cache": "0.6.*", + "utopia-php/cache": "0.8.0", "utopia-php/cli": "0.13.*", "utopia-php/config": "0.2.*", - "utopia-php/database": "0.26.*", + "utopia-php/database": "0.28.0 as 0.26.99", "utopia-php/locale": "0.4.*", "utopia-php/registry": "0.5.*", "utopia-php/preloader": "0.2.*", diff --git a/composer.lock b/composer.lock index f6f29452a..c89a75387 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": "08fdd139ad1285b02c4b4e555679e7de", + "content-hash": "4b2113389eee450c7c21cbaecd3ca6d1", "packages": [ { "name": "adhocore/jwt", @@ -345,79 +345,6 @@ }, "time": "2022-06-20T22:56:59+00:00" }, - { - "name": "composer/package-versions-deprecated", - "version": "1.11.99.5", - "source": { - "type": "git", - "url": "https://github.com/composer/package-versions-deprecated.git", - "reference": "b4f54f74ef3453349c24a845d22392cd31e65f1d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/b4f54f74ef3453349c24a845d22392cd31e65f1d", - "reference": "b4f54f74ef3453349c24a845d22392cd31e65f1d", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.1.0 || ^2.0", - "php": "^7 || ^8" - }, - "replace": { - "ocramius/package-versions": "1.11.99" - }, - "require-dev": { - "composer/composer": "^1.9.3 || ^2.0@dev", - "ext-zip": "^1.13", - "phpunit/phpunit": "^6.5 || ^7" - }, - "type": "composer-plugin", - "extra": { - "class": "PackageVersions\\Installer", - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "PackageVersions\\": "src/PackageVersions" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be" - } - ], - "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", - "support": { - "issues": "https://github.com/composer/package-versions-deprecated/issues", - "source": "https://github.com/composer/package-versions-deprecated/tree/1.11.99.5" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2022-01-17T14:14:24+00:00" - }, { "name": "dragonmantank/cron-expression", "version": "v3.3.1", @@ -693,16 +620,16 @@ }, { "name": "guzzlehttp/psr7", - "version": "2.4.1", + "version": "2.4.3", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "69568e4293f4fa993f3b0e51c9723e1e17c41379" + "reference": "67c26b443f348a51926030c83481b85718457d3d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/69568e4293f4fa993f3b0e51c9723e1e17c41379", - "reference": "69568e4293f4fa993f3b0e51c9723e1e17c41379", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/67c26b443f348a51926030c83481b85718457d3d", + "reference": "67c26b443f348a51926030c83481b85718457d3d", "shasum": "" }, "require": { @@ -792,7 +719,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.4.1" + "source": "https://github.com/guzzle/psr7/tree/2.4.3" }, "funding": [ { @@ -808,7 +735,7 @@ "type": "tidelift" } ], - "time": "2022-08-28T14:45:39+00:00" + "time": "2022-10-26T14:07:24+00:00" }, { "name": "influxdb/influxdb-php", @@ -876,61 +803,6 @@ }, "time": "2020-12-26T17:45:17+00:00" }, - { - "name": "jean85/pretty-package-versions", - "version": "1.6.0", - "source": { - "type": "git", - "url": "https://github.com/Jean85/pretty-package-versions.git", - "reference": "1e0104b46f045868f11942aea058cd7186d6c303" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/1e0104b46f045868f11942aea058cd7186d6c303", - "reference": "1e0104b46f045868f11942aea058cd7186d6c303", - "shasum": "" - }, - "require": { - "composer/package-versions-deprecated": "^1.8.0", - "php": "^7.0|^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0|^8.5|^9.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Jean85\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Alessandro Lai", - "email": "alessandro.lai85@gmail.com" - } - ], - "description": "A wrapper for ocramius/package-versions to get pretty versions strings", - "keywords": [ - "composer", - "package", - "release", - "versions" - ], - "support": { - "issues": "https://github.com/Jean85/pretty-package-versions/issues", - "source": "https://github.com/Jean85/pretty-package-versions/tree/1.6.0" - }, - "time": "2021-02-04T16:20:16+00:00" - }, { "name": "matomo/device-detector", "version": "6.0.0", @@ -1000,74 +872,6 @@ }, "time": "2022-04-11T09:58:17+00:00" }, - { - "name": "mongodb/mongodb", - "version": "1.8.0", - "source": { - "type": "git", - "url": "https://github.com/mongodb/mongo-php-library.git", - "reference": "953dbc19443aa9314c44b7217a16873347e6840d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mongodb/mongo-php-library/zipball/953dbc19443aa9314c44b7217a16873347e6840d", - "reference": "953dbc19443aa9314c44b7217a16873347e6840d", - "shasum": "" - }, - "require": { - "ext-hash": "*", - "ext-json": "*", - "ext-mongodb": "^1.8.1", - "jean85/pretty-package-versions": "^1.2", - "php": "^7.0 || ^8.0", - "symfony/polyfill-php80": "^1.19" - }, - "require-dev": { - "squizlabs/php_codesniffer": "^3.5, <3.5.5", - "symfony/phpunit-bridge": "5.x-dev" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.8.x-dev" - } - }, - "autoload": { - "files": [ - "src/functions.php" - ], - "psr-4": { - "MongoDB\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Andreas Braun", - "email": "andreas.braun@mongodb.com" - }, - { - "name": "Jeremy Mikola", - "email": "jmikola@gmail.com" - } - ], - "description": "MongoDB driver library", - "homepage": "https://jira.mongodb.org/browse/PHPLIB", - "keywords": [ - "database", - "driver", - "mongodb", - "persistence" - ], - "support": { - "issues": "https://github.com/mongodb/mongo-php-library/issues", - "source": "https://github.com/mongodb/mongo-php-library/tree/1.8.0" - }, - "time": "2020-11-25T12:26:02+00:00" - }, { "name": "mustangostang/spyc", "version": "0.6.3", @@ -1656,89 +1460,6 @@ ], "time": "2022-02-25T11:15:52+00:00" }, - { - "name": "symfony/polyfill-php80", - "version": "v1.26.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-05-10T07:21:04+00:00" - }, { "name": "utopia-php/abuse", "version": "0.14.0", @@ -1897,24 +1618,26 @@ }, { "name": "utopia-php/cache", - "version": "0.6.1", + "version": "0.8.0", "source": { "type": "git", "url": "https://github.com/utopia-php/cache.git", - "reference": "9889235a6d3da6cbb1f435201529da4d27c30e79" + "reference": "212e66100a1f32e674fca5d9bc317cc998303089" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/cache/zipball/9889235a6d3da6cbb1f435201529da4d27c30e79", - "reference": "9889235a6d3da6cbb1f435201529da4d27c30e79", + "url": "https://api.github.com/repos/utopia-php/cache/zipball/212e66100a1f32e674fca5d9bc317cc998303089", + "reference": "212e66100a1f32e674fca5d9bc317cc998303089", "shasum": "" }, "require": { "ext-json": "*", + "ext-memcached": "*", "ext-redis": "*", "php": ">=8.0" }, "require-dev": { + "laravel/pint": "1.2.*", "phpunit/phpunit": "^9.3", "vimeo/psalm": "4.13.1" }, @@ -1928,12 +1651,6 @@ "license": [ "MIT" ], - "authors": [ - { - "name": "Eldad Fux", - "email": "eldad@appwrite.io" - } - ], "description": "A simple cache library to manage application cache storing, loading and purging", "keywords": [ "cache", @@ -1944,9 +1661,9 @@ ], "support": { "issues": "https://github.com/utopia-php/cache/issues", - "source": "https://github.com/utopia-php/cache/tree/0.6.1" + "source": "https://github.com/utopia-php/cache/tree/0.8.0" }, - "time": "2022-08-10T08:12:46+00:00" + "time": "2022-10-16T16:48:09+00:00" }, { "name": "utopia-php/cli", @@ -2054,29 +1771,29 @@ }, { "name": "utopia-php/database", - "version": "0.26.0", + "version": "0.28.0", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "d172af2541137c83a86d066f82f48914b5a3a610" + "reference": "ef6506af1c09c22f5dc1e7859159d323f7fafa94" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/d172af2541137c83a86d066f82f48914b5a3a610", - "reference": "d172af2541137c83a86d066f82f48914b5a3a610", + "url": "https://api.github.com/repos/utopia-php/database/zipball/ef6506af1c09c22f5dc1e7859159d323f7fafa94", + "reference": "ef6506af1c09c22f5dc1e7859159d323f7fafa94", "shasum": "" }, "require": { - "ext-mongodb": "*", - "ext-pdo": "*", - "ext-redis": "*", - "mongodb/mongodb": "1.8.0", "php": ">=8.0", - "utopia-php/cache": "0.6.*", + "utopia-php/cache": "0.8.*", "utopia-php/framework": "0.*.*" }, "require-dev": { + "ext-mongodb": "*", + "ext-pdo": "*", + "ext-redis": "*", "fakerphp/faker": "^1.14", + "mongodb/mongodb": "1.8.0", "phpunit/phpunit": "^9.4", "swoole/ide-helper": "4.8.0", "utopia-php/cli": "^0.11.0", @@ -2092,16 +1809,6 @@ "license": [ "MIT" ], - "authors": [ - { - "name": "Eldad Fux", - "email": "eldad@appwrite.io" - }, - { - "name": "Brandon Leckemby", - "email": "brandon@appwrite.io" - } - ], "description": "A simple library to manage application persistency using multiple database adapters", "keywords": [ "database", @@ -2112,9 +1819,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.26.0" + "source": "https://github.com/utopia-php/database/tree/0.28.0" }, - "time": "2022-10-03T17:12:01+00:00" + "time": "2022-10-31T09:58:46+00:00" }, { "name": "utopia-php/domains", @@ -3535,16 +3242,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.17", + "version": "9.2.18", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "aa94dc41e8661fe90c7316849907cba3007b10d8" + "reference": "12fddc491826940cf9b7e88ad9664cf51f0f6d0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/aa94dc41e8661fe90c7316849907cba3007b10d8", - "reference": "aa94dc41e8661fe90c7316849907cba3007b10d8", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/12fddc491826940cf9b7e88ad9664cf51f0f6d0a", + "reference": "12fddc491826940cf9b7e88ad9664cf51f0f6d0a", "shasum": "" }, "require": { @@ -3600,7 +3307,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.17" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.18" }, "funding": [ { @@ -3608,7 +3315,7 @@ "type": "github" } ], - "time": "2022-08-30T12:24:04+00:00" + "time": "2022-10-27T13:35:33+00:00" }, { "name": "phpunit/php-file-iterator", @@ -5357,7 +5064,14 @@ "time": "2022-09-28T08:42:51+00:00" } ], - "aliases": [], + "aliases": [ + { + "package": "utopia-php/database", + "version": "0.28.0.0", + "alias": "0.26.99", + "alias_normalized": "0.26.99.0" + } + ], "minimum-stability": "stable", "stability-flags": [], "prefer-stable": false, @@ -5383,5 +5097,5 @@ "platform-overrides": { "php": "8.0" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.2.0" } From eaf59693b7f990cfd06b76a757d17259f30cac07 Mon Sep 17 00:00:00 2001 From: fogelito Date: Mon, 31 Oct 2022 15:26:40 +0200 Subject: [PATCH 14/21] composer.json --- composer.json | 6 +++--- composer.lock | 48 +++++++++++++++++++++--------------------------- 2 files changed, 24 insertions(+), 30 deletions(-) diff --git a/composer.json b/composer.json index c7eabd88b..b00e9ace5 100644 --- a/composer.json +++ b/composer.json @@ -45,13 +45,13 @@ "appwrite/php-runtimes": "0.11.*", "utopia-php/framework": "0.21.*", "utopia-php/logger": "0.3.*", - "utopia-php/abuse": "0.14.*", + "utopia-php/abuse": "0.15.*", "utopia-php/analytics": "0.2.*", - "utopia-php/audit": "0.15.*", + "utopia-php/audit": "0.16.*", "utopia-php/cache": "0.6.0 as 0.7.0", "utopia-php/cli": "0.13.*", "utopia-php/config": "0.2.*", - "utopia-php/database": "0.27.1 as 0.26.99", + "utopia-php/database": "0.27.1", "utopia-php/locale": "0.4.*", "utopia-php/registry": "0.5.*", "utopia-php/preloader": "0.2.*", diff --git a/composer.lock b/composer.lock index bcdd4493f..a3f428939 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": "ba3dec52b69a3781e59167a83df50503", + "content-hash": "7b8d35a2eacd92ce95764e4732a30f7e", "packages": [ { "name": "adhocore/jwt", @@ -1462,23 +1462,23 @@ }, { "name": "utopia-php/abuse", - "version": "0.14.0", + "version": "0.15.0", "source": { "type": "git", "url": "https://github.com/utopia-php/abuse.git", - "reference": "1a5da248e74c1bfc39bc440fa949de6935acceeb" + "reference": "fa7684d3162d370cf17df349066dd6535dd7264a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/abuse/zipball/1a5da248e74c1bfc39bc440fa949de6935acceeb", - "reference": "1a5da248e74c1bfc39bc440fa949de6935acceeb", + "url": "https://api.github.com/repos/utopia-php/abuse/zipball/fa7684d3162d370cf17df349066dd6535dd7264a", + "reference": "fa7684d3162d370cf17df349066dd6535dd7264a", "shasum": "" }, "require": { "ext-curl": "*", "ext-pdo": "*", "php": ">=8.0", - "utopia-php/database": "0.26.*" + "utopia-php/database": "0.27.*" }, "require-dev": { "phpunit/phpunit": "^9.4", @@ -1510,9 +1510,9 @@ ], "support": { "issues": "https://github.com/utopia-php/abuse/issues", - "source": "https://github.com/utopia-php/abuse/tree/0.14.0" + "source": "https://github.com/utopia-php/abuse/tree/0.15.0" }, - "time": "2022-10-14T11:26:39+00:00" + "time": "2022-10-30T08:11:12+00:00" }, { "name": "utopia-php/analytics", @@ -1571,22 +1571,22 @@ }, { "name": "utopia-php/audit", - "version": "0.15.0", + "version": "0.16.0", "source": { "type": "git", "url": "https://github.com/utopia-php/audit.git", - "reference": "937ffd13e7a5ac9ad220b329247569ef2a4881d9" + "reference": "fd8a0ea973f50443e6b7b8d0728d4c1e136da0ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/audit/zipball/937ffd13e7a5ac9ad220b329247569ef2a4881d9", - "reference": "937ffd13e7a5ac9ad220b329247569ef2a4881d9", + "url": "https://api.github.com/repos/utopia-php/audit/zipball/fd8a0ea973f50443e6b7b8d0728d4c1e136da0ef", + "reference": "fd8a0ea973f50443e6b7b8d0728d4c1e136da0ef", "shasum": "" }, "require": { "ext-pdo": "*", "php": ">=8.0", - "utopia-php/database": "0.26.*" + "utopia-php/database": "0.27.*" }, "require-dev": { "phpunit/phpunit": "^9.3", @@ -1612,9 +1612,9 @@ ], "support": { "issues": "https://github.com/utopia-php/audit/issues", - "source": "https://github.com/utopia-php/audit/tree/0.15.0" + "source": "https://github.com/utopia-php/audit/tree/0.16.0" }, - "time": "2022-10-14T11:39:18+00:00" + "time": "2022-10-30T08:11:26+00:00" }, { "name": "utopia-php/cache", @@ -3246,16 +3246,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.17", + "version": "9.2.18", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "aa94dc41e8661fe90c7316849907cba3007b10d8" + "reference": "12fddc491826940cf9b7e88ad9664cf51f0f6d0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/aa94dc41e8661fe90c7316849907cba3007b10d8", - "reference": "aa94dc41e8661fe90c7316849907cba3007b10d8", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/12fddc491826940cf9b7e88ad9664cf51f0f6d0a", + "reference": "12fddc491826940cf9b7e88ad9664cf51f0f6d0a", "shasum": "" }, "require": { @@ -3311,7 +3311,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.17" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.18" }, "funding": [ { @@ -3319,7 +3319,7 @@ "type": "github" } ], - "time": "2022-08-30T12:24:04+00:00" + "time": "2022-10-27T13:35:33+00:00" }, { "name": "phpunit/php-file-iterator", @@ -5074,12 +5074,6 @@ "version": "0.6.0.0", "alias": "0.7.0", "alias_normalized": "0.7.0.0" - }, - { - "package": "utopia-php/database", - "version": "0.27.1.0", - "alias": "0.26.99", - "alias_normalized": "0.26.99.0" } ], "minimum-stability": "stable", From 1e92bda18b749f1a556ab350b9a4f810f85be13b Mon Sep 17 00:00:00 2001 From: fogelito Date: Mon, 31 Oct 2022 16:50:54 +0200 Subject: [PATCH 15/21] composer changes --- composer.json | 8 +++--- composer.lock | 73 ++++++++++++++++++++++----------------------------- 2 files changed, 35 insertions(+), 46 deletions(-) diff --git a/composer.json b/composer.json index b00e9ace5..05baa8f00 100644 --- a/composer.json +++ b/composer.json @@ -45,13 +45,13 @@ "appwrite/php-runtimes": "0.11.*", "utopia-php/framework": "0.21.*", "utopia-php/logger": "0.3.*", - "utopia-php/abuse": "0.15.*", + "utopia-php/abuse": "0.16.*", "utopia-php/analytics": "0.2.*", - "utopia-php/audit": "0.16.*", - "utopia-php/cache": "0.6.0 as 0.7.0", + "utopia-php/audit": "0.17.*", + "utopia-php/cache": "0.8.*", "utopia-php/cli": "0.13.*", "utopia-php/config": "0.2.*", - "utopia-php/database": "0.27.1", + "utopia-php/database": "0.28.*", "utopia-php/locale": "0.4.*", "utopia-php/registry": "0.5.*", "utopia-php/preloader": "0.2.*", diff --git a/composer.lock b/composer.lock index a3f428939..aae4e7c4e 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": "7b8d35a2eacd92ce95764e4732a30f7e", + "content-hash": "51f81d435f4b5b7a9a6ea8f81b470353", "packages": [ { "name": "adhocore/jwt", @@ -1462,23 +1462,23 @@ }, { "name": "utopia-php/abuse", - "version": "0.15.0", + "version": "0.16.0", "source": { "type": "git", "url": "https://github.com/utopia-php/abuse.git", - "reference": "fa7684d3162d370cf17df349066dd6535dd7264a" + "reference": "6370d9150425460416583feba0990504ac789e98" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/abuse/zipball/fa7684d3162d370cf17df349066dd6535dd7264a", - "reference": "fa7684d3162d370cf17df349066dd6535dd7264a", + "url": "https://api.github.com/repos/utopia-php/abuse/zipball/6370d9150425460416583feba0990504ac789e98", + "reference": "6370d9150425460416583feba0990504ac789e98", "shasum": "" }, "require": { "ext-curl": "*", "ext-pdo": "*", "php": ">=8.0", - "utopia-php/database": "0.27.*" + "utopia-php/database": "0.28.*" }, "require-dev": { "phpunit/phpunit": "^9.4", @@ -1510,9 +1510,9 @@ ], "support": { "issues": "https://github.com/utopia-php/abuse/issues", - "source": "https://github.com/utopia-php/abuse/tree/0.15.0" + "source": "https://github.com/utopia-php/abuse/tree/0.16.0" }, - "time": "2022-10-30T08:11:12+00:00" + "time": "2022-10-31T14:46:41+00:00" }, { "name": "utopia-php/analytics", @@ -1571,22 +1571,22 @@ }, { "name": "utopia-php/audit", - "version": "0.16.0", + "version": "0.17.0", "source": { "type": "git", "url": "https://github.com/utopia-php/audit.git", - "reference": "fd8a0ea973f50443e6b7b8d0728d4c1e136da0ef" + "reference": "455471bd4de8d74026809e843f8c9740eb32922c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/audit/zipball/fd8a0ea973f50443e6b7b8d0728d4c1e136da0ef", - "reference": "fd8a0ea973f50443e6b7b8d0728d4c1e136da0ef", + "url": "https://api.github.com/repos/utopia-php/audit/zipball/455471bd4de8d74026809e843f8c9740eb32922c", + "reference": "455471bd4de8d74026809e843f8c9740eb32922c", "shasum": "" }, "require": { "ext-pdo": "*", "php": ">=8.0", - "utopia-php/database": "0.27.*" + "utopia-php/database": "0.28.*" }, "require-dev": { "phpunit/phpunit": "^9.3", @@ -1612,30 +1612,32 @@ ], "support": { "issues": "https://github.com/utopia-php/audit/issues", - "source": "https://github.com/utopia-php/audit/tree/0.16.0" + "source": "https://github.com/utopia-php/audit/tree/0.17.0" }, - "time": "2022-10-30T08:11:26+00:00" + "time": "2022-10-31T14:44:52+00:00" }, { "name": "utopia-php/cache", - "version": "0.6.0", + "version": "0.8.0", "source": { "type": "git", "url": "https://github.com/utopia-php/cache.git", - "reference": "8ea1353a4bbab617e23c865a7c97b60d8074aee3" + "reference": "212e66100a1f32e674fca5d9bc317cc998303089" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/cache/zipball/8ea1353a4bbab617e23c865a7c97b60d8074aee3", - "reference": "8ea1353a4bbab617e23c865a7c97b60d8074aee3", + "url": "https://api.github.com/repos/utopia-php/cache/zipball/212e66100a1f32e674fca5d9bc317cc998303089", + "reference": "212e66100a1f32e674fca5d9bc317cc998303089", "shasum": "" }, "require": { "ext-json": "*", + "ext-memcached": "*", "ext-redis": "*", "php": ">=8.0" }, "require-dev": { + "laravel/pint": "1.2.*", "phpunit/phpunit": "^9.3", "vimeo/psalm": "4.13.1" }, @@ -1649,12 +1651,6 @@ "license": [ "MIT" ], - "authors": [ - { - "name": "Eldad Fux", - "email": "eldad@appwrite.io" - } - ], "description": "A simple cache library to manage application cache storing, loading and purging", "keywords": [ "cache", @@ -1665,9 +1661,9 @@ ], "support": { "issues": "https://github.com/utopia-php/cache/issues", - "source": "https://github.com/utopia-php/cache/tree/0.6.0" + "source": "https://github.com/utopia-php/cache/tree/0.8.0" }, - "time": "2022-04-04T12:30:05+00:00" + "time": "2022-10-16T16:48:09+00:00" }, { "name": "utopia-php/cli", @@ -1775,21 +1771,21 @@ }, { "name": "utopia-php/database", - "version": "0.27.1", + "version": "0.28.0", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "7e6ee3002a66ba94d1644b6fdfd668248132b527" + "reference": "ef6506af1c09c22f5dc1e7859159d323f7fafa94" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/7e6ee3002a66ba94d1644b6fdfd668248132b527", - "reference": "7e6ee3002a66ba94d1644b6fdfd668248132b527", + "url": "https://api.github.com/repos/utopia-php/database/zipball/ef6506af1c09c22f5dc1e7859159d323f7fafa94", + "reference": "ef6506af1c09c22f5dc1e7859159d323f7fafa94", "shasum": "" }, "require": { "php": ">=8.0", - "utopia-php/cache": "0.7.*", + "utopia-php/cache": "0.8.*", "utopia-php/framework": "0.*.*" }, "require-dev": { @@ -1823,9 +1819,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.27.1" + "source": "https://github.com/utopia-php/database/tree/0.28.0" }, - "time": "2022-10-26T18:19:32+00:00" + "time": "2022-10-31T09:58:46+00:00" }, { "name": "utopia-php/domains", @@ -5068,14 +5064,7 @@ "time": "2022-09-28T08:42:51+00:00" } ], - "aliases": [ - { - "package": "utopia-php/cache", - "version": "0.6.0.0", - "alias": "0.7.0", - "alias_normalized": "0.7.0.0" - } - ], + "aliases": [], "minimum-stability": "stable", "stability-flags": [], "prefer-stable": false, From bf119867e813b43bfb4ff333072863df22dcff75 Mon Sep 17 00:00:00 2001 From: fogelito Date: Mon, 31 Oct 2022 17:17:37 +0200 Subject: [PATCH 16/21] change name back to original 'name' 2048 --- app/config/collections.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/config/collections.php b/app/config/collections.php index 17c7bef35..6fc7ec1e3 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -2076,7 +2076,7 @@ $collections = [ '$id' => ID::custom('name'), 'type' => Database::VAR_STRING, 'format' => '', - 'size' => 128, + 'size' => 2048, 'signed' => true, 'required' => false, 'default' => null, @@ -2216,7 +2216,7 @@ $collections = [ '$id' => ID::custom('_key_name'), 'type' => Database::INDEX_KEY, 'attributes' => ['name'], - 'lengths' => [], + 'lengths' => [768], 'orders' => [Database::ORDER_ASC], ], [ From a450089fe7692dcf70c2ad5b02c4c3c46485d303 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 31 Oct 2022 20:51:32 +0530 Subject: [PATCH 17/21] Update composer.json --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 119ab4e75..96e685902 100644 --- a/composer.json +++ b/composer.json @@ -45,13 +45,13 @@ "appwrite/php-runtimes": "0.11.*", "utopia-php/framework": "0.21.*", "utopia-php/logger": "0.3.*", - "utopia-php/abuse": "0.14.*", + "utopia-php/abuse": "0.16.*", "utopia-php/analytics": "0.2.*", - "utopia-php/audit": "0.15.*", + "utopia-php/audit": "0.17.*", "utopia-php/cache": "0.8.0", "utopia-php/cli": "0.13.*", "utopia-php/config": "0.2.*", - "utopia-php/database": "0.28.0 as 0.26.99", + "utopia-php/database": "0.28.0", "utopia-php/locale": "0.4.*", "utopia-php/registry": "0.5.*", "utopia-php/preloader": "0.2.*", From 4befb19c3526e63d844e6360baccbc65716828d6 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 8 Nov 2022 13:09:18 +0100 Subject: [PATCH 18/21] feat: add databases and buckets to projects usage --- app/controllers/api/projects.php | 6 ++++-- src/Appwrite/Utopia/Response/Model/UsageProject.php | 11 +++++++++-- .../Services/Projects/ProjectsConsoleClientTest.php | 3 ++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index 9a5f3f001..a5c9177f8 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -295,9 +295,10 @@ App::get('/v1/projects/:projectId/usage') 'project.$all.network.bandwidth', 'project.$all.storage.size', 'users.$all.count.total', - 'collections.$all.count.total', + 'databases.$all.count.total', 'documents.$all.count.total', 'executions.$all.compute.total', + 'buckets.$all.count.total' ]; $stats = []; @@ -346,9 +347,10 @@ App::get('/v1/projects/:projectId/usage') 'network' => $stats[$metrics[1]] ?? [], 'storage' => $stats[$metrics[2]] ?? [], 'users' => $stats[$metrics[3]] ?? [], - 'collections' => $stats[$metrics[4]] ?? [], + 'databases' => $stats[$metrics[4]] ?? [], 'documents' => $stats[$metrics[5]] ?? [], 'executions' => $stats[$metrics[6]] ?? [], + 'buckets' => $stats[$metrics[7]] ?? [], ]); } diff --git a/src/Appwrite/Utopia/Response/Model/UsageProject.php b/src/Appwrite/Utopia/Response/Model/UsageProject.php index 01603fce8..e37bc5928 100644 --- a/src/Appwrite/Utopia/Response/Model/UsageProject.php +++ b/src/Appwrite/Utopia/Response/Model/UsageProject.php @@ -44,9 +44,9 @@ class UsageProject extends Model 'example' => [], 'array' => true ]) - ->addRule('collections', [ + ->addRule('databases', [ 'type' => Response::MODEL_METRIC, - 'description' => 'Aggregated stats for number of collections.', + 'description' => 'Aggregated stats for number of databases.', 'default' => [], 'example' => [], 'array' => true @@ -65,6 +65,13 @@ class UsageProject extends Model 'example' => [], 'array' => true ]) + ->addRule('buckets', [ + 'type' => Response::MODEL_METRIC, + 'description' => 'Aggregated stats for number of buckets.', + 'default' => [], + 'example' => [], + 'array' => true + ]) ; } diff --git a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php index 29789a322..6b1d9ccea 100644 --- a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php +++ b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php @@ -342,7 +342,8 @@ class ProjectsConsoleClientTest extends Scope $this->assertIsArray($response['body']['network']); $this->assertIsArray($response['body']['executions']); $this->assertIsArray($response['body']['documents']); - $this->assertIsArray($response['body']['collections']); + $this->assertIsArray($response['body']['databases']); + $this->assertIsArray($response['body']['buckets']); $this->assertIsArray($response['body']['users']); $this->assertIsArray($response['body']['storage']); From 1615121b3e3053b0603f98eb3dac0347bca13e1d Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 8 Nov 2022 14:38:43 +0100 Subject: [PATCH 19/21] tests: adapt to new response model --- tests/e2e/General/UsageTest.php | 2 +- tests/e2e/Services/Projects/ProjectsConsoleClientTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/e2e/General/UsageTest.php b/tests/e2e/General/UsageTest.php index 0c42c42ff..1da875c7a 100644 --- a/tests/e2e/General/UsageTest.php +++ b/tests/e2e/General/UsageTest.php @@ -102,7 +102,7 @@ class UsageTest extends Scope $res = $this->client->call(Client::METHOD_GET, '/projects/' . $projectId . '/usage?range=30d', $cheaders); $res = $res['body']; - $this->assertEquals(8, count($res)); + $this->assertEquals(9, count($res)); $this->assertEquals(30, count($res['requests'])); $this->assertEquals(30, count($res['users'])); $this->assertEquals($usersCount, $res['users'][array_key_last($res['users'])]['value']); diff --git a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php index 6b1d9ccea..d4eea20ae 100644 --- a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php +++ b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php @@ -335,7 +335,7 @@ class ProjectsConsoleClientTest extends Scope ], $this->getHeaders())); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(count($response['body']), 8); + $this->assertEquals(count($response['body']), 9); $this->assertNotEmpty($response['body']); $this->assertEquals('30d', $response['body']['range']); $this->assertIsArray($response['body']['requests']); From 4041c4964cd28d5875c85a4f53825f3d5b664d84 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 8 Nov 2022 15:16:10 +0100 Subject: [PATCH 20/21] tests: fix remaining tests for usage --- tests/e2e/General/UsageTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/e2e/General/UsageTest.php b/tests/e2e/General/UsageTest.php index 1da875c7a..b42696a6c 100644 --- a/tests/e2e/General/UsageTest.php +++ b/tests/e2e/General/UsageTest.php @@ -267,7 +267,7 @@ class UsageTest extends Scope $res = $this->client->call(Client::METHOD_GET, '/projects/' . $projectId . '/usage?range=30d', $headers); $res = $res['body']; - $this->assertEquals(8, count($res)); + $this->assertEquals(9, count($res)); $this->assertEquals(30, count($res['requests'])); $this->assertEquals(30, count($res['storage'])); $this->assertEquals($requestsCount, $res['requests'][array_key_last($res['requests'])]['value']); @@ -504,7 +504,7 @@ class UsageTest extends Scope $res = $this->client->call(Client::METHOD_GET, '/projects/' . $projectId . '/usage?range=30d', $headers); $res = $res['body']; - $this->assertEquals(8, count($res)); + $this->assertEquals(9, count($res)); $this->assertEquals(30, count($res['requests'])); $this->assertEquals(30, count($res['storage'])); $this->assertEquals($requestsCount, $res['requests'][array_key_last($res['requests'])]['value']); From e315f5d2ac9d1527cc87af4c9ee7ccb8a75d39a6 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Wed, 9 Nov 2022 10:29:13 +0100 Subject: [PATCH 21/21] fix: database usage tests --- tests/e2e/General/UsageTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/e2e/General/UsageTest.php b/tests/e2e/General/UsageTest.php index b42696a6c..6f17d940a 100644 --- a/tests/e2e/General/UsageTest.php +++ b/tests/e2e/General/UsageTest.php @@ -509,8 +509,8 @@ class UsageTest extends Scope $this->assertEquals(30, count($res['storage'])); $this->assertEquals($requestsCount, $res['requests'][array_key_last($res['requests'])]['value']); $this->validateDates($res['requests']); - $this->assertEquals($collectionsCount, $res['collections'][array_key_last($res['collections'])]['value']); - $this->validateDates($res['collections']); + $this->assertEquals($databasesCount, $res['databases'][array_key_last($res['databases'])]['value']); + $this->validateDates($res['databases']); $this->assertEquals($documentsCount, $res['documents'][array_key_last($res['documents'])]['value']); $this->validateDates($res['documents']);