From e7b64113ca9dcdd3f5b495f83be6263e74ad5e4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 9 Apr 2025 10:31:33 +0200 Subject: [PATCH] pr review changes; fix tests --- composer.lock | 30 +++++++++---------- src/Appwrite/Platform/Tasks/Doctor.php | 17 +++++------ .../Services/Proxy/ProxyCustomServerTest.php | 6 ++-- 3 files changed, 27 insertions(+), 26 deletions(-) diff --git a/composer.lock b/composer.lock index 401ae5f8d2..32a98f418a 100644 --- a/composer.lock +++ b/composer.lock @@ -3996,16 +3996,16 @@ }, { "name": "utopia-php/migration", - "version": "0.8.4", + "version": "0.8.5", "source": { "type": "git", "url": "https://github.com/utopia-php/migration.git", - "reference": "845fd04ccf5e0edb03c184b864e0596080a432b8" + "reference": "0dd95b148c581579ec05d2abbbdc13c2b4702331" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/migration/zipball/845fd04ccf5e0edb03c184b864e0596080a432b8", - "reference": "845fd04ccf5e0edb03c184b864e0596080a432b8", + "url": "https://api.github.com/repos/utopia-php/migration/zipball/0dd95b148c581579ec05d2abbbdc13c2b4702331", + "reference": "0dd95b148c581579ec05d2abbbdc13c2b4702331", "shasum": "" }, "require": { @@ -4046,9 +4046,9 @@ ], "support": { "issues": "https://github.com/utopia-php/migration/issues", - "source": "https://github.com/utopia-php/migration/tree/0.8.4" + "source": "https://github.com/utopia-php/migration/tree/0.8.5" }, - "time": "2025-03-28T02:08:22+00:00" + "time": "2025-04-09T05:21:09+00:00" }, { "name": "utopia-php/orchestration", @@ -5085,16 +5085,16 @@ }, { "name": "laravel/pint", - "version": "v1.21.2", + "version": "v1.22.0", "source": { "type": "git", "url": "https://github.com/laravel/pint.git", - "reference": "370772e7d9e9da087678a0edf2b11b6960e40558" + "reference": "7ddfaa6523a675fae5c4123ee38fc6bfb8ee4f36" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/370772e7d9e9da087678a0edf2b11b6960e40558", - "reference": "370772e7d9e9da087678a0edf2b11b6960e40558", + "url": "https://api.github.com/repos/laravel/pint/zipball/7ddfaa6523a675fae5c4123ee38fc6bfb8ee4f36", + "reference": "7ddfaa6523a675fae5c4123ee38fc6bfb8ee4f36", "shasum": "" }, "require": { @@ -5105,9 +5105,9 @@ "php": "^8.2.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.72.0", + "friendsofphp/php-cs-fixer": "^3.75.0", "illuminate/view": "^11.44.2", - "larastan/larastan": "^3.2.0", + "larastan/larastan": "^3.3.1", "laravel-zero/framework": "^11.36.1", "mockery/mockery": "^1.6.12", "nunomaduro/termwind": "^2.3", @@ -5147,7 +5147,7 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2025-03-14T22:31:42+00:00" + "time": "2025-04-08T22:11:45+00:00" }, { "name": "matthiasmullie/minify", @@ -8229,7 +8229,7 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": {}, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { @@ -8253,5 +8253,5 @@ "platform-overrides": { "php": "8.3" }, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.3.0" } diff --git a/src/Appwrite/Platform/Tasks/Doctor.php b/src/Appwrite/Platform/Tasks/Doctor.php index c07aaa1363..329248eae2 100644 --- a/src/Appwrite/Platform/Tasks/Doctor.php +++ b/src/Appwrite/Platform/Tasks/Doctor.php @@ -44,32 +44,31 @@ class Doctor extends Action Console::log('[Settings]'); $domain = new Domain(System::getEnv('_APP_DOMAIN')); - if (!$domain->isKnown() || $domain->isTest()) { - Console::log('🔴 Hostname has no public suffix (' . $domain->get() . ')'); + Console::log('🔴 Hostname is not valid (' . $domain->get() . ')'); } else { - Console::log('🟢 Hostname has a public suffix (' . $domain->get() . ')'); + Console::log('🟢 Hostname is valid (' . $domain->get() . ')'); } $domain = new Domain(System::getEnv('_APP_DOMAIN_TARGET_CNAME')); if (!$domain->isKnown() || $domain->isTest()) { Console::log('🔴 CNAME record target is not valid (' . $domain->get() . ')'); } else { - Console::log('🟢 CNAME record target is not valid (' . $domain->get() . ')'); + Console::log('🟢 CNAME record target is valid (' . $domain->get() . ')'); } $ipv4 = new IP(IP::V4); - if ($ipv4->isValid(System::getEnv('_APP_DOMAIN_TARGET_A'))) { + if (!$ipv4->isValid(System::getEnv('_APP_DOMAIN_TARGET_A'))) { Console::log('🔴 A record target is not valid (' . System::getEnv('_APP_DOMAIN_TARGET_A') . ')'); } else { - Console::log('🟢 A record target is not valid (' . System::getEnv('_APP_DOMAIN_TARGET_A') . ')'); + Console::log('🟢 A record target is valid (' . System::getEnv('_APP_DOMAIN_TARGET_A') . ')'); } $ipv6 = new IP(IP::V6); - if ($ipv6->isValid(System::getEnv('_APP_DOMAIN_TARGET_AAAA'))) { - Console::log('🔴 A record target is not valid (' . System::getEnv('_APP_DOMAIN_TARGET_AAAA') . ')'); + if (!$ipv6->isValid(System::getEnv('_APP_DOMAIN_TARGET_AAAA'))) { + Console::log('🔴 AAAA record target is not valid (' . System::getEnv('_APP_DOMAIN_TARGET_AAAA') . ')'); } else { - Console::log('🟢 A record target is not valid (' . System::getEnv('_APP_DOMAIN_TARGET_AAAA') . ')'); + Console::log('🟢 AAAA record target is valid (' . System::getEnv('_APP_DOMAIN_TARGET_AAAA') . ')'); } if (System::getEnv('_APP_OPENSSL_KEY_V1') === 'your-secret-key' || empty(System::getEnv('_APP_OPENSSL_KEY_V1'))) { diff --git a/tests/e2e/Services/Proxy/ProxyCustomServerTest.php b/tests/e2e/Services/Proxy/ProxyCustomServerTest.php index 6312840095..a3bf597f21 100644 --- a/tests/e2e/Services/Proxy/ProxyCustomServerTest.php +++ b/tests/e2e/Services/Proxy/ProxyCustomServerTest.php @@ -53,8 +53,10 @@ class ProxyCustomServerTest extends Scope public function testCreateRuleApex(): void { - $rule = $this->createAPIRule('myapp.com'); - $this->assertEquals(400, $rule['headers']['status-code']); + $domain = \uniqid() . '.com'; + $rule = $this->createAPIRule($domain); + $this->assertEquals(201, $rule['headers']['status-code']); + $this->assertEquals('created', $rule['body']['status']); } public function testCreateRuleVcs(): void