feat: add plugboard process validate CLI command#212
Conversation
…, and validation utilities - Add _graph.py with Johnson's cycle-finding algorithm (no additional dependencies) - Add _validation.py with validation utilities for process topology: - validate_all_inputs_connected: check all component inputs are connected - validate_input_events: check input events have matching output producers - validate_no_unresolved_cycles: check circular connections have initial_values - Add model validator on ProcessSpec for circular connection detection - Export new utilities from plugboard_schemas - Add comprehensive unit tests Co-authored-by: toby-coleman <13170610+toby-coleman@users.noreply.github.com>
…t filter Co-authored-by: toby-coleman <13170610+toby-coleman@users.noreply.github.com>
toby-coleman
left a comment
There was a problem hiding this comment.
@copilot can you refactor as follows:
- Instead of using the Pydantic validators, make all validators runtime checks.
- Provide a validation utility in plugboard_schemas that be called at runtime.
- It must accept the output of
process.dict()as input. Theiokey on the component dicts will provide the input events, output events, inputs, outputs.
- It must accept the output of
- Call the validator in
process.initand raise an exception if it is invalid before running.
- Remove Pydantic model validator from ProcessSpec - Refactor all validators to accept process.dict() format - Add validate_process() entry point combining all checks - Call validate_process() in Process.init() raising ValidationError - Update plugboard.schemas re-exports - Update tests for new runtime validation approach Co-authored-by: toby-coleman <13170610+toby-coleman@users.noreply.github.com>
Co-authored-by: toby-coleman <13170610+toby-coleman@users.noreply.github.com>
Refactored in d96d7b2:
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
Benchmark comparison for |
Adds a new `validate` subcommand to the CLI that checks whether a process defined in a YAML config file is valid. It builds the process and runs all topology validation checks (connected inputs, event matching, cycle detection). Exits with code 0 on success, code 1 with error details on failure. Co-authored-by: toby-coleman <13170610+toby-coleman@users.noreply.github.com>
plugboard process validate CLI command
|
Benchmark comparison for |
|
Benchmark comparison for |
|
Benchmark comparison for |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Benchmark comparison for |
…el-validation-checks
|
Benchmark comparison for |
|
Benchmark comparison for |
chrisk314
left a comment
There was a problem hiding this comment.
Made some small improvements. Looks good now.
Summary
Adds a
plugboard process validateCLI command that checks whether a YAML process config has valid topology (connected inputs, event matching, cycle detection) without running the process.Changes
validatesubcommand toplugboard/cli/process/__init__.py— builds the process from YAML config, runsvalidate_process(process.dict()), exits 0 on success or 1 with itemized errors on failureOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.