From cb9e5bd0ae1c0c93dd3c80ddf14c38630044ad5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 29 Jul 2024 19:28:15 +0200 Subject: [PATCH 1/3] Upgrade VCS and support 0.1.x tags --- composer.json | 2 +- composer.lock | 70 ++++++++++++------------ src/Appwrite/Platform/Workers/Builds.php | 18 +++++- 3 files changed, 53 insertions(+), 37 deletions(-) diff --git a/composer.json b/composer.json index 25659434c9..6fa56a4a31 100644 --- a/composer.json +++ b/composer.json @@ -69,7 +69,7 @@ "utopia-php/storage": "0.18.*", "utopia-php/swoole": "0.8.*", "utopia-php/system": "0.8.*", - "utopia-php/vcs": "0.6.*", + "utopia-php/vcs": "0.8.*", "utopia-php/websocket": "0.1.*", "matomo/device-detector": "6.1.*", "dragonmantank/cron-expression": "3.3.2", diff --git a/composer.lock b/composer.lock index d11adc0bd0..0c35320a26 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": "7a9af1063aac524865d2479ce3957d0e", + "content-hash": "b5c0db330bf30bd1d240b96116d96baf", "packages": [ { "name": "adhocore/jwt", @@ -355,16 +355,16 @@ }, { "name": "chillerlan/php-settings-container", - "version": "2.1.5", + "version": "2.1.6", "source": { "type": "git", "url": "https://github.com/chillerlan/php-settings-container.git", - "reference": "f705310389264c3578fdd9ffb15aa2cd6d91772e" + "reference": "5553558bd381fce5108c6d0343c12e488cfec6bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/chillerlan/php-settings-container/zipball/f705310389264c3578fdd9ffb15aa2cd6d91772e", - "reference": "f705310389264c3578fdd9ffb15aa2cd6d91772e", + "url": "https://api.github.com/repos/chillerlan/php-settings-container/zipball/5553558bd381fce5108c6d0343c12e488cfec6bb", + "reference": "5553558bd381fce5108c6d0343c12e488cfec6bb", "shasum": "" }, "require": { @@ -372,15 +372,16 @@ "php": "^7.4 || ^8.0" }, "require-dev": { - "phan/phan": "^5.4", - "phpcsstandards/php_codesniffer": "^3.8", - "phpmd/phpmd": "^2.13", - "phpunit/phpunit": "^9.6" + "phpmd/phpmd": "^2.15", + "phpstan/phpstan": "^1.11", + "phpstan/phpstan-deprecation-rules": "^1.2", + "phpunit/phpunit": "^9.6", + "squizlabs/php_codesniffer": "^3.10" }, "type": "library", "autoload": { "psr-4": { - "chillerlan\\Settings\\": "src/" + "chillerlan\\Settings\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -417,7 +418,7 @@ "type": "ko_fi" } ], - "time": "2024-01-05T23:20:55+00:00" + "time": "2024-07-17T01:04:28+00:00" }, { "name": "dragonmantank/cron-expression", @@ -1719,16 +1720,16 @@ }, { "name": "utopia-php/database", - "version": "0.50.0", + "version": "0.50.1", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "ce3eaccb2f3bbd34b2b97419836fec633b26b8f7" + "reference": "1745147bef29a9bddf5dd03fd9174ec29e2c26f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/ce3eaccb2f3bbd34b2b97419836fec633b26b8f7", - "reference": "ce3eaccb2f3bbd34b2b97419836fec633b26b8f7", + "url": "https://api.github.com/repos/utopia-php/database/zipball/1745147bef29a9bddf5dd03fd9174ec29e2c26f0", + "reference": "1745147bef29a9bddf5dd03fd9174ec29e2c26f0", "shasum": "" }, "require": { @@ -1769,9 +1770,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.50.0" + "source": "https://github.com/utopia-php/database/tree/0.50.1" }, - "time": "2024-06-21T03:21:42+00:00" + "time": "2024-07-26T11:56:05+00:00" }, { "name": "utopia-php/domains", @@ -2170,16 +2171,16 @@ }, { "name": "utopia-php/migration", - "version": "0.5.1", + "version": "0.5.2", "source": { "type": "git", "url": "https://github.com/utopia-php/migration.git", - "reference": "f0e7ff0a76546de353d1ea1f49605b958d407ed2" + "reference": "f18d44d4459f78c292dac9edde856fd156fe497a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/migration/zipball/f0e7ff0a76546de353d1ea1f49605b958d407ed2", - "reference": "f0e7ff0a76546de353d1ea1f49605b958d407ed2", + "url": "https://api.github.com/repos/utopia-php/migration/zipball/f18d44d4459f78c292dac9edde856fd156fe497a", + "reference": "f18d44d4459f78c292dac9edde856fd156fe497a", "shasum": "" }, "require": { @@ -2189,6 +2190,7 @@ "require-dev": { "laravel/pint": "1.*", "phpunit/phpunit": "9.*", + "utopia-php/cli": "^0.18.0", "vlucas/phpdotenv": "5.*" }, "type": "library", @@ -2211,9 +2213,9 @@ ], "support": { "issues": "https://github.com/utopia-php/migration/issues", - "source": "https://github.com/utopia-php/migration/tree/0.5.1" + "source": "https://github.com/utopia-php/migration/tree/0.5.2" }, - "time": "2024-07-10T05:48:42+00:00" + "time": "2024-07-22T09:27:07+00:00" }, { "name": "utopia-php/mongo", @@ -2756,16 +2758,16 @@ }, { "name": "utopia-php/vcs", - "version": "0.6.7", + "version": "0.8.0", "source": { "type": "git", "url": "https://github.com/utopia-php/vcs.git", - "reference": "8d8ff1ac68e991b95adb6f91fcde8f9bb8f24974" + "reference": "6ba177e7fcd9db97625b75e71edc12bcd8159d75" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/vcs/zipball/8d8ff1ac68e991b95adb6f91fcde8f9bb8f24974", - "reference": "8d8ff1ac68e991b95adb6f91fcde8f9bb8f24974", + "url": "https://api.github.com/repos/utopia-php/vcs/zipball/6ba177e7fcd9db97625b75e71edc12bcd8159d75", + "reference": "6ba177e7fcd9db97625b75e71edc12bcd8159d75", "shasum": "" }, "require": { @@ -2799,9 +2801,9 @@ ], "support": { "issues": "https://github.com/utopia-php/vcs/issues", - "source": "https://github.com/utopia-php/vcs/tree/0.6.7" + "source": "https://github.com/utopia-php/vcs/tree/0.8.0" }, - "time": "2024-06-05T17:38:29+00:00" + "time": "2024-07-29T14:33:43+00:00" }, { "name": "utopia-php/websocket", @@ -3156,16 +3158,16 @@ }, { "name": "laravel/pint", - "version": "v1.16.2", + "version": "v1.17.0", "source": { "type": "git", "url": "https://github.com/laravel/pint.git", - "reference": "51f1ba679a6afe0315621ad143d788bd7ded0eca" + "reference": "4dba80c1de4b81dc4c4fb10ea6f4781495eb29f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/51f1ba679a6afe0315621ad143d788bd7ded0eca", - "reference": "51f1ba679a6afe0315621ad143d788bd7ded0eca", + "url": "https://api.github.com/repos/laravel/pint/zipball/4dba80c1de4b81dc4c4fb10ea6f4781495eb29f5", + "reference": "4dba80c1de4b81dc4c4fb10ea6f4781495eb29f5", "shasum": "" }, "require": { @@ -3218,7 +3220,7 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2024-07-09T15:58:08+00:00" + "time": "2024-07-23T16:40:20+00:00" }, { "name": "matthiasmullie/minify", diff --git a/src/Appwrite/Platform/Workers/Builds.php b/src/Appwrite/Platform/Workers/Builds.php index 8296d845be..80bb4c848b 100644 --- a/src/Appwrite/Platform/Workers/Builds.php +++ b/src/Appwrite/Platform/Workers/Builds.php @@ -217,7 +217,15 @@ class Builds extends Action $branchName = $deployment->getAttribute('providerBranch'); $commitHash = $deployment->getAttribute('providerCommitHash', ''); - $gitCloneCommand = $github->generateCloneCommand($cloneOwner, $cloneRepository, $branchName, $tmpDirectory, $rootDirectory, $commitHash); + + $cloneVersion = $branchName; + $cloneType = GitHub::CLONE_TYPE_BRANCH; + if(!empty($commitHash)) { + $cloneVersion = $commitHash; + $cloneType = GitHub::CLONE_TYPE_COMMIT; + } + + $gitCloneCommand = $github->generateCloneCommand($cloneOwner, $cloneRepository, $cloneVersion, $cloneType, $tmpDirectory, $rootDirectory); $stdout = ''; $stderr = ''; Console::execute('mkdir -p /tmp/builds/' . \escapeshellcmd($buildId), '', $stdout, $stderr); @@ -240,7 +248,13 @@ class Builds extends Action if (!empty($templateRepositoryName) && !empty($templateOwnerName) && !empty($templateBranch)) { // Clone template repo $tmpTemplateDirectory = '/tmp/builds/' . \escapeshellcmd($buildId) . '/template'; - $gitCloneCommandForTemplate = $github->generateCloneCommand($templateOwnerName, $templateRepositoryName, $templateBranch, $tmpTemplateDirectory, $templateRootDirectory); + + $cloneType = GitHub::CLONE_TYPE_BRANCH; + if(\str_starts_with($templateBranch, '0.1.')) { // Temporary fix for 1.5. In future versions this only support tag names + $cloneType = GitHub::CLONE_TYPE_TAG; + } + + $gitCloneCommandForTemplate = $github->generateCloneCommand($templateOwnerName, $templateRepositoryName, $templateBranch, $cloneType, $tmpTemplateDirectory, $templateRootDirectory); $exit = Console::execute($gitCloneCommandForTemplate, '', $stdout, $stderr); if ($exit !== 0) { From e33a035a81857cd5d6918e9f0fde6689d565cae5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 29 Jul 2024 21:01:32 +0200 Subject: [PATCH 2/3] Upgrade lib --- composer.json | 2 +- composer.lock | 27 ++++++++++++++++++--------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/composer.json b/composer.json index 6fa56a4a31..4b75c7c36f 100644 --- a/composer.json +++ b/composer.json @@ -69,7 +69,7 @@ "utopia-php/storage": "0.18.*", "utopia-php/swoole": "0.8.*", "utopia-php/system": "0.8.*", - "utopia-php/vcs": "0.8.*", + "utopia-php/vcs": "dev-fix-wildcard-tags as 0.8.99", "utopia-php/websocket": "0.1.*", "matomo/device-detector": "6.1.*", "dragonmantank/cron-expression": "3.3.2", diff --git a/composer.lock b/composer.lock index 0c35320a26..1f40ae149c 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": "b5c0db330bf30bd1d240b96116d96baf", + "content-hash": "78cb36cb535640312fa2fe33de03d0e9", "packages": [ { "name": "adhocore/jwt", @@ -2758,16 +2758,16 @@ }, { "name": "utopia-php/vcs", - "version": "0.8.0", + "version": "dev-fix-wildcard-tags", "source": { "type": "git", "url": "https://github.com/utopia-php/vcs.git", - "reference": "6ba177e7fcd9db97625b75e71edc12bcd8159d75" + "reference": "5bffa504a48b2269af9ad15c85f653ab7bf1b2d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/vcs/zipball/6ba177e7fcd9db97625b75e71edc12bcd8159d75", - "reference": "6ba177e7fcd9db97625b75e71edc12bcd8159d75", + "url": "https://api.github.com/repos/utopia-php/vcs/zipball/5bffa504a48b2269af9ad15c85f653ab7bf1b2d2", + "reference": "5bffa504a48b2269af9ad15c85f653ab7bf1b2d2", "shasum": "" }, "require": { @@ -2801,9 +2801,9 @@ ], "support": { "issues": "https://github.com/utopia-php/vcs/issues", - "source": "https://github.com/utopia-php/vcs/tree/0.8.0" + "source": "https://github.com/utopia-php/vcs/tree/fix-wildcard-tags" }, - "time": "2024-07-29T14:33:43+00:00" + "time": "2024-07-29T18:50:34+00:00" }, { "name": "utopia-php/websocket", @@ -5591,9 +5591,18 @@ "time": "2023-11-21T18:54:41+00:00" } ], - "aliases": [], + "aliases": [ + { + "package": "utopia-php/vcs", + "version": "dev-fix-wildcard-tags", + "alias": "0.8.99", + "alias_normalized": "0.8.99.0" + } + ], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "utopia-php/vcs": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { From 85fa7268b5b4e108ddea5a565cf6de61bdec80a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Tue, 30 Jul 2024 07:51:57 +0000 Subject: [PATCH 3/3] Upgrade lib version --- composer.json | 2 +- composer.lock | 27 +++++++++------------------ 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/composer.json b/composer.json index 4b75c7c36f..6fa56a4a31 100644 --- a/composer.json +++ b/composer.json @@ -69,7 +69,7 @@ "utopia-php/storage": "0.18.*", "utopia-php/swoole": "0.8.*", "utopia-php/system": "0.8.*", - "utopia-php/vcs": "dev-fix-wildcard-tags as 0.8.99", + "utopia-php/vcs": "0.8.*", "utopia-php/websocket": "0.1.*", "matomo/device-detector": "6.1.*", "dragonmantank/cron-expression": "3.3.2", diff --git a/composer.lock b/composer.lock index 1f40ae149c..cd1cdf2a11 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": "78cb36cb535640312fa2fe33de03d0e9", + "content-hash": "b5c0db330bf30bd1d240b96116d96baf", "packages": [ { "name": "adhocore/jwt", @@ -2758,16 +2758,16 @@ }, { "name": "utopia-php/vcs", - "version": "dev-fix-wildcard-tags", + "version": "0.8.1", "source": { "type": "git", "url": "https://github.com/utopia-php/vcs.git", - "reference": "5bffa504a48b2269af9ad15c85f653ab7bf1b2d2" + "reference": "3084aa93d24ed1e70f01e75f4318fc0d07f12596" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/vcs/zipball/5bffa504a48b2269af9ad15c85f653ab7bf1b2d2", - "reference": "5bffa504a48b2269af9ad15c85f653ab7bf1b2d2", + "url": "https://api.github.com/repos/utopia-php/vcs/zipball/3084aa93d24ed1e70f01e75f4318fc0d07f12596", + "reference": "3084aa93d24ed1e70f01e75f4318fc0d07f12596", "shasum": "" }, "require": { @@ -2801,9 +2801,9 @@ ], "support": { "issues": "https://github.com/utopia-php/vcs/issues", - "source": "https://github.com/utopia-php/vcs/tree/fix-wildcard-tags" + "source": "https://github.com/utopia-php/vcs/tree/0.8.1" }, - "time": "2024-07-29T18:50:34+00:00" + "time": "2024-07-29T20:49:09+00:00" }, { "name": "utopia-php/websocket", @@ -5591,18 +5591,9 @@ "time": "2023-11-21T18:54:41+00:00" } ], - "aliases": [ - { - "package": "utopia-php/vcs", - "version": "dev-fix-wildcard-tags", - "alias": "0.8.99", - "alias_normalized": "0.8.99.0" - } - ], + "aliases": [], "minimum-stability": "stable", - "stability-flags": { - "utopia-php/vcs": 20 - }, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": {