Skip to content

Treat unexpanded config references as unset in the WinRM Check step - #139

Merged
fdevans merged 2 commits into
rundeck-plugins:mainfrom
skywalkw3r:fix-check-unset-args
Oct 20, 2026
Merged

fdevans merged 2 commits into
rundeck-plugins:mainfrom
skywalkw3r:fix-check-unset-args

Conversation

@skywalkw3r

Copy link
Copy Markdown
Contributor

Change

  • contents/common.py: new is_set_arg(value) helper. It returns False for None, "", "None", and a value that is an unexpanded ${...} reference.
  • contents/winrm-check.py: uses it for --certpath, --proxy and --noproxy, in place of the existing not in ("None", "") checks. Nothing else changes.
  • tests/test_common_args.py: unit tests for the helper.

Why

Rundeck leaves ${config.name} unexpanded in script-args when the step configuration has no entry for that property. The Check step then tries to connect through a proxy literally named ${config.winrmproxy}. This breaks the step for jobs saved before the proxy fields existed and for jobs defined via YAML/API without the optional fields.

Verification

  • python -m unittest discover -s tests: all pass, including the new tests.
  • End-to-end on Rundeck: I ran a local Rundeck 6.4.0-SNAPSHOT server against a local stub WinRM endpoint (plain HTTP, basic auth, implements the WS-Man shell calls; not a real Windows host), with this change and Fix NameError in WinRM Check step #137 applied. The step config tested three ways, all reporting Connecting to ... DIRECTLY (no proxy configured) and Connection with host 127.0.0.1 successful:
    • optional fields missing: before this change it failed with the ${config.winrmproxy} proxy error;
    • optional fields as empty strings;
    • optional fields as None.

This builds independently of #137, but you only see the effect once both are in.

Fixes #138

The WinRMCheck step passes its optional settings through script-args,
e.g. "--proxy ${config.winrmproxy}". When a step's configuration has no
entry for one of these properties, Rundeck leaves the "${config.name}"
reference unexpanded, so the script received the literal text as the
value. With the proxy this made every check try to connect through a
proxy host named "${config.winrmproxy}" and fail with a name resolution
error; certpath had the same problem for https checks.

This affects jobs saved before the proxy fields were added and jobs
defined via YAML or the API that leave the optional fields out. The
script already treated "None" and empty values as unset; it now also
treats unexpanded references that way, via a small common.is_set_arg()
helper, for certpath, proxy and noproxy.

Add unit tests for the helper.
@skywalkw3r
skywalkw3r requested review from a team and a balanced review from Copilot October 18, 2026 20:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused changes address the reported configuration issue without identified blocking regressions.

No open issues 🎉

What changed in this PR

Fixes #138 by treating unresolved optional configuration references as unset in the WinRM Check step. The separate startup fix remains in #137.

Changes:

  • Adds shared argument validation for missing values and unexpanded references.
  • Applies validation to certificate and proxy options, with unit tests.
File Description
tests/​test_common_args.py Tests real, missing, and unresolved argument values.
contents/​winrm-check.py Validates optional certificate and proxy arguments.
contents/​common.py Adds the is_set_arg helper.

Review effort: Balanced

@fdevans
fdevans merged commit 5ef348b into rundeck-plugins:main Oct 20, 2026
1 of 2 checks passed
@skywalkw3r
skywalkw3r deleted the fix-check-unset-args branch October 20, 2026 18:21
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.

WinRM Check Step tries to use "${config.winrmproxy}" as a proxy when the proxy fields are not in the step config

3 participants