fix(deployment): declare the extract artifact's dependency on source

The unarchive artifact reads source.tar.gz but never declared that the download
artifact produces it, so the sidecar ran the extract even when the download had
failed. Extracting a file that was never written fails with "unrecognized
archive format", and because that error came last it was the one that aborted
the job and reached the user, burying the download's real error.

sourceSize already declared depends: 'source' for the same file; extract just
never did.

Needs the orchestrator-side change that skips artifacts whose dependency failed
to have any effect on which error surfaces.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
loks0nandClaude Opus 5 committed 2026-07-27 21:22:18 +01:00
1 parent 1679dc87fa
commit 0bb09e102b
1 file changed
+2 -2
@@ -145,7 +145,7 @@ readonly class Orchestrator extends Backend
$subdir = \trim($source['subdir'] ?? '', '/');
$sourceArtifacts = [
new DownloadArtifact(id: 'source', in: $source['url'], out: 'source.tar.gz'),
new UnarchiveArtifact(id: 'extract', in: 'source.tar.gz', out: 'source', subdir: $subdir !== '' ? $subdir : null, strip: true),
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
// downloaded archive so the orchestrator reports its byte size in
@@ -165,7 +165,7 @@ readonly class Orchestrator extends Backend
]);
$sourceArtifacts = [
new DownloadArtifact(id: 'source', in: $sourceUrl, out: 'source.tar.gz'),
new UnarchiveArtifact(id: 'extract', in: 'source.tar.gz', out: 'source'),
new UnarchiveArtifact(id: 'extract', in: 'source.tar.gz', out: 'source', depends: 'source'),
];
}