Skip to content

Conversation

@tgauth
Copy link
Collaborator

@tgauth tgauth commented Dec 5, 2025

PR Summary

  • Modify get behavior to warn instead of error if any input is provided for filtering so DSC's synthetic test can be utilized
  • Add trace level and formatting options for easier debugging
  • Add helper functions for formatting different argument types, including match blocks
  • Expand set Pester tests to cover various argument types and invocation from DSC

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR expands the sshdconfig set capability to handle various SSH configuration argument types beyond simple strings. It modifies the get behavior to warn instead of error when input filters are provided (enabling DSC synthetic tests), adds configurable tracing with level and format options, and implements comprehensive formatting functions for different value types including match blocks.

Key changes:

  • Changed get command behavior from error to warning when input filters are provided
  • Added trace level and format configuration options (CLI flags and environment variable support)
  • Implemented format_sshd_value() and format_match_block() helper functions to properly format booleans, arrays (with comma/space separation), numbers, and match blocks
  • Split MULTI_ARG_KEYWORDS into comma-separated and space-separated lists for proper formatting

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
resources/sshdconfig/tests/sshdconfig.set.tests.ps1 Expanded set tests to cover boolean, array (comma/space-separated), and match block value types
resources/sshdconfig/src/util.rs Added trace configuration support, format_sshd_value() and format_match_block() formatting functions, changed get to warn on input filters
resources/sshdconfig/src/set.rs Updated set logic to handle repeatable keywords and use new formatting functions
resources/sshdconfig/src/parser.rs Updated to reference split multi-arg keyword constants and removed debug code
resources/sshdconfig/src/metadata.rs Split MULTI_ARG_KEYWORDS into comma-separated and space-separated lists
resources/sshdconfig/src/main.rs Added trace level/format argument handling with DSC_TRACE_LEVEL environment variable support
resources/sshdconfig/src/args.rs Added TraceFormat and TraceLevel enums with CLI argument definitions
resources/sshdconfig/locales/en-us.toml Added error message keys for match block validation and array element validation
dsc/tests/dsc_sshdconfig.tests.ps1 Added DSC integration test for set command with various value types

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tgauth tgauth requested a review from SteveL-MSFT December 5, 2025 21:00
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