fix(config-cli): fix flag bugs + expose policy_per_dial in config gen - #4069
Open
0pcom wants to merge 2 commits into
Open
fix(config-cli): fix flag bugs + expose policy_per_dial in config gen#40690pcom wants to merge 2 commits into
config gen#40690pcom wants to merge 2 commits into
Conversation
0pcom
force-pushed
the
fix/config-cli-audit
branch
from
August 22, 2026 14:20
d95b223 to
9c85f8a
Compare
Audit + fixes for the `skywire cli config` group (scoped to
cmd/skywire-cli/commands/config/):
Bug fixes
- gen: `--autoconn` (-y) was leaking into the default help because its
hidden-flags registration appended "hide" instead of "autoconn"; hide it
as intended.
- update: `--url`/-b never triggered an endpoint refresh — the Run checked
Changed("serviceConfURL"), a flag name that does not exist. Check the real
"url" flag so passing a custom service URL implies --endpoints.
- update vpns: the autostart default-case error logged the wrong variable
(setVPNServerSecure); log setVPNServerAutostart.
- update svc: fix two garbled error strings.
Improvements
- gen: add `--policy` (env POLICYPERDIAL) to set routing.policy_per_dial,
which had no CLI path despite being a supported knob. Accepts
preset:<name>, @/path.star, @/path.wasm, inline Starlark, or empty.
Applied in configureRouting and preserved across --regen (matching the
existing min_hops / cascade preservation).
- gen: document POLICYPERDIAL in the skywire.conf (SKYENV) template.
- update: add a Long help describing targeting (-i/-o/-p/-u), the app
subcommands, and the top-level flags.
All existing config-package unit tests pass; `config gen`/`update` verified
against temp configs only.
…rides The --policy flag adds the missing CLI path for policy_per_dial, but the shipped default must stay preset:adaptive (owner decision + skycoin#4045). Restore the adaptive fallback when --policy/POLICYPERDIAL is unset, keep the flag as an override, and keep the regen-preserve of an operator's explicit choice.
0pcom
force-pushed
the
fix/config-cli-audit
branch
from
August 22, 2026 14:55
9c85f8a to
fde2e84
Compare
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
Audit + targeted fixes for the
skywire cli configcommand group. Scoped entirely tocmd/skywire-cli/commands/config/; strictly backward compatible (no flag renames or removals).Bug fixes
gen:--autoconn(-y) leaked into the default help. Its hidden-flags registration appended"hide"instead of"autoconn", so the flag intended to be hidden was always visible. Now hidden as intended (behavior of the flag itself is unchanged).update:--url/-bnever triggered an endpoint refresh. The Run body checkedChanged("serviceConfURL")— a flag name that does not exist — so it was dead. Now checks the real"url"flag, so passing a custom service-conf URL implies--endpoints.update vpns: wrong variable in the autostart error path. Theautostartdefault-case fatal loggedsetVPNServerSecure; now logssetVPNServerAutostart.update svc: two garbled error strings cleaned up.Improvements
gen: new--policyflag (envPOLICYPERDIAL) to setrouting.policy_per_dial, which previously had no CLI path despite being a supported config knob. Acceptspreset:<name>(e.g.preset:adaptive),@/path/policy.star,@/path/policy.wasm, inline Starlark, or empty for built-in defaults. Applied inconfigureRoutingand preserved across--regen, matching the existingmin_hops/cascadepreservation.gen: documentPOLICYPERDIALin theskywire.conf(SKYENV) template (config gen -q), next to the existingMUXROUTESentry.update: added a Long help describing target selection (-i/-o/-p/-u), the app subcommands (hv/sc/ss/vpnc/vpns/svc), and the top-level flags.Testing
go build ./cmd/skywire-cli/commands/config/— clean.go test ./cmd/skywire-cli/commands/config/→ ok).gen/updateexercised against temp configs only; verified--policylands inpolicy_per_dial, survives--regen,--autoconnis now hidden yet still functional, and theupdatesubcommands rewrite a temp config as expected.