Merge pull request #1161 from morluto/fix/artifact-unsupported-target-errors

fix(artifacts): report wrong target kinds as unsupported targets
This commit is contained in:
Kaoru0822
2026-10-08 19:30:54 -07:00
committed by GitHub
5 changed files with 144 additions and 27 deletions
@@ -133,6 +133,27 @@ describe("artifact extraction", () => {
"source",
]);
});
it("refuses a format without an extraction reader before inventory or output", async () => {
const root = await createTestTempDirectory("rea-extract-dmg-");
const image = join(root, "Image.dmg");
await writeFile(image, "not mounted");
const output = join(root, "output");
const result = await new ArtifactProvider()
.createClient(target(image, "dmg"))
.execute(
"extract_artifact",
artifactExtractionExecutionSchema.parse({ output_root: output }),
);
expect(result).toMatchObject({
ok: false,
error: {
_tag: "AnalysisUnsupportedTargetError",
operation: "extract_artifact",
reason: "Artifact format has no extraction reader: dmg",
},
});
await expect(access(output)).rejects.toThrow();
});
});
const inventory = async (targetValue: BinaryTarget) => {
const result = await new ArtifactProvider()