wait: defer strict validation for value references to run time
Summary
Build-time validation of wait steps rejected any with value that was not already a literal: a ${...} or $VAR reference in duration, until, url, status, state, poll_interval, or request_timeout failed before the DAG ever ran, even when the reference would have resolved to a valid value. This change defers strict checks for reference-carrying fields to run time, once references have resolved.
Changes
internal/runtime/builtin/wait/config.go: guard each strict check inparseConfigwith a newisValueReferencehelper (IsWholeReference+HasValueReference, matching thedecision/mailprecedent), so both scoped references and bare${NAME}/$NAMEenvironment forms defer;Statusisany-typed andparseStatusnow returns the parsed int, owns the200default, accepts YAML numeric types and numeric strings, and defers referencesinternal/runtime/builtin/wait/wait.go:validateStepdefers references,newExecutorkeeps strict checks (values already resolved innode.go);waitHTTPcompares against the parsed intinternal/cmn/schema/dag.schema.json: preserve thestateenum via the repo'sanyOfenum-or-reference idiom; document thestatusstring/reference form alongside the integer unionspecs/039-wait.md: document reference deferral for${...}and$VARforms in the behavior and validation sections- Tests: reference-deferral and literal-rejection tables plus
parseStatuscoverage inwait_test.go; conformance tests for a resolvedwait.durationreference (exit 0) and a resolved numeric-stringwait.httpstatus (exit 0), alongside the existing resolved-bad-URL rejection test
Related Issues
Closes https://github.com/dagucloud/dagu/issues/3226
Checklist
- Code follows the project style guidelines
- Self-review of the code has been performed
- Tests have been added or updated as needed
- Documentation has been updated as needed
- Changes have been tested locally
Validation: go vet and go test ./internal/spec/ ./internal/runtime/builtin/wait/ ./internal/executor/registry/ pass; conformance/spec039_wait passes against a binary built from this branch; schema tests pass when excluding TestDAGSchemaRepoCopyMatchesEmbeddedSchema/TestConfigSchemaRepoCopyMatchesEmbeddedSchema, which fail on Windows checkouts where the repo-copy schemas materialize as text stubs instead of symlinks (pre-existing). Branch rebased onto current upstream/main.