From 958701c26d0cd1f3eddadf5c9363e5b113f8a807 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 19 Aug 2026 13:00:09 +0200 Subject: [PATCH 1/5] chore: bump utopia-php/vcs to 5.2.0 Brings the adapter capability API: supportsRepositoryCreation(), supportsRepositoryDeletion(), supportsPublicRepositories(), supportsCommentImages() and supportsRepositoryArchives(). Co-Authored-By: Claude Fable 5 --- composer.lock | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/composer.lock b/composer.lock index 7264779afb..5db8094d71 100644 --- a/composer.lock +++ b/composer.lock @@ -5068,16 +5068,16 @@ }, { "name": "utopia-php/vcs", - "version": "5.1.2", + "version": "5.2.0", "source": { "type": "git", - "url": "git@github.com:utopia-php/vcs.git", - "reference": "abdb5763221d7e4900174c280244f83638e3133e" + "url": "https://github.com/utopia-php/vcs.git", + "reference": "780f3c84d270a14744a8cd61b1234310d9af59c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/vcs/zipball/abdb5763221d7e4900174c280244f83638e3133e", - "reference": "abdb5763221d7e4900174c280244f83638e3133e", + "url": "https://api.github.com/repos/utopia-php/vcs/zipball/780f3c84d270a14744a8cd61b1234310d9af59c4", + "reference": "780f3c84d270a14744a8cd61b1234310d9af59c4", "shasum": "" }, "require": { @@ -5128,10 +5128,10 @@ "vcs" ], "support": { - "source": "https://github.com/utopia-php/vcs/tree/5.1.2", + "source": "https://github.com/utopia-php/vcs/tree/5.2.0", "issues": "https://github.com/utopia-php/vcs/issues" }, - "time": "2026-08-07T12:32:15+00:00" + "time": "2026-08-19T10:17:14+00:00" }, { "name": "utopia-php/websocket", From 5aede528d6527158403c933510a70611b5b0d0c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 19 Aug 2026 13:00:21 +0200 Subject: [PATCH 2/5] feat: text-only PR comments for providers without image support Comment asks the adapter's supportsCommentImages() and drops the SVG status icons and QR image for providers that refuse hosted images, keeping the textual cells and links. Co-Authored-By: Claude Fable 5 --- src/Appwrite/Deployment/GitAction.php | 2 +- src/Appwrite/Vcs/Comment.php | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/Appwrite/Deployment/GitAction.php b/src/Appwrite/Deployment/GitAction.php index 03d679b2ba..8d709a0a2e 100644 --- a/src/Appwrite/Deployment/GitAction.php +++ b/src/Appwrite/Deployment/GitAction.php @@ -86,7 +86,7 @@ final class GitAction ]); $previewUrl = $isSite && !$rule->isEmpty() ? "{$protocol}://" . $rule->getAttribute('domain', '') : ''; - $comment = new Comment($platform); + $comment = new Comment($platform, $vcs->supportsCommentImages()); $comment->parseComment($vcs->getComment($owner, $repositoryName, $commentId)); $comment->addBuild($project, $resource, $isSite ? 'site' : 'function', $status, $deployment->getId(), ['type' => 'logs'], $previewUrl); $vcs->updateComment($owner, $repositoryName, $commentId, $comment->generateComment()); diff --git a/src/Appwrite/Vcs/Comment.php b/src/Appwrite/Vcs/Comment.php index ac0f6e1dae..328dcaa19a 100644 --- a/src/Appwrite/Vcs/Comment.php +++ b/src/Appwrite/Vcs/Comment.php @@ -10,7 +10,8 @@ use Utopia\System\System; class Comment { public function __construct( - private array $platform + private array $platform, + private bool $withImages = true, ) { } @@ -173,7 +174,9 @@ class Comment $qrImagePathDark = '/images/vcs/qr-dark.svg'; $consoleUrl = $protocol . '://' . $hostname . '/v1/avatars/qr?text=' . \urlencode($site['previewUrl']); - $qr = '[' . $this->generatImage($qrImagePathLight, $qrImagePathDark, 'QR Code', 28) . '](' . $consoleUrl . ')'; + $qr = $this->withImages + ? '[' . $this->generatImage($qrImagePathLight, $qrImagePathDark, 'QR Code', 28) . '](' . $consoleUrl . ')' + : '[QR Code](' . $consoleUrl . ')'; $preview = '[Preview URL](' . $site['previewUrl'] . ')'; @@ -248,6 +251,11 @@ class Comment public function generatImage(string $pathLight, string $pathDark, string $alt, int $width): string { + // Providers without comment image support get the textual cells only. + if (!$this->withImages) { + return ''; + } + $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') === 'disabled' ? 'http' : 'https'; $hostname = $this->platform['consoleHostname'] ?? ''; From ddea0a18674dfce576051e59c7797add722a66ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 19 Aug 2026 14:13:29 +0200 Subject: [PATCH 3/5] feat: source VCS deployments through the jobs-service clone artifact Deployments::createFromVcs() owns the choice every call site used to spell out: providers with archive downloads keep handing the sidecar a presigned tarball URL, and a provider without them (the upcoming Origin) is cloned by the sidecar itself over Git HTTPS, through the orchestrator's clone artifact (open-runtimes/orchestrator 1.3.0). Credentials ride a header via the adapter's clone surface, never the URL. Bumps open-runtimes/sdk-for-php to 0.11.1 for the CloneArtifact model and utopia-php/vcs to 5.2.1 for the clone URL and headers. Co-Authored-By: Claude Fable 5 --- composer.json | 2 +- composer.lock | 28 ++++----- src/Appwrite/Deployment/Deployments.php | 61 ++++++++++++++++--- .../Platform/Modules/Compute/Base.php | 16 +++-- .../Http/Deployments/Duplicate/Create.php | 8 ++- .../Modules/Functions/Workers/Builds.php | 8 ++- .../Http/Deployments/Duplicate/Create.php | 8 ++- .../Modules/VCS/Http/GitHub/Deployment.php | 8 ++- 8 files changed, 99 insertions(+), 40 deletions(-) diff --git a/composer.json b/composer.json index 1aaadf5dd6..c7cf907469 100644 --- a/composer.json +++ b/composer.json @@ -135,7 +135,7 @@ "league/csv": "9.14.*", "enshrined/svg-sanitize": "0.22.*", "utopia-php/client": "^0.3.0", - "open-runtimes/sdk-for-php": "0.10.*", + "open-runtimes/sdk-for-php": "0.11.*", "utopia-php/schedule": "^0.2.0" }, "require-dev": { diff --git a/composer.lock b/composer.lock index 5db8094d71..fd8de8542f 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": "40231755d4dc80d8a23901402b42df4a", + "content-hash": "bc7793f803702df7c7726d103a13f599", "packages": [ { "name": "adhocore/jwt", @@ -1079,16 +1079,16 @@ }, { "name": "open-runtimes/sdk-for-php", - "version": "0.10.1", + "version": "0.11.1", "source": { "type": "git", "url": "https://github.com/open-runtimes/sdk-for-php.git", - "reference": "2a83df23a377d846a6a57e2146c485c4be706512" + "reference": "2db10da2fa7163d096bfd8343a44ae99a2852527" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/open-runtimes/sdk-for-php/zipball/2a83df23a377d846a6a57e2146c485c4be706512", - "reference": "2a83df23a377d846a6a57e2146c485c4be706512", + "url": "https://api.github.com/repos/open-runtimes/sdk-for-php/zipball/2db10da2fa7163d096bfd8343a44ae99a2852527", + "reference": "2db10da2fa7163d096bfd8343a44ae99a2852527", "shasum": "" }, "require": { @@ -1113,12 +1113,12 @@ "license": [ "MIT" ], - "description": "PHP SDK for the Open Runtimes orchestrator Jobs API.", + "description": "PHP SDK for the Open Runtimes orchestrator: jobs, deployments, sandboxes, and pools.", "support": { "issues": "https://github.com/open-runtimes/sdk-for-php/issues", - "source": "https://github.com/open-runtimes/sdk-for-php/tree/0.10.1" + "source": "https://github.com/open-runtimes/sdk-for-php/tree/0.11.1" }, - "time": "2026-07-31T13:09:22+00:00" + "time": "2026-08-19T12:49:14+00:00" }, { "name": "open-telemetry/api", @@ -5068,16 +5068,16 @@ }, { "name": "utopia-php/vcs", - "version": "5.2.0", + "version": "5.2.1", "source": { "type": "git", "url": "https://github.com/utopia-php/vcs.git", - "reference": "780f3c84d270a14744a8cd61b1234310d9af59c4" + "reference": "ee3928969d6c654fad44fad7f38cc96383b031fa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/vcs/zipball/780f3c84d270a14744a8cd61b1234310d9af59c4", - "reference": "780f3c84d270a14744a8cd61b1234310d9af59c4", + "url": "https://api.github.com/repos/utopia-php/vcs/zipball/ee3928969d6c654fad44fad7f38cc96383b031fa", + "reference": "ee3928969d6c654fad44fad7f38cc96383b031fa", "shasum": "" }, "require": { @@ -5128,10 +5128,10 @@ "vcs" ], "support": { - "source": "https://github.com/utopia-php/vcs/tree/5.2.0", + "source": "https://github.com/utopia-php/vcs/tree/5.2.1", "issues": "https://github.com/utopia-php/vcs/issues" }, - "time": "2026-08-19T10:17:14+00:00" + "time": "2026-08-19T12:49:54+00:00" }, { "name": "utopia-php/websocket", diff --git a/src/Appwrite/Deployment/Deployments.php b/src/Appwrite/Deployment/Deployments.php index 92d3c56150..79c6e3ddb9 100644 --- a/src/Appwrite/Deployment/Deployments.php +++ b/src/Appwrite/Deployment/Deployments.php @@ -7,6 +7,7 @@ use Appwrite\Extend\Exception; use OpenRuntimes\Orchestrator\Enum\CallbackEvent; use OpenRuntimes\Orchestrator\Enum\ReadFormat; use OpenRuntimes\Orchestrator\Jobs; +use OpenRuntimes\Orchestrator\Model\Artifact\CloneArtifact; use OpenRuntimes\Orchestrator\Model\Artifact\DownloadArtifact; use OpenRuntimes\Orchestrator\Model\Artifact\ReadArtifact; use OpenRuntimes\Orchestrator\Model\Artifact\StatArtifact; @@ -21,6 +22,7 @@ use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; use Utopia\Database\Query; use Utopia\System\System; +use Utopia\VCS\Adapter\Git; /** * Owns a deployment's lifecycle: upload bookkeeping, creating it and @@ -133,6 +135,41 @@ readonly class Deployments return $this->submit($resource, $deployment, ['url' => $url, 'subdir' => $rootDirectory, 'headers' => $headers]); } + /** + * Same as createFromUpload(), but builds from a repository on a VCS + * provider: a presigned archive URL when the provider hands those out, or + * a git clone through the jobs-service's clone artifact when the provider + * serves content over the git protocol only (Origin). + * + * @param string $ref Branch, tag, or commit the deployment builds from + */ + public function createFromVcs( + Document $resource, + Document $deployment, + Git $vcs, + string $owner, + string $repository, + string $ref, + string $rootDirectory = '', + ): Document { + if ($vcs->supportsRepositoryArchives()) { + return $this->createFromUrl( + $resource, + $deployment, + $vcs->getRepositoryPresignedUrl($owner, $repository, $ref), + $rootDirectory, + $vcs->getRepositoryPresignedUrlHeaders(), + ); + } + + return $this->submit($resource, $deployment, [ + 'clone' => $vcs->getRepositoryCloneUrl($owner, $repository), + 'ref' => $ref, + 'subdir' => $rootDirectory, + 'headers' => $vcs->getRepositoryCloneHeaders(), + ]); + } + private function submit(Document $resource, Document $deployment, ?array $source): Document { // The caller may have been holding this deployment for a while (the @@ -317,15 +354,25 @@ readonly class Deployments $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') === 'disabled' ? 'http' : 'https'; $endpoint = System::getEnv('_APP_JOBS_ENDPOINT', "$protocol://{$platform['apiHostname']}"); - // Source artifacts, both ending in /mnt/code/source: - // - remote tarball ($source): templates (public codeload URL) and VCS - // (a short-lived presigned URL). Git-forge archives wrap the tree in - // a "{repo}-{ref}/" root the caller can't predict, so strip drops it - // and subdir then extracts just the rootDirectory from the unwrapped - // tree. Uploaded tarballs (the else branch) are flat — no strip. + // Source artifacts, all ending in /mnt/code/source: + // - remote tarball ($source with url): templates (public codeload URL) + // and VCS (a short-lived presigned URL). Git-forge archives wrap the + // tree in a "{repo}-{ref}/" root the caller can't predict, so strip + // drops it and subdir then extracts just the rootDirectory from the + // unwrapped tree. Uploaded tarballs (the else branch) are flat — no + // strip. + // - git clone ($source with clone): a provider without archive + // downloads; the sidecar clones over Git HTTPS and checks the tree + // out directly, so there is no archive to unarchive — or to stat, + // which is why this path reports no sourceSize. // - otherwise: the deployment's uploaded tarball, fetched from Appwrite // over a presigned GET (manual upload / duplicate). - if ($source !== null) { + if (isset($source['clone'])) { + $subdir = \trim($source['subdir'] ?? '', '/'); + $sourceArtifacts = [ + new CloneArtifact(id: 'source', in: $source['clone'], out: 'source', ref: $source['ref'] ?? '', subdir: $subdir, headers: $source['headers'] ?? []), + ]; + } elseif ($source !== null) { $subdir = \trim($source['subdir'] ?? '', '/'); $sourceArtifacts = [ new DownloadArtifact(id: 'source', in: $source['url'], out: 'source.tar.gz', headers: $source['headers'] ?? []), diff --git a/src/Appwrite/Platform/Modules/Compute/Base.php b/src/Appwrite/Platform/Modules/Compute/Base.php index fb3e5bd8a1..b9cf1948d5 100644 --- a/src/Appwrite/Platform/Modules/Compute/Base.php +++ b/src/Appwrite/Platform/Modules/Compute/Base.php @@ -175,12 +175,14 @@ class Base extends Action // git write and then hands the build to the jobs-service itself. if ($template->isEmpty()) { $ref = $deployment->getAttribute('providerCommitHash') ?: $deployment->getAttribute('providerBranch'); - $deployment = $deployments->createFromUrl( + $deployment = $deployments->createFromVcs( $function, $deployment, - $vcs->getRepositoryPresignedUrl($owner, $repositoryName, $ref), + $vcs, + $owner, + $repositoryName, + $ref, $function->getAttribute('providerRootDirectory', ''), - $vcs->getRepositoryPresignedUrlHeaders(), ); } else { $deployment = $dbForProject->createDocument('deployments', new Document([ @@ -400,12 +402,14 @@ class Base extends Action // pushes go through the Builds worker (same split as redeployVcsFunction). if ($template->isEmpty()) { $ref = $deployment->getAttribute('providerCommitHash') ?: $deployment->getAttribute('providerBranch'); - $deployment = $deployments->createFromUrl( + $deployment = $deployments->createFromVcs( $site, $deployment, - $vcs->getRepositoryPresignedUrl($owner, $repositoryName, $ref), + $vcs, + $owner, + $repositoryName, + $ref, $site->getAttribute('providerRootDirectory', ''), - $vcs->getRepositoryPresignedUrlHeaders(), ); } else { $publisherForBuilds->enqueue(new BuildMessage( diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Duplicate/Create.php b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Duplicate/Create.php index 55616a18b7..5f98bbf24a 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Duplicate/Create.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Duplicate/Create.php @@ -157,12 +157,14 @@ class Create extends Action $github = $vcsFactory->fromInstallation($installation); $ref = $deployment->getAttribute('providerCommitHash') ?: $deployment->getAttribute('providerBranch'); - $deployment = $deployments->createFromUrl( + $deployment = $deployments->createFromVcs( $function, $deployment, - $github->getRepositoryPresignedUrl($owner, $repository, $ref), + $github, + $owner, + $repository, + $ref, $deployment->getAttribute('providerRootDirectory', ''), - $github->getRepositoryPresignedUrlHeaders(), ); } else { // Public template repo: providerBranch holds the resolved ref, diff --git a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php index 776f0adae6..16fe9f66be 100644 --- a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php +++ b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php @@ -401,12 +401,14 @@ class Builds extends Action // jobs-service like any other VCS commit, via the same Deployments // service the HTTP endpoints use. $ref = $deployment->getAttribute('providerCommitHash') ?: $branchName; - $deployments->createFromUrl( + $deployments->createFromVcs( $resource, $deployment, - $providerAdapter->getRepositoryPresignedUrl($cloneOwner, $cloneRepository, $ref), + $providerAdapter, + $cloneOwner, + $cloneRepository, + $ref, $resource->getAttribute('providerRootDirectory', ''), - $providerAdapter->getRepositoryPresignedUrlHeaders(), ); Console::execute('rm -rf ' . \escapeshellarg('/tmp/builds/' . $deploymentId), '', $stdout, $stderr); diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Duplicate/Create.php b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Duplicate/Create.php index 9dc11db43e..f9a81f494e 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Duplicate/Create.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Duplicate/Create.php @@ -182,12 +182,14 @@ class Create extends Action $vcs = $vcsFactory->fromInstallation($installation); $ref = $deployment->getAttribute('providerCommitHash') ?: $deployment->getAttribute('providerBranch'); - $deployment = $deployments->createFromUrl( + $deployment = $deployments->createFromVcs( $site, $deployment, - $vcs->getRepositoryPresignedUrl($owner, $repository, $ref), + $vcs, + $owner, + $repository, + $ref, $deployment->getAttribute('providerRootDirectory', ''), - $vcs->getRepositoryPresignedUrlHeaders(), ); } else { // Public template repo: providerBranch holds the resolved ref, diff --git a/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php b/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php index 892f666cad..b89364fb45 100644 --- a/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php +++ b/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php @@ -395,12 +395,14 @@ trait Deployment // The Deployments service is built per repository: a webhook fans out to // many tenant projects, each with its own database. $deployment = $authorization->skip(fn () => $deploymentsFactory($dbForProject, $project) - ->createFromUrl( + ->createFromVcs( $resource, $deployment, - $vcs->getRepositoryPresignedUrl($providerRepositoryOwner, $providerRepositoryName, $providerCommitHash), + $vcs, + $providerRepositoryOwner, + $providerRepositoryName, + $providerCommitHash, $resource->getAttribute('providerRootDirectory', ''), - $vcs->getRepositoryPresignedUrlHeaders(), )); if ($resource->getCollection() === 'sites') { From 6b78dd45e42d2f13a7f8ee8a291970e047b40f96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 19 Aug 2026 13:01:01 +0200 Subject: [PATCH 4/5] feat: report VCS provider capabilities to the console The console variables response gains two lists shaped like _APP_VCS_PROVIDERS: the configured providers that support repository creation and the ones that can host public repositories, read from the adapter capability API, so the console can hide flows a provider cannot serve. Co-Authored-By: Claude Fable 5 --- .../Modules/Console/Http/Variables/Get.php | 22 +++++++++++++++++-- .../Response/Model/ConsoleVariables.php | 14 ++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Console/Http/Variables/Get.php b/src/Appwrite/Platform/Modules/Console/Http/Variables/Get.php index 9adf5ebf9a..7474866438 100644 --- a/src/Appwrite/Platform/Modules/Console/Http/Variables/Get.php +++ b/src/Appwrite/Platform/Modules/Console/Http/Variables/Get.php @@ -7,6 +7,7 @@ use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response; +use Appwrite\Vcs\Factory as VcsFactory; use Utopia\Database\Database; use Utopia\Database\Document; use Utopia\Domains\Domain; @@ -47,6 +48,7 @@ class Get extends Action contentType: ContentType::JSON )) ->inject('vcsProviders') + ->inject('vcsFactory') ->inject('response') ->inject('platform') ->inject('dbForProject') @@ -55,6 +57,7 @@ class Get extends Action public function action( callable $vcsProviders, + VcsFactory $vcsFactory, Response $response, array $platform, Database $dbForProject @@ -71,7 +74,20 @@ class Get extends Action $isDomainEnabled = $isAAAAValid || $isAValid || $isCNAMEValid; - $isVcsEnabled = !empty($vcsProviders()); + $providers = $vcsProviders(); + $isVcsEnabled = !empty($providers); + + $providersWithRepositoryCreation = []; + $providersWithPublicRepositories = []; + foreach ($providers as $provider) { + $adapter = $vcsFactory->fromProvider($provider); + if ($adapter->supportsRepositoryCreation()) { + $providersWithRepositoryCreation[] = $provider; + } + if ($adapter->supportsPublicRepositories()) { + $providersWithPublicRepositories[] = $provider; + } + } $isAssistantEnabled = !empty(System::getEnv('_APP_ASSISTANT_OPENAI_API_KEY', '')); @@ -87,7 +103,9 @@ class Get extends Action '_APP_COMPUTE_SIZE_LIMIT' => +System::getEnv('_APP_COMPUTE_SIZE_LIMIT'), '_APP_USAGE_STATS' => System::getEnv('_APP_USAGE_STATS'), '_APP_VCS_ENABLED' => $isVcsEnabled, - '_APP_VCS_PROVIDERS' => $vcsProviders(), + '_APP_VCS_PROVIDERS' => $providers, + '_APP_VCS_PROVIDERS_WITH_REPOSITORY_CREATION' => $providersWithRepositoryCreation, + '_APP_VCS_PROVIDERS_WITH_PUBLIC_REPOSITORIES' => $providersWithPublicRepositories, '_APP_DOMAIN_ENABLED' => $isDomainEnabled, '_APP_ASSISTANT_ENABLED' => $isAssistantEnabled, '_APP_DOMAIN_SITES' => $platform['sitesDomain'], diff --git a/src/Appwrite/Utopia/Response/Model/ConsoleVariables.php b/src/Appwrite/Utopia/Response/Model/ConsoleVariables.php index ab179d04ee..2a32be686e 100644 --- a/src/Appwrite/Utopia/Response/Model/ConsoleVariables.php +++ b/src/Appwrite/Utopia/Response/Model/ConsoleVariables.php @@ -71,6 +71,20 @@ class ConsoleVariables extends Model 'example' => ['github'], 'array' => true, ]) + ->addRule('_APP_VCS_PROVIDERS_WITH_REPOSITORY_CREATION', [ + 'type' => self::TYPE_STRING, + 'description' => 'List of configured VCS providers that support repository creation.', + 'default' => [], + 'example' => ['github'], + 'array' => true, + ]) + ->addRule('_APP_VCS_PROVIDERS_WITH_PUBLIC_REPOSITORIES', [ + 'type' => self::TYPE_STRING, + 'description' => 'List of configured VCS providers that can host public repositories.', + 'default' => [], + 'example' => ['github'], + 'array' => true, + ]) ->addRule('_APP_DOMAIN_ENABLED', [ 'type' => self::TYPE_BOOLEAN, 'description' => 'Defines if main domain is configured. If so, custom domains can be created.', From 194b8e5cef24fbdefb023c7d7301f0c0bc321cde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 19 Aug 2026 13:01:14 +0200 Subject: [PATCH 5/5] fix: guard repository creation behind the adapter capability Origin's createRepository() throws in utopia-php/vcs 5.2.0; asking supportsRepositoryCreation() first turns that into a clear client error instead of an uncaught provider exception. Co-Authored-By: Claude Fable 5 --- .../Modules/VCS/Http/Installations/Repositories/Create.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Appwrite/Platform/Modules/VCS/Http/Installations/Repositories/Create.php b/src/Appwrite/Platform/Modules/VCS/Http/Installations/Repositories/Create.php index d8dae58f3b..7f29f0b005 100644 --- a/src/Appwrite/Platform/Modules/VCS/Http/Installations/Repositories/Create.php +++ b/src/Appwrite/Platform/Modules/VCS/Http/Installations/Repositories/Create.php @@ -112,6 +112,11 @@ class Create extends Action } else { $providerInstallationId = $installation->getAttribute('providerInstallationId'); $vcs = $vcsFactory->fromInstallation($installation); + + if (!$vcs->supportsRepositoryCreation()) { + throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'VCS provider does not support repository creation: ' . $provider); + } + $owner = !empty($providerNamespace) ? $providerNamespace : $vcs->getOwnerName($providerInstallationId); try {