mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Merge branch '1.8.x' of https://github.com/appwrite/appwrite into joins2
# Conflicts: # composer.json # composer.lock
This commit is contained in:
@@ -5,7 +5,7 @@ namespace Tests\E2E\Services\Functions;
|
||||
use Appwrite\Tests\Async;
|
||||
use CURLFile;
|
||||
use Tests\E2E\Client;
|
||||
use Utopia\CLI\Console;
|
||||
use Utopia\Console;
|
||||
use Utopia\Database\Helpers\ID;
|
||||
use Utopia\Database\Query;
|
||||
use Utopia\System\System;
|
||||
|
||||
@@ -8,7 +8,7 @@ use Tests\E2E\Client;
|
||||
use Tests\E2E\Scopes\ProjectCustom;
|
||||
use Tests\E2E\Scopes\Scope;
|
||||
use Tests\E2E\Scopes\SideServer;
|
||||
use Utopia\CLI\Console;
|
||||
use Utopia\Console;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Database\Helpers\ID;
|
||||
use Utopia\Database\Helpers\Role;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace Tests\E2E\Services\GraphQL;
|
||||
|
||||
use CURLFile;
|
||||
use Utopia\CLI\Console;
|
||||
use Utopia\Console;
|
||||
|
||||
trait Base
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@ use Appwrite\ID;
|
||||
use Appwrite\Tests\Async;
|
||||
use CURLFile;
|
||||
use Tests\E2E\Client;
|
||||
use Utopia\CLI\Console;
|
||||
use Utopia\Console;
|
||||
|
||||
trait ProxyBase
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@ use Appwrite\Tests\Async;
|
||||
use Appwrite\Tests\Async\Exceptions\Critical;
|
||||
use CURLFile;
|
||||
use Tests\E2E\Client;
|
||||
use Utopia\CLI\Console;
|
||||
use Utopia\Console;
|
||||
use Utopia\Database\Helpers\ID;
|
||||
use Utopia\Database\Query;
|
||||
use Utopia\System\System;
|
||||
@@ -335,21 +335,28 @@ trait SitesBase
|
||||
|
||||
protected function helperGetLatestCommit(string $owner, string $repository): ?string
|
||||
{
|
||||
$ch = curl_init("https://api.github.com/repos/{$owner}/{$repository}/commits/main");
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, [
|
||||
'User-Agent: Appwrite',
|
||||
'Accept: application/vnd.github.v3+json'
|
||||
]);
|
||||
$maxRetries = 3;
|
||||
for ($attempt = 0; $attempt < $maxRetries; $attempt++) {
|
||||
if ($attempt > 0) {
|
||||
sleep(5);
|
||||
}
|
||||
|
||||
$response = curl_exec($ch);
|
||||
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
curl_close($ch);
|
||||
$ch = curl_init("https://api.github.com/repos/{$owner}/{$repository}/commits/main");
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, [
|
||||
'User-Agent: Appwrite',
|
||||
'Accept: application/vnd.github.v3+json'
|
||||
]);
|
||||
|
||||
if ($httpCode === 200) {
|
||||
$commitData = json_decode($response, true);
|
||||
if (isset($commitData['sha'])) {
|
||||
return $commitData['sha'];
|
||||
$response = curl_exec($ch);
|
||||
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
curl_close($ch);
|
||||
|
||||
if ($httpCode === 200) {
|
||||
$commitData = json_decode($response, true);
|
||||
if (isset($commitData['sha'])) {
|
||||
return $commitData['sha'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ use Tests\E2E\Client;
|
||||
use Tests\E2E\Scopes\ProjectCustom;
|
||||
use Tests\E2E\Scopes\Scope;
|
||||
use Tests\E2E\Scopes\SideServer;
|
||||
use Utopia\CLI\Console;
|
||||
use Utopia\Console;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Database\Helpers\ID;
|
||||
use Utopia\Database\Query;
|
||||
|
||||
@@ -6,7 +6,7 @@ use Tests\E2E\Client;
|
||||
use Tests\E2E\Scopes\ProjectCustom;
|
||||
use Tests\E2E\Scopes\Scope;
|
||||
use Tests\E2E\Scopes\SideClient;
|
||||
use Utopia\CLI\Console;
|
||||
use Utopia\Console;
|
||||
|
||||
class TeamsCustomClientTest extends Scope
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ use Tests\E2E\Client;
|
||||
use Tests\E2E\Scopes\ProjectCustom;
|
||||
use Tests\E2E\Scopes\Scope;
|
||||
use Tests\E2E\Scopes\SideServer;
|
||||
use Utopia\CLI\Console;
|
||||
use Utopia\Console;
|
||||
use Utopia\Database\Helpers\ID;
|
||||
use Utopia\Database\Helpers\Permission;
|
||||
use Utopia\Database\Helpers\Role;
|
||||
|
||||
@@ -16,6 +16,8 @@ class OriginTest extends TestCase
|
||||
|
||||
$this->assertEquals(false, $validator->isValid(''));
|
||||
$this->assertEquals(false, $validator->isValid('/'));
|
||||
$this->assertEquals(false, $validator->isValid([]));
|
||||
$this->assertEquals(false, $validator->isValid(['http://localhost']));
|
||||
|
||||
$this->assertEquals(true, $validator->isValid('https://localhost'));
|
||||
$this->assertEquals(true, $validator->isValid('http://localhost'));
|
||||
|
||||
@@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase;
|
||||
use Swoole\Http\Request as SwooleRequest;
|
||||
use Tests\Unit\Utopia\Request\Filters\First;
|
||||
use Tests\Unit\Utopia\Request\Filters\Second;
|
||||
use Utopia\Route;
|
||||
use Utopia\Http\Route;
|
||||
|
||||
class RequestTest extends TestCase
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user