Skip to content

fix(config-cli): fix flag bugs + expose policy_per_dial in config gen - #4069

Open
0pcom wants to merge 2 commits into
skycoin:developfrom
0pcom:fix/config-cli-audit
Open

fix(config-cli): fix flag bugs + expose policy_per_dial in config gen#4069
0pcom wants to merge 2 commits into
skycoin:developfrom
0pcom:fix/config-cli-audit

Conversation

@0pcom

@0pcom 0pcom commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

Audit + targeted fixes for the skywire cli config command group. Scoped entirely to cmd/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/-b never triggered an endpoint refresh. The Run body checked Changed("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. The autostart default-case fatal logged setVPNServerSecure; now logs setVPNServerAutostart.
  • update svc: two garbled error strings cleaned up.

Improvements

  • gen: new --policy flag (env POLICYPERDIAL) to set routing.policy_per_dial, which previously had no CLI path despite being a supported config knob. Accepts preset:<name> (e.g. preset:adaptive), @/path/policy.star, @/path/policy.wasm, inline Starlark, or empty for built-in defaults. Applied in configureRouting and preserved across --regen, matching the existing min_hops / cascade preservation.
  • gen: document POLICYPERDIAL in the skywire.conf (SKYENV) template (config gen -q), next to the existing MUXROUTES entry.
  • 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.
  • Config-package unit tests pass (go test ./cmd/skywire-cli/commands/config/ → ok).
  • gen/update exercised against temp configs only; verified --policy lands in policy_per_dial, survives --regen, --autoconn is now hidden yet still functional, and the update subcommands rewrite a temp config as expected.

0pcom added 2 commits August 22, 2026 09:55
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
0pcom force-pushed the fix/config-cli-audit branch from 9c85f8a to fde2e84 Compare August 22, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant