fix: tighten wfctl validation#712
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Tightens wfctl validate by making strict validation the default, adding pipeline template/reference validation (including output-shape checks for key built-in steps), improving plugin lockfile install reuse safety, and redacting potentially sensitive unresolved refs in infra plan diagnostics.
Changes:
- Make
wfctl validatestrict by default; add--loose/--non-stricttransitional opt-outs and update docs/tests accordingly. - Add pipeline reference validation to
wfctl validate, plus improved template ref scanning (includingindex .steps "name" "field"patterns) and more robust SQL SELECT alias extraction. - Correct/extend step output metadata + inference for
step.db_execandstep.db_query_cached(single mode flat columns), and make wfctl lock installs reuse cached plugins only when recorded metadata matches.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| validation/pipeline_refs.go | Expands pipeline template reference validation (index field refs, nested-step scanning exclusions, improved SQL parsing). |
| validation/pipeline_refs_test.go | Adds tests covering db_query_cached single-mode output shape and nested foreach step handling. |
| schema/step_schema_test.go | Adds inference tests for db_exec and db_query_cached single-mode flat columns. |
| schema/step_schema_builtins.go | Updates built-in step output metadata (conditional, db_query, db_exec, db_query_cached). |
| schema/step_inference.go | Adds inferred outputs for db_exec and refined inference for db_query_cached (single vs list; SQL alias extraction). |
| docs/WFCTL.md | Documents strict-by-default validate behavior and new --loose/--non-strict flags. |
| cmd/wfctl/validate.go | Implements strict-by-default behavior and enforces pipeline ref validation in strict mode. |
| cmd/wfctl/plugin_install_wfctllock.go | Adds cached install reuse guarded by recorded lock install metadata; records metadata after installs. |
| cmd/wfctl/plugin_install_lockfile_test.go | Adds test ensuring cached install reuse when metadata matches (and no download occurs). |
| cmd/wfctl/main_test.go | Updates/extends validate command tests for new strict default and pipeline ref failures. |
| cmd/wfctl/infra.go | Redacts sensitive unresolved refs in “Pending JIT resolution” diagnostics output. |
| cmd/wfctl/infra_test.go | Adds tests for sensitive-ref redaction logic. |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Verification