From 1234770dc88b4752dcb8a1ca7a99383f6d4a151e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Tue, 2 Apr 2024 18:48:12 +0200 Subject: [PATCH] CI/CD fixes --- Dockerfile | 1 - app/cli.php | 1 - app/controllers/api/avatars.php | 6 +- app/controllers/api/storage.php | 7 +- app/controllers/api/teams.php | 2 +- app/worker.php | 1 - composer.json | 1 - composer.lock | 114 ++++++++++++++++---------------- 8 files changed, 63 insertions(+), 70 deletions(-) diff --git a/Dockerfile b/Dockerfile index d920b438e..eedc759ed 100755 --- a/Dockerfile +++ b/Dockerfile @@ -99,7 +99,6 @@ RUN chmod +x /usr/local/bin/doctor && \ chmod +x /usr/local/bin/worker-databases && \ chmod +x /usr/local/bin/worker-deletes && \ chmod +x /usr/local/bin/worker-functions && \ - chmod +x /usr/local/bin/worker-hamster && \ chmod +x /usr/local/bin/worker-mails && \ chmod +x /usr/local/bin/worker-messaging && \ chmod +x /usr/local/bin/worker-migrations && \ diff --git a/app/cli.php b/app/cli.php index 516584b56..1996b4da3 100644 --- a/app/cli.php +++ b/app/cli.php @@ -6,7 +6,6 @@ require_once __DIR__ . '/controllers/general.php'; use Appwrite\Event\Certificate; use Appwrite\Event\Delete; use Appwrite\Event\Func; -use Appwrite\Event\Hamster; use Appwrite\Platform\Appwrite; use Utopia\Cache\Adapter\Sharding; use Utopia\Cache\Cache; diff --git a/app/controllers/api/avatars.php b/app/controllers/api/avatars.php index 5241df36a..cbc122838 100644 --- a/app/controllers/api/avatars.php +++ b/app/controllers/api/avatars.php @@ -4,6 +4,8 @@ use Appwrite\Extend\Exception; use Appwrite\URL\URL as URLParse; use Appwrite\Utopia\Response; use chillerlan\QRCode\QRCode; +use chillerlan\QRCode\QRCode; +use chillerlan\QRCode\QROptions; use chillerlan\QRCode\QROptions; use Utopia\App; use Utopia\CLI\Console; @@ -14,6 +16,7 @@ use Utopia\Database\Document; use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\UID; use Utopia\Domains\Domain; +use Utopia\Fetch\Client; use Utopia\Image\Image; use Utopia\Logger\Log; use Utopia\Logger\Logger; @@ -24,9 +27,6 @@ use Utopia\Validator\Range; use Utopia\Validator\Text; use Utopia\Validator\URL; use Utopia\Validator\WhiteList; -use chillerlan\QRCode\QRCode; -use chillerlan\QRCode\QROptions; -use Utopia\Fetch\Client; $avatarCallback = function (string $type, string $code, int $width, int $height, int $quality, Response $response) { diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index 0df7a7132..8326d3349 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -16,11 +16,8 @@ use Utopia\App; use Utopia\Config\Config; use Utopia\Database\Database; use Utopia\Database\Document; -use Utopia\Database\Exception\Authorization as AuthorizationException; use Utopia\Database\Exception\Duplicate; -use Utopia\Database\Exception\Duplicate as DuplicateException; use Utopia\Database\Exception\Query as QueryException; -use Utopia\Database\Exception\Structure as StructureException; use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; @@ -637,7 +634,7 @@ App::post('/v1/storage/buckets/:bucketId/files') if (!$validator->isValid($bucket->getCreate())) { throw new Exception(Exception::USER_UNAUTHORIZED); } - $file = Authorization::skip(fn() => $dbForProject->updateDocument('bucket_' . $bucket->getInternalId(), $fileId, $file)); + $file = Authorization::skip(fn () => $dbForProject->updateDocument('bucket_' . $bucket->getInternalId(), $fileId, $file)); } } else { if ($file->isEmpty()) { @@ -676,7 +673,7 @@ App::post('/v1/storage/buckets/:bucketId/files') if (!$validator->isValid($bucket->getCreate())) { throw new Exception(Exception::USER_UNAUTHORIZED); } - $file = Authorization::skip(fn() => $dbForProject->updateDocument('bucket_' . $bucket->getInternalId(), $fileId, $file)); + $file = Authorization::skip(fn () => $dbForProject->updateDocument('bucket_' . $bucket->getInternalId(), $fileId, $file)); } } diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index 9b7bab4c9..4cb2eb331 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -948,7 +948,7 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId/status') throw new Exception(Exception::MEMBERSHIP_NOT_FOUND); } - $team = Authorization::skip(fn() => $dbForProject->getDocument('teams', $teamId)); + $team = Authorization::skip(fn () => $dbForProject->getDocument('teams', $teamId)); if ($team->isEmpty()) { throw new Exception(Exception::TEAM_NOT_FOUND); diff --git a/app/worker.php b/app/worker.php index 0760d470e..6f912a84f 100644 --- a/app/worker.php +++ b/app/worker.php @@ -9,7 +9,6 @@ use Appwrite\Event\Database as EventDatabase; use Appwrite\Event\Delete; use Appwrite\Event\Event; use Appwrite\Event\Func; -use Appwrite\Event\Hamster; use Appwrite\Event\Mail; use Appwrite\Event\Messaging; use Appwrite\Event\Migration; diff --git a/composer.json b/composer.json index 0e0c9e567..121d06311 100644 --- a/composer.json +++ b/composer.json @@ -85,7 +85,6 @@ "phpunit/phpunit": "9.5.20", "swoole/ide-helper": "5.0.2", "textalk/websocket": "1.5.7", - "utopia-php/fetch": "0.1.*", "laravel/pint": "^1.14" }, "provide": { diff --git a/composer.lock b/composer.lock index 88ccf84de..a7661a7fb 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": "78b9cd75952805a2347578f4fcb96add", + "content-hash": "975de4e9a34e72235198c4fd448539bd", "packages": [ { "name": "adhocore/jwt", @@ -1717,6 +1717,45 @@ }, "time": "2023-11-02T12:01:43+00:00" }, + { + "name": "utopia-php/fetch", + "version": "0.2.1", + "source": { + "type": "git", + "url": "https://github.com/utopia-php/fetch.git", + "reference": "1423c0ee3eef944d816ca6e31706895b585aea82" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/utopia-php/fetch/zipball/1423c0ee3eef944d816ca6e31706895b585aea82", + "reference": "1423c0ee3eef944d816ca6e31706895b585aea82", + "shasum": "" + }, + "require": { + "php": ">=8.0" + }, + "require-dev": { + "laravel/pint": "^1.5.0", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^9.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Utopia\\Fetch\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A simple library that provides an interface for making HTTP Requests.", + "support": { + "issues": "https://github.com/utopia-php/fetch/issues", + "source": "https://github.com/utopia-php/fetch/tree/0.2.1" + }, + "time": "2024-03-18T11:50:59+00:00" + }, { "name": "utopia-php/framework", "version": "0.33.6", @@ -2337,16 +2376,16 @@ }, { "name": "utopia-php/storage", - "version": "0.18.3", + "version": "0.18.4", "source": { "type": "git", "url": "https://github.com/utopia-php/storage.git", - "reference": "faa0279519ac14f3501e8b138e0865ad9d12bff6" + "reference": "94ab8758fabcefee5c5fa723616e45719833f922" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/storage/zipball/faa0279519ac14f3501e8b138e0865ad9d12bff6", - "reference": "faa0279519ac14f3501e8b138e0865ad9d12bff6", + "url": "https://api.github.com/repos/utopia-php/storage/zipball/94ab8758fabcefee5c5fa723616e45719833f922", + "reference": "94ab8758fabcefee5c5fa723616e45719833f922", "shasum": "" }, "require": { @@ -2386,9 +2425,9 @@ ], "support": { "issues": "https://github.com/utopia-php/storage/issues", - "source": "https://github.com/utopia-php/storage/tree/0.18.3" + "source": "https://github.com/utopia-php/storage/tree/0.18.4" }, - "time": "2023-12-31T11:45:12+00:00" + "time": "2024-04-02T08:24:09+00:00" }, { "name": "utopia-php/swoole", @@ -2899,16 +2938,16 @@ }, { "name": "laravel/pint", - "version": "v1.15.0", + "version": "v1.15.1", "source": { "type": "git", "url": "https://github.com/laravel/pint.git", - "reference": "c52de679b3ac01207016c179d7ce173e4be128c4" + "reference": "5f288b5e79938cc72f5c298d384e639de87507c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/c52de679b3ac01207016c179d7ce173e4be128c4", - "reference": "c52de679b3ac01207016c179d7ce173e4be128c4", + "url": "https://api.github.com/repos/laravel/pint/zipball/5f288b5e79938cc72f5c298d384e639de87507c6", + "reference": "5f288b5e79938cc72f5c298d384e639de87507c6", "shasum": "" }, "require": { @@ -2919,13 +2958,13 @@ "php": "^8.1.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.49.0", - "illuminate/view": "^10.43.0", - "larastan/larastan": "^2.8.1", + "friendsofphp/php-cs-fixer": "^3.52.1", + "illuminate/view": "^10.48.4", + "larastan/larastan": "^2.9.2", "laravel-zero/framework": "^10.3.0", - "mockery/mockery": "^1.6.7", + "mockery/mockery": "^1.6.11", "nunomaduro/termwind": "^1.15.1", - "pestphp/pest": "^2.33.6" + "pestphp/pest": "^2.34.5" }, "bin": [ "builds/pint" @@ -2961,7 +3000,7 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2024-03-26T16:40:24+00:00" + "time": "2024-04-02T14:28:47+00:00" }, { "name": "matthiasmullie/minify", @@ -5402,45 +5441,6 @@ } ], "time": "2023-11-21T18:54:41+00:00" - }, - { - "name": "utopia-php/fetch", - "version": "0.1.0", - "source": { - "type": "git", - "url": "https://github.com/utopia-php/fetch.git", - "reference": "2fa214b9262acd1a3583515a364da4f35929d5c5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/utopia-php/fetch/zipball/2fa214b9262acd1a3583515a364da4f35929d5c5", - "reference": "2fa214b9262acd1a3583515a364da4f35929d5c5", - "shasum": "" - }, - "require": { - "php": ">=8.0" - }, - "require-dev": { - "laravel/pint": "^1.5.0", - "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^9.5" - }, - "type": "library", - "autoload": { - "psr-4": { - "Utopia\\Fetch\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "A simple library that provides an interface for making HTTP Requests.", - "support": { - "issues": "https://github.com/utopia-php/fetch/issues", - "source": "https://github.com/utopia-php/fetch/tree/0.1.0" - }, - "time": "2023-10-10T11:58:32+00:00" } ], "aliases": [], @@ -5469,5 +5469,5 @@ "platform-overrides": { "php": "8.3" }, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.3.0" }