mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-12 16:05:43 +00:00
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:
co-authored by
Claude Opus 4.6
parent
f40cdaf434
commit
78ac28b4e0
@@ -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}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user