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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

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

@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

tgauth and others added 3 commits July 11, 2025 14:57
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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?

Command::Get { setting } => invoke_get(setting),
Command::Set { input } => invoke_set(input),
Command::Export => {
debug!("Export command");
Copy link
Member

Choose a reason for hiding this comment

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

should i18n all strings

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