Skip to content

Conversation

@ncode
Copy link
Owner

@ncode ncode commented Feb 7, 2026

This pull request introduces significant improvements to SSH config resolution, ensuring full compatibility with OpenSSH-style Host and Match evaluation. It replaces the previous SSH config library with a fork that supports advanced parsing, updates the resolution logic to use this new library, and adds tests to verify correct behavior with Match blocks. These changes make host resolution more accurate and robust.

SSH config resolution improvements:

  • Switched from github.com/kevinburke/ssh_config to github.com/ncode/ssh_config in go.mod and internal/sshConn/config.go, enabling OpenSSH-style Host and Match evaluation for more accurate host resolution. [1] [2]
  • Refactored the SSHConfigResolver logic in internal/sshConn/config.go to use the new library's Resolve method, ensuring proper handling of Host and Match blocks and explicit overrides. [1] [2]
  • Added the resolve helper function to centralize SSH config resolution and context handling.

Testing enhancements:

  • Added tests in internal/sshConn/config_test.go to verify correct application of Match blocks, non-matching blocks, and explicit overrides during host resolution.

Documentation update:

  • Updated README.md to clarify that host resolution now follows OpenSSH-style Host and Match evaluation.

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 33.33333% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.62%. Comparing base (50a3ff1) to head (7d4e782).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
internal/sshConn/config.go 33.33% 12 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master       #7      +/-   ##
==========================================
+ Coverage   50.42%   50.62%   +0.20%     
==========================================
  Files          18       18              
  Lines        1178     1193      +15     
==========================================
+ Hits          594      604      +10     
- Misses        506      509       +3     
- Partials       78       80       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ncode ncode merged commit 6e065d3 into master Feb 7, 2026
2 checks passed
@ncode ncode deleted the juliano/ssh_config branch February 7, 2026 19:48
ncode added a commit that referenced this pull request Feb 7, 2026
feat: migrate ssh config resolver and stop tracking pretty binary
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