From 43b8030f10aeae0ced0d76b34e217e29dae971fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Thu, 18 Apr 2024 10:32:14 +0200 Subject: [PATCH 1/6] Upgrade DB lib --- composer.json | 2 +- composer.lock | 102 +++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 89 insertions(+), 15 deletions(-) diff --git a/composer.json b/composer.json index 0e8575e7c..e86521f50 100644 --- a/composer.json +++ b/composer.json @@ -50,7 +50,7 @@ "utopia-php/cache": "0.9.*", "utopia-php/cli": "0.15.*", "utopia-php/config": "0.2.*", - "utopia-php/database": "0.45.12", + "utopia-php/database": "0.45.13", "utopia-php/domains": "0.5.*", "utopia-php/dsn": "0.1.*", "utopia-php/framework": "0.33.*", diff --git a/composer.lock b/composer.lock index 927c763a5..0f1ae1ba7 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": "e90287b00089ad8e8059e6e157f3a6c8", + "content-hash": "8e71b20fcd688fd3552ff8fdaf138e1b", "packages": [ { "name": "adhocore/jwt", @@ -1191,16 +1191,16 @@ }, { "name": "utopia-php/database", - "version": "0.45.12", + "version": "0.45.13", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "805efb95b19d555b6cfd2244e36bfe08289f24f5" + "reference": "50e5db3caee776a5ee99c834998144371e331e37" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/805efb95b19d555b6cfd2244e36bfe08289f24f5", - "reference": "805efb95b19d555b6cfd2244e36bfe08289f24f5", + "url": "https://api.github.com/repos/utopia-php/database/zipball/50e5db3caee776a5ee99c834998144371e331e37", + "reference": "50e5db3caee776a5ee99c834998144371e331e37", "shasum": "" }, "require": { @@ -1241,9 +1241,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.45.12" + "source": "https://github.com/utopia-php/database/tree/0.45.13" }, - "time": "2024-04-08T07:50:55+00:00" + "time": "2024-04-18T08:06:43+00:00" }, { "name": "utopia-php/domains", @@ -4819,6 +4819,73 @@ }, "time": "2023-03-20T06:05:55+00:00" }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf", + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.4.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": "2023-05-23T14:45:45+00:00" + }, { "name": "symfony/polyfill-ctype", "version": "v1.29.0", @@ -5079,30 +5146,37 @@ }, { "name": "twig/twig", - "version": "v3.8.0", + "version": "v3.9.2", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "9d15f0ac07f44dc4217883ec6ae02fd555c6f71d" + "reference": "856cb5a6cfd6f3e4dc1f6c9a8f54e259503f7cf3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/9d15f0ac07f44dc4217883ec6ae02fd555c6f71d", - "reference": "9d15f0ac07f44dc4217883ec6ae02fd555c6f71d", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/856cb5a6cfd6f3e4dc1f6c9a8f54e259503f7cf3", + "reference": "856cb5a6cfd6f3e4dc1f6c9a8f54e259503f7cf3", "shasum": "" }, "require": { "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-ctype": "^1.8", "symfony/polyfill-mbstring": "^1.3", "symfony/polyfill-php80": "^1.22" }, "require-dev": { "psr/container": "^1.0|^2.0", - "symfony/phpunit-bridge": "^5.4.9|^6.3|^7.0" + "symfony/phpunit-bridge": "^5.4.9|^6.4|^7.0" }, "type": "library", "autoload": { + "files": [ + "src/Resources/core.php", + "src/Resources/debug.php", + "src/Resources/escaper.php", + "src/Resources/string_loader.php" + ], "psr-4": { "Twig\\": "src/" } @@ -5135,7 +5209,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.8.0" + "source": "https://github.com/twigphp/Twig/tree/v3.9.2" }, "funding": [ { @@ -5147,7 +5221,7 @@ "type": "tidelift" } ], - "time": "2023-11-21T18:54:41+00:00" + "time": "2024-04-17T14:16:25+00:00" } ], "aliases": [], From 92716ed72e23af2bfa45bc9a21fa7ef80a7babc8 Mon Sep 17 00:00:00 2001 From: shimon Date: Thu, 18 Apr 2024 12:09:39 +0300 Subject: [PATCH 2/6] queue retry validator update --- src/Appwrite/Platform/Tasks/QueueCount.php | 16 ++-------------- src/Appwrite/Platform/Tasks/QueueRetry.php | 16 ++-------------- 2 files changed, 4 insertions(+), 28 deletions(-) diff --git a/src/Appwrite/Platform/Tasks/QueueCount.php b/src/Appwrite/Platform/Tasks/QueueCount.php index 9b7bba82d..97fd60203 100644 --- a/src/Appwrite/Platform/Tasks/QueueCount.php +++ b/src/Appwrite/Platform/Tasks/QueueCount.php @@ -7,6 +7,7 @@ use Utopia\CLI\Console; use Utopia\Platform\Action; use Utopia\Queue\Client; use Utopia\Queue\Connection; +use Utopia\Validator\Text; use Utopia\Validator\WhiteList; class QueueCount extends Action @@ -21,20 +22,7 @@ class QueueCount extends Action { $this ->desc('Return the number of from a specific queue identified by the name parameter with a specific type') - ->param('name', '', new WhiteList([ - Event::DATABASE_QUEUE_NAME, - Event::DELETE_QUEUE_NAME, - Event::AUDITS_QUEUE_NAME, - Event::MAILS_QUEUE_NAME, - Event::FUNCTIONS_QUEUE_NAME, - Event::USAGE_QUEUE_NAME, - Event::WEBHOOK_QUEUE_NAME, - Event::CERTIFICATES_QUEUE_NAME, - Event::BUILDS_QUEUE_NAME, - Event::MESSAGING_QUEUE_NAME, - Event::MIGRATIONS_QUEUE_NAME, - Event::HAMSTER_QUEUE_NAME - ]), 'Queue name') + ->param('name', '', new Text(100), 'Queue name') ->param('type', '', new WhiteList([ 'success', 'failed', diff --git a/src/Appwrite/Platform/Tasks/QueueRetry.php b/src/Appwrite/Platform/Tasks/QueueRetry.php index 2781d9a3f..5cd0a87ff 100644 --- a/src/Appwrite/Platform/Tasks/QueueRetry.php +++ b/src/Appwrite/Platform/Tasks/QueueRetry.php @@ -8,6 +8,7 @@ use Utopia\Platform\Action; use Utopia\Queue\Client; use Utopia\Queue\Connection; use Utopia\Validator\Integer; +use Utopia\Validator\Text; use Utopia\Validator\WhiteList; use Utopia\Validator\Wildcard; @@ -23,20 +24,7 @@ class QueueRetry extends Action { $this ->desc('Retry failed jobs from a specific queue identified by the name parameter') - ->param('name', '', new WhiteList([ - Event::DATABASE_QUEUE_NAME, - Event::DELETE_QUEUE_NAME, - Event::AUDITS_QUEUE_NAME, - Event::MAILS_QUEUE_NAME, - Event::FUNCTIONS_QUEUE_NAME, - Event::USAGE_QUEUE_NAME, - Event::WEBHOOK_CLASS_NAME, - Event::CERTIFICATES_QUEUE_NAME, - Event::BUILDS_QUEUE_NAME, - Event::MESSAGING_QUEUE_NAME, - Event::MIGRATIONS_QUEUE_NAME, - Event::HAMSTER_CLASS_NAME - ]), 'Queue name') + ->param('name', '', new Text(100), 'Queue name') ->param('limit', 0, new Wildcard(), 'jobs limit', true) ->inject('queue') ->callback(fn ($name, $limit, $queue) => $this->action($name, $limit, $queue)); From e3ed9b43f43c0b5968bcfeb5d0fc02f2bc710c56 Mon Sep 17 00:00:00 2001 From: shimon Date: Thu, 18 Apr 2024 13:13:40 +0300 Subject: [PATCH 3/6] adding QueueRetry,QueueCount to tasks list --- src/Appwrite/Platform/Services/Tasks.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Services/Tasks.php b/src/Appwrite/Platform/Services/Tasks.php index 8b0cba8e1..8a6890f63 100644 --- a/src/Appwrite/Platform/Services/Tasks.php +++ b/src/Appwrite/Platform/Services/Tasks.php @@ -11,10 +11,11 @@ use Appwrite\Platform\Tasks\Schedule; use Appwrite\Platform\Tasks\SDKs; use Appwrite\Platform\Tasks\Specs; use Appwrite\Platform\Tasks\SSL; -use Appwrite\Platform\Tasks\Usage; use Appwrite\Platform\Tasks\Vars; use Appwrite\Platform\Tasks\Version; use Appwrite\Platform\Tasks\Upgrade; +use Appwrite\Platform\Tasks\QueueRetry; +use Appwrite\Platform\Tasks\QueueCount; class Tasks extends Service { @@ -33,6 +34,8 @@ class Tasks extends Service ->addAction(Migrate::getName(), new Migrate()) ->addAction(SDKs::getName(), new SDKs()) ->addAction(Specs::getName(), new Specs()) + ->addAction(QueueRetry::getName(), new QueueRetry()) + ->addAction(QueueCount::getName(), new QueueCount()) ; } } From c5316681ca14921422b3b4512bf9079733e41369 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 18 Apr 2024 13:43:32 +0000 Subject: [PATCH 4/6] chore: update database library --- composer.json | 2 +- composer.lock | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/composer.json b/composer.json index e86521f50..40e79eadc 100644 --- a/composer.json +++ b/composer.json @@ -50,7 +50,7 @@ "utopia-php/cache": "0.9.*", "utopia-php/cli": "0.15.*", "utopia-php/config": "0.2.*", - "utopia-php/database": "0.45.13", + "utopia-php/database": "0.45.14", "utopia-php/domains": "0.5.*", "utopia-php/dsn": "0.1.*", "utopia-php/framework": "0.33.*", diff --git a/composer.lock b/composer.lock index 0f1ae1ba7..ec33a2890 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": "8e71b20fcd688fd3552ff8fdaf138e1b", + "content-hash": "38f7191613fc39799742a97787c7b252", "packages": [ { "name": "adhocore/jwt", @@ -1191,16 +1191,16 @@ }, { "name": "utopia-php/database", - "version": "0.45.13", + "version": "0.45.14", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "50e5db3caee776a5ee99c834998144371e331e37" + "reference": "9159976c0b22e032289b554ef4976d4a8d479c5c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/50e5db3caee776a5ee99c834998144371e331e37", - "reference": "50e5db3caee776a5ee99c834998144371e331e37", + "url": "https://api.github.com/repos/utopia-php/database/zipball/9159976c0b22e032289b554ef4976d4a8d479c5c", + "reference": "9159976c0b22e032289b554ef4976d4a8d479c5c", "shasum": "" }, "require": { @@ -1241,9 +1241,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.45.13" + "source": "https://github.com/utopia-php/database/tree/0.45.14" }, - "time": "2024-04-18T08:06:43+00:00" + "time": "2024-04-18T13:30:33+00:00" }, { "name": "utopia-php/domains", @@ -5146,16 +5146,16 @@ }, { "name": "twig/twig", - "version": "v3.9.2", + "version": "v3.9.3", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "856cb5a6cfd6f3e4dc1f6c9a8f54e259503f7cf3" + "reference": "a842d75fed59cdbcbd3a3ad7fb9eb768fc350d58" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/856cb5a6cfd6f3e4dc1f6c9a8f54e259503f7cf3", - "reference": "856cb5a6cfd6f3e4dc1f6c9a8f54e259503f7cf3", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/a842d75fed59cdbcbd3a3ad7fb9eb768fc350d58", + "reference": "a842d75fed59cdbcbd3a3ad7fb9eb768fc350d58", "shasum": "" }, "require": { @@ -5209,7 +5209,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.9.2" + "source": "https://github.com/twigphp/Twig/tree/v3.9.3" }, "funding": [ { @@ -5221,7 +5221,7 @@ "type": "tidelift" } ], - "time": "2024-04-17T14:16:25+00:00" + "time": "2024-04-18T11:59:33+00:00" } ], "aliases": [], @@ -5250,5 +5250,5 @@ "platform-overrides": { "php": "8.0" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } From d89f8cc6b94f125811c9dc9e40146ed6fe1cf705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Fri, 19 Apr 2024 13:14:00 +0200 Subject: [PATCH 5/6] Upgrade pools lib --- composer.json | 2 +- composer.lock | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 40e79eadc..b51f720ae 100644 --- a/composer.json +++ b/composer.json @@ -62,7 +62,7 @@ "utopia-php/migration": "0.3.*", "utopia-php/orchestration": "0.9.*", "utopia-php/platform": "0.5.*", - "utopia-php/pools": "0.4.*", + "utopia-php/pools": "0.5.*", "utopia-php/preloader": "0.2.*", "utopia-php/queue": "0.7.*", "utopia-php/registry": "0.5.*", diff --git a/composer.lock b/composer.lock index ec33a2890..3378b2cd3 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": "38f7191613fc39799742a97787c7b252", + "content-hash": "56d2490abe5fd44b394a3e2f1115d642", "packages": [ { "name": "adhocore/jwt", @@ -1845,16 +1845,16 @@ }, { "name": "utopia-php/pools", - "version": "0.4.2", + "version": "0.5.0", "source": { "type": "git", "url": "https://github.com/utopia-php/pools.git", - "reference": "d2870ab74b31b7f4027799f082e85122154f8bed" + "reference": "6f716a213a08db95eda1b5dddfa90983c1834817" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/pools/zipball/d2870ab74b31b7f4027799f082e85122154f8bed", - "reference": "d2870ab74b31b7f4027799f082e85122154f8bed", + "url": "https://api.github.com/repos/utopia-php/pools/zipball/6f716a213a08db95eda1b5dddfa90983c1834817", + "reference": "6f716a213a08db95eda1b5dddfa90983c1834817", "shasum": "" }, "require": { @@ -1890,9 +1890,9 @@ ], "support": { "issues": "https://github.com/utopia-php/pools/issues", - "source": "https://github.com/utopia-php/pools/tree/0.4.2" + "source": "https://github.com/utopia-php/pools/tree/0.5.0" }, - "time": "2022-11-22T07:55:45+00:00" + "time": "2024-04-19T11:11:54+00:00" }, { "name": "utopia-php/preloader", @@ -5250,5 +5250,5 @@ "platform-overrides": { "php": "8.0" }, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.3.0" } From a99d9f3015294997a7089e9d695d9bddbc1b3be4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 24 Apr 2024 10:53:09 +0200 Subject: [PATCH 6/6] Disable experimental 4XX logging --- app/controllers/general.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/general.php b/app/controllers/general.php index 5ac0977c9..01bc946ad 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -863,6 +863,7 @@ App::error() $publish = $error->getCode() === 0 || $error->getCode() >= 500; } + /* if ($error->getCode() >= 400 && $error->getCode() < 500) { // Register error logger $providerName = App::getEnv('_APP_EXPERIMENT_LOGGING_PROVIDER', ''); @@ -879,6 +880,7 @@ App::error() $publish = true; } } + */ if ($logger && $publish) { try {