fix(cli): address review — createBundle appDir, shared arg validation (#8587)

* fix(cli): address review — createBundle appDir, shared validateRequiredArgs, warn on fetch failure

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* test(cli): add coverage for exit codes, arg validation, variable add, job logs, push --message

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(cli): fix test — create script with required schema, relax push --message assertion

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ruben Fiszel
2026-03-28 15:55:40 +00:00
committed by GitHub
co-authored by Claude Opus 4.6
parent f40cdaf434
commit 78ac28b4e0
8 changed files with 325 additions and 18 deletions
+3 -7
View File
@@ -29,7 +29,7 @@ import {
parseMetadataFile,
readLockfile,
} from "../../utils/metadata.ts";
import { generateHash } from "../../utils/utils.ts";
import { generateHash, validateRequiredArgs } from "../../utils/utils.ts";
import {
WorkspaceDependenciesLanguage,
ScriptLanguage,
@@ -956,14 +956,10 @@ async function run(
workspace: workspace.workspaceId,
path,
});
const required = (script.schema as any)?.required ?? [];
if (required.length > 0) {
throw new Error(
`Missing required arguments: ${required.join(", ")}.\nUse -d '{"${required[0]}": ...}' to provide input data.`
);
}
validateRequiredArgs(script.schema as Record<string, unknown>);
} catch (e: any) {
if (e.message?.startsWith("Missing required")) throw e;
log.warn(`Could not fetch schema to validate args: ${e.message}`);
}
}