feat(wfctl): validate project config#672
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new wfctl config validate subcommand that validates the human-edited wfctl.yaml project manifest and the generated .wfctl-lock.yaml lockfile, and teaches wfctl validate (runtime workflow config validator) to detect and reject canonical wfctl project manifests with guidance to use the new subcommand. Also makes the infra multi-env E2E test skip cleanly when the DigitalOcean IaC plugin is not installed for the subprocess wfctl.
Changes:
- New
config_validate.goimplementswfctl config validatewith--manifest,--lock-file, and--skip-lockflags; manifest validates required fields and detects duplicates, lockfile validates URLs and SHA-256s. validate.go/migrate.go/wfctl.yaml: wire the new subcommand into the embedded CLI dispatch, add--manifest/--lock-fileto the flag reorderer, refactormigrateDeprecationWriterinto a default var, and makerunValidateshort-circuit with guidance when a likely wfctl project manifest is passed.- Tests cover dispatch wiring, acceptance/rejection of project vs. runtime configs, and a regression for
buf.gen.yaml-style false positives; infra E2E now skips on missing DO plugin.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/wfctl/config_validate.go | New subcommand implementing manifest + lockfile validation. |
| cmd/wfctl/validate.go | Rejects wfctl manifests with guidance, adds indentErrorMessage helper and new flag names to reorderer. |
| cmd/wfctl/migrate.go | Adds validate to config subcommand dispatch and refactors deprecation writer default. |
| cmd/wfctl/wfctl.yaml | Registers config CLI command and cmd-config pipeline in the embedded CLI manifest. |
| cmd/wfctl/config_migrate_test.go | Adds tests for embedded wiring, accept/reject behavior, and updated writer default check. |
| cmd/wfctl/infra_e2e_test.go | Skips subprocess infra E2E when DO IaC plugin is unavailable. |
| docs/WFCTL.md | Documents the new wfctl config validate subcommand and cross-references from wfctl validate. |
| func indentErrorMessage(message string) string { | ||
| lines := strings.Split(message, "\n") | ||
| if len(lines) == 0 { | ||
| return message | ||
| } | ||
| return strings.TrimSpace(lines[len(lines)-1]) | ||
| } | ||
|
|
| Use `wfctl config validate` for `wfctl.yaml` and `.wfctl-lock.yaml`; this | ||
| command validates runtime Workflow configs such as `workflow.yaml`. |
| } | ||
| seen[name] = struct{}{} |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
⏱ Benchmark Results✅ No significant performance regressions detected. benchstat comparison (baseline → PR)
|
1ac91b4 to
8f3493d
Compare
Summary
wfctl config validateforwfctl.yamland.wfctl-lock.yamlwfctl validatereject canonical wfctl manifests with guidance to the project-config validatorVerification
GOWORK=off go test ./cmd/wfctl -count=1GOWORK=off go test ./config -count=1GOWORK=off go run ./cmd/wfctl config validate --manifest /Users/jon/workspace/workflow-compute/wfctl.yaml --lock-file /Users/jon/workspace/workflow-compute/.wfctl-lock.yamlGOWORK=off go run ./cmd/wfctl validate /Users/jon/workspace/workflow-compute/wfctl.yamlrejects withwfctl config validateguidanceContext
Addresses the workflow-compute deferred gap where
wfctl validatetreatedwfctl.yamlas a runtime Workflow config instead of wfctl project configuration.