Skip to content

sshdconfig: add tracing and update constants #958

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jul 14, 2025

Conversation

tgauth
Copy link
Collaborator

@tgauth tgauth commented Jul 11, 2025

PR Summary

  • add json tracing to sshdconfig (based on registry implementation)
  • update consts lists in metadata.rs and add related tests to tree-sitter grammar and parser

@tgauth tgauth closed this Jul 11, 2025
@tgauth tgauth deleted the add-sshdconfig-tracing branch July 11, 2025 17:56
@tgauth tgauth restored the add-sshdconfig-tracing branch July 11, 2025 17:58
@tgauth tgauth reopened this Jul 11, 2025
@tgauth tgauth requested a review from Copilot July 11, 2025 18:55
Copy link
Contributor

@Copilot 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 adds JSON tracing functionality to the sshdconfig tool and updates SSH configuration constants and parsing logic. The changes implement structured logging similar to the registry implementation and expand the list of supported SSH configuration keywords.

  • Adds JSON-formatted tracing with stderr output for better observability
  • Updates SSH keyword constants to include more multi-argument and repeatable keywords
  • Enhances parser validation and adds support for quoted strings with spaces

Reviewed Changes

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

Show a summary per file
File Description
sshdconfig/src/main.rs Adds tracing initialization and structured logging with debug statements
sshdconfig/src/util.rs Implements enable_tracing() function for JSON-formatted logging setup
sshdconfig/src/parser.rs Adds debug logging, multi-arg validation, and string trimming
sshdconfig/src/metadata.rs Expands MULTI_ARG_KEYWORDS and REPEATABLE_KEYWORDS constants
sshdconfig/src/get.rs Adds debug logging to get operations
sshdconfig/Cargo.toml Updates tracing-subscriber with additional features
sshdconfig/locales/en-us.toml Adds new error messages and reorganizes existing ones
sshdconfig/tests/defaultshell.tests.ps1 Updates tests to parse JSON tracing output
tree-sitter-ssh-server-config/test/corpus/valid_expressions.txt Adds test case for repeatable keyword parsing

Copy link
Member

@SteveL-MSFT SteveL-MSFT left a comment

Choose a reason for hiding this comment

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

I noticed in local builds this message:

Building tree-sitter-ssh-server-config ... for current
Warning: rule empty_line is just a `seq` or `choice` rule with a single element. This is unnecessary.

Do you want to fix that in this PR as well?

@SteveL-MSFT SteveL-MSFT added this pull request to the merge queue Jul 14, 2025
Merged via the queue into PowerShell:main with commit bb31fac Jul 14, 2025
4 checks passed
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.

2 participants