From 09c5bb46e108f408a0e237d2258240ffa1662e9d Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Fri, 7 Aug 2026 17:52:33 +0530 Subject: [PATCH 1/2] fix(vcs): send the archive credential the provider asks for A Bitbucket deployment waited forever on a build that never started. Its source is fetched from an archive url by the jobs-service, and Bitbucket's archive host takes no credential from a url -- it answers a redirect to a login page, so the fetch landed empty with nothing to report. The adapter says what headers that fetch needs, and every source fetch carries them. Providers that authenticate through the url alone ask for none, so what they send is unchanged. --- src/Appwrite/Deployment/Deployments.php | 9 +++++++-- src/Appwrite/Platform/Modules/Compute/Base.php | 2 ++ .../Functions/Http/Deployments/Duplicate/Create.php | 1 + .../Platform/Modules/Functions/Workers/Builds.php | 1 + .../Modules/Sites/Http/Deployments/Duplicate/Create.php | 1 + .../Platform/Modules/VCS/Http/GitHub/Deployment.php | 1 + 6 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/Appwrite/Deployment/Deployments.php b/src/Appwrite/Deployment/Deployments.php index 094f491593..4d234fe153 100644 --- a/src/Appwrite/Deployment/Deployments.php +++ b/src/Appwrite/Deployment/Deployments.php @@ -118,13 +118,18 @@ readonly class Deployments * Same as createFromUpload(), but builds from a remote tarball at $url * (a VCS presigned URL) instead of the deployment's own uploaded source. */ + /** + * @param array $headers Sent with the source fetch, for a + * url whose provider authenticates by header + */ public function createFromUrl( Document $resource, Document $deployment, string $url, string $rootDirectory = '', + array $headers = [], ): Document { - return $this->submit($resource, $deployment, ['url' => $url, 'subdir' => $rootDirectory]); + return $this->submit($resource, $deployment, ['url' => $url, 'subdir' => $rootDirectory, 'headers' => $headers]); } private function submit(Document $resource, Document $deployment, ?array $source): Document @@ -322,7 +327,7 @@ readonly class Deployments if ($source !== null) { $subdir = \trim($source['subdir'] ?? '', '/'); $sourceArtifacts = [ - new DownloadArtifact(id: 'source', in: $source['url'], out: 'source.tar.gz'), + new DownloadArtifact(id: 'source', in: $source['url'], out: 'source.tar.gz', headers: $source['headers'] ?? []), new UnarchiveArtifact(id: 'extract', in: 'source.tar.gz', out: 'source', subdir: $subdir !== '' ? $subdir : null, strip: true, depends: 'source'), // Appwrite never sees the remote source (the sidecar fetches it), // so unlike the uploaded-tarball path it can't size it. Stat the diff --git a/src/Appwrite/Platform/Modules/Compute/Base.php b/src/Appwrite/Platform/Modules/Compute/Base.php index d38efa41f1..77fae4af98 100644 --- a/src/Appwrite/Platform/Modules/Compute/Base.php +++ b/src/Appwrite/Platform/Modules/Compute/Base.php @@ -177,6 +177,7 @@ class Base extends Action $deployment, $vcs->getRepositoryPresignedUrl($owner, $repositoryName, $ref), $function->getAttribute('providerRootDirectory', ''), + $vcs->getRepositoryPresignedUrlHeaders(), ); } else { $deployment = $dbForProject->createDocument('deployments', new Document([ @@ -398,6 +399,7 @@ class Base extends Action $deployment, $vcs->getRepositoryPresignedUrl($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 efe6a8ed36..55616a18b7 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Duplicate/Create.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Duplicate/Create.php @@ -162,6 +162,7 @@ class Create extends Action $deployment, $github->getRepositoryPresignedUrl($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 6134155a9b..776f0adae6 100644 --- a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php +++ b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php @@ -406,6 +406,7 @@ class Builds extends Action $deployment, $providerAdapter->getRepositoryPresignedUrl($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 6fcd812ac6..f0d5755c24 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Duplicate/Create.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Duplicate/Create.php @@ -183,6 +183,7 @@ class Create extends Action $deployment, $vcs->getRepositoryPresignedUrl($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 e2d87dea34..82aead9307 100644 --- a/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php +++ b/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php @@ -397,6 +397,7 @@ trait Deployment $deployment, $vcs->getRepositoryPresignedUrl($providerRepositoryOwner, $providerRepositoryName, $providerCommitHash), $resource->getAttribute('providerRootDirectory', ''), + $vcs->getRepositoryPresignedUrlHeaders(), )); if ($resource->getCollection() === 'sites') { From 172fd81679dda5b78a847be20d6b2e7fb7f146b6 Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Fri, 7 Aug 2026 18:06:49 +0530 Subject: [PATCH 2/2] Bump utopia-php/vcs to 5.1.2 --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index 4e0ec81935..7d82e80e6f 100644 --- a/composer.lock +++ b/composer.lock @@ -5161,16 +5161,16 @@ }, { "name": "utopia-php/vcs", - "version": "5.1.0", + "version": "5.1.2", "source": { "type": "git", "url": "https://github.com/utopia-php/vcs.git", - "reference": "040a0d5d92ffa33964dc1607d1b95a526c6ffc49" + "reference": "abdb5763221d7e4900174c280244f83638e3133e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/vcs/zipball/040a0d5d92ffa33964dc1607d1b95a526c6ffc49", - "reference": "040a0d5d92ffa33964dc1607d1b95a526c6ffc49", + "url": "https://api.github.com/repos/utopia-php/vcs/zipball/abdb5763221d7e4900174c280244f83638e3133e", + "reference": "abdb5763221d7e4900174c280244f83638e3133e", "shasum": "" }, "require": { @@ -5221,10 +5221,10 @@ "vcs" ], "support": { - "source": "https://github.com/utopia-php/vcs/tree/5.1.0", + "source": "https://github.com/utopia-php/vcs/tree/5.1.2", "issues": "https://github.com/utopia-php/vcs/issues" }, - "time": "2026-08-07T08:58:14+00:00" + "time": "2026-08-07T12:32:15+00:00" }, { "name": "utopia-php/websocket",