Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR replaces the previous “main module” concept with an explicit forwardArgs flag for modules that should receive forwarded runtime arguments, and introduces command-level named argument templating + improved help text generation for commands.
Changes:
- Rename config/API semantics from
main→forwardArgsacross code, docs, and example configs. - Add command argument templating (
args:+${name}substitution) andHelpText()generation inpkg/dut. - Update dutagent execution to pre-resolve per-module arguments via the new
ModuleArgs()logic; add/adjust tests and docs.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/module/wifisocket/wifisocket-example-cfg.yml | Updates example config to use forwardArgs: true. |
| pkg/module/time/time-example-cfg.yml | Updates example config to forwardArgs (but leaves one command without it). |
| pkg/module/ssh/ssh-example-cfg.yml | Updates example wording + config to forwardArgs: true. |
| pkg/module/shell/shell-example-cfg.yml | Updates example config to use forwardArgs: true. |
| pkg/module/serial/serial-example-cfg.yml | Updates example wording + config to forwardArgs: true. |
| pkg/module/pdu/pdu-example-cfg.yml | Updates example config to use forwardArgs: true. |
| pkg/module/gpio/gpio-example-cfg.yml | Updates example config to use forwardArgs: true. |
| pkg/module/flash/flash-example-cfg.yml | Updates example config to use forwardArgs: true. |
| pkg/module/file/file-example-cfg.yml | Updates multiple example commands to use forwardArgs: true. |
| pkg/module/agent/README.md | Updates README snippet to use forwardArgs: true. |
| pkg/dut/templating_test.go | Adds tests for template reference extraction, validation, and substitution. |
| pkg/dut/templating.go | Implements template validation + substitution logic for command args. |
| pkg/dut/dut_test.go | Updates tests for new errors/flags and adds tests for ModuleArgs() and help text. |
| pkg/dut/dut.go | Introduces forwardArgs, args: declarations, ModuleArgs(), and HelpText(); adjusts command validation + errors. |
| docs/dutagent-config.md | Updates schema docs for forwardArgs + adds args: documentation. |
| docs/command-arg-templating.md | Adds new documentation describing templating + forwardArgs behavior (examples currently use wrong YAML key). |
| contrib/dutagent-cfg-example.yaml | Updates example configs to forwardArgs and demonstrates templated args: usage. |
| cmds/exp/contrib/config-2.yaml | Updates experimental example to use forwardArgs: true. |
| cmds/exp/contrib/config-1.yaml | Updates experimental example to use forwardArgs: true. |
| cmds/dutagent/states_test.go | Updates dutagent tests for forwardArgs behavior and execution expectations. |
| cmds/dutagent/states.go | Switches module execution to use precomputed cmd.ModuleArgs() results. |
| cmds/dutagent/rpc.go | Uses cmd.HelpText() to provide Details output rather than scanning for “main”. |
Comments suppressed due to low confidence (1)
pkg/module/time/time-example-cfg.yml:20
just-wait'stime-waitmodule no longer hasforwardArgs: true, but the command description says it should finish after the provided amount of time. With the new semantics, runtime args will be ignored unless a module is markedforwardArgs(or the command declaresargs:and uses templates). Update this example to either mark the moduleforwardArgs: trueor declare a named argument (e.g.,duration) and reference it via${duration}in module args /with.
just-wait:
desc: "Do nothing and finish after the provided amount of time"
uses:
- module: time-wait
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
61a5d42 to
43cb767
Compare
The "main" flag on modules was misleading — it implied importance or rank rather than describing the actual role: routing runtime arguments to a specific module. Rename to "passthrough" across Go source, tests, YAML configs, testdata, and documentation. BREAKING CHANGE: The `main` YAML config key on modules is replaced by `passthrough`. Existing config files must be updated. Co-Authored-By: Jens Topp <jens.topp@blindspot.software> Signed-off-by: Fabian Wienand <fabian.wienand@9elements.com>
43cb767 to
b7e0565
Compare
jenstopp
approved these changes
Apr 12, 2026
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.
mainmodule flag topassthroughacross all Go source, tests, YAML configs, example configs, testdata, and documentationHasPassthrough,ErrMultiplePassthroughModules), reads naturally in prose, and looks clean in YAML (passthrough: true)