fix via review findings
This commit is contained in:
@@ -176,6 +176,8 @@ def add_step_from_capability(
|
||||
`--input state.title=report.title --input state.summary=report.summary`
|
||||
`--bind-output title=state.title --bind-output summary=state.summary`
|
||||
"""
|
||||
if route_from_step is None and route_from_outcome != "ok":
|
||||
raise typer.BadParameter("--from-outcome requires --from-step")
|
||||
convenience_input_selected = input_mapping is not None or input_value is not None
|
||||
if bindings_file is not None and convenience_input_selected:
|
||||
raise typer.BadParameter(
|
||||
@@ -378,6 +380,8 @@ def add_foreach_step(
|
||||
raise typer.BadParameter(
|
||||
"--max-active and --max-outstanding require --mode concurrent"
|
||||
)
|
||||
if collect_to is not None and item_error != "collect":
|
||||
raise typer.BadParameter("--collect-to requires --item-error collect")
|
||||
try:
|
||||
concurrent_options: dict[str, int] = {}
|
||||
if max_active is not None:
|
||||
|
||||
@@ -7,7 +7,7 @@ from typing import Any
|
||||
import typer
|
||||
from pydantic import TypeAdapter, ValidationError
|
||||
|
||||
from wf_api.surface import RouteSource
|
||||
from wf_api.draft_authoring import RouteSource
|
||||
from wf_core.models.steps import (
|
||||
InputBinding,
|
||||
InputPathBinding,
|
||||
@@ -81,6 +81,13 @@ def _parse_step_input_map_flags(
|
||||
expected="GRAPH_SOURCE=LOCAL_TARGET",
|
||||
)
|
||||
for source, target in parsed.items():
|
||||
try:
|
||||
GraphSourcePath.parse(source)
|
||||
except PathResolutionError as exc:
|
||||
raise typer.BadParameter(
|
||||
f"{option_name} source {source!r} is invalid; expected "
|
||||
"GRAPH_SOURCE=LOCAL_TARGET"
|
||||
) from exc
|
||||
if target.startswith("local."):
|
||||
bare_target = target.removeprefix("local.")
|
||||
raise typer.BadParameter(
|
||||
|
||||
@@ -445,9 +445,7 @@ def set_step_input(
|
||||
if selected_modes == 0:
|
||||
raise typer.BadParameter("provide --map/--value, --bindings-file, or --clear")
|
||||
if selected_modes > 1:
|
||||
raise typer.BadParameter(
|
||||
"--bindings-file and --clear cannot be combined with --map or --value"
|
||||
)
|
||||
raise typer.BadParameter("input modes are mutually exclusive")
|
||||
if merge and (literal_values or has_file or clear):
|
||||
raise typer.BadParameter(
|
||||
"--merge is supported only for compatibility map-only edits"
|
||||
|
||||
Reference in New Issue
Block a user