Repository navigation
Support net-ssh 8 - #1974
Support net-ssh 8#1974excid3 wants to merge 4 commits into
Conversation
Widen the net-ssh dependency from ~> 7.3 to >= 7.3, < 9.0 so Kamal can run on net-ssh 8.0.0.rc5 while still working on 7.x. net-ssh 8 merged the fix for remote forwarding printing diagnostics to stdout (net-ssh/net-ssh#953), so the NetSshForwardingNoPuts prepend is now only applied on net-ssh 7. Nothing else needed to change: Kamal's SSH option hashes are already free of nils, and the Proxy::Jump and Forward APIs it calls are unchanged in 8. Claude-Session: https://claude.ai/code/session_01EkpXJSoszCrBejRLUVUpjg
…eases With net-ssh 8.0.0 released, a fresh resolve of the widened constraint picked net-ssh 8.0.0 together with net-scp 1.2.1 and net-sftp 2.1.2, the last releases of each without an upper bound on net-ssh. The current net-scp 4.1.0 and net-sftp 4.0.0 both cap net-ssh below 8. Floor both so Bundler stays on net-ssh 7.x until net-scp and net-sftp publish releases that admit 8, at which point 8 resolves on its own.
|
net-ssh 8.0.0 final is out (identical to rc5 apart from the version file), so I went to finish this as 8-only and hit two things worth flagging. Going The widened constraint alone was a trap. With 8.0.0 published, a fresh resolve of the first commit's gemspec picked net-ssh 8.0.0 together with net-scp 1.2.1 and net-sftp 2.1.2 from 2013, the last releases of each with no upper bound on net-ssh. CI deletes the lockfile, so it would have done exactly that. The second commit adds Resolution with the floors in place:
So the PR is mergeable as-is: it stays on 7.x today and net-ssh 8 lights up on its own once net-scp and net-sftp publish compatible releases. The 8-only cleanup ( |
|
Opened the upstream bumps: net-ssh/net-scp#101 and net-ssh/net-sftp#181. Both are one-line |
net-scp 4.1.1 and net-sftp 4.0.1 lift their net-ssh upper bound to < 9, so Bundler can resolve net-ssh 8 without the floors having to do any work.
CI resolves dependencies fresh, so every job now runs on net-ssh 8. Add a gemfile pinning net-ssh 7 and one matrix job for it, so the version-guarded forwarding patch in sshkit_with_ext.rb stays covered until net-ssh 7 support is dropped.
|
net-scp 4.1.1 and net-sftp 4.0.1 shipped today with
Unit suite passes on both 8.0.2 and 7.3.6. The Docker integration suite ran on 8.0.2 this time (the deployer image resolves the gemspec fresh), and all SSH steps against the VMs succeeded. PR description updated and marked ready for review. |
There was a problem hiding this comment.
🟡 Changes recommended
The newly locked OpenSSL gem needs development headers missing from the production Alpine Dockerfile, blocking image builds.
No open issues 🎉
What changed in this PR
This PR adds net-ssh 8 support while preserving compatibility with net-ssh 7.
Changes:
- Widens SSH dependency constraints and locks net-ssh 8.0.2 with compatible transfer libraries.
- Limits the forwarding-output workaround to net-ssh 7.
- Adds a Ruby 3.4 CI job using a net-ssh 7-specific Gemfile.
[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or rungh pr ready --undo.
Click "Ready for review" or rungh pr readyto reengage.
| File | Description |
|---|---|
| lib/kamal/sshkit_with_ext.rb | Applies the forwarding workaround only before net-ssh 8. |
| kamal.gemspec | Allows net-ssh 8 and sets transfer-library version bounds. |
| gemfiles/net_ssh_7.gemfile | Pins net-ssh 7 for compatibility testing. |
| Gemfile.lock | Locks updated SSH dependencies and OpenSSL. |
| .github/workflows/ci.yml | Adds the net-ssh 7 compatibility job. |
Review effort: Balanced
|
Hi, net-ssh maintainer here. Thanks for doing this. I benchmarked Kamal on net-ssh 8 to see what it changes for deploy times, in case it's useful here. Setup: 3 Docker hosts running OpenSSH, with
Most of the 7.3 → 8.0 gain is Kamal's unit suite and the Docker integration suite passed on 8.0.3 with and without
|
|
It'd be great to have this merged sooner than later. My |
net-ssh 8 is out, and net-scp 4.1.1 and net-sftp 4.0.1 (released 2026-10-22) raise their net-ssh bound to
< 9, so Kamal can run on net-ssh 8 now. This widens Kamal's dependency from~> 7.3to>= 7.3, < 9.0, locks 8.0.2, and keeps 7.x working.What changed
ed25519stays while net-ssh 7 is supported;bcrypt_pbkdfis still used by net-ssh 8 for passphrase-protected OpenSSH keys.NetSshForwardingNoPutsprepend is now applied only whenNet::SSH::Version::MAJOR < 8.gemfiles/net_ssh_7.gemfileplus one matrix job (Ruby 3.4) keep the net-ssh 7 path covered until 7 support is dropped.Nothing else in Kamal needed to change. The SSH option hash is
.compacted, so net-ssh 8'sArgumentErroronniloption values doesn't apply, and theProxy::Jump,Proxy::CommandandForward#remote/cancel_remoteAPIs Kamal calls are unchanged. net-ssh 8.0.1 also madecontrol_master: :autotolerate theforward_agent,keys,known_hostsandkeepaliveoptions sshkit always passes.Verification
gemfiles/net_ssh_7.gemfile).gem install, so it resolved 8.0.2. Every SSH step against the test VMs succeeded. The remaining local failures (exec /bin/sh: invalid argumentinside nested containers) reproduce identically onmainand are a local Docker issue, not SSH.Kamal::Cli::Build::PortForwardingall work.If we go net-ssh 8 only later
Supporting both stays cheap, but when 7 is dropped:
spec.add_dependency "net-ssh", ">= 7.3", "< 9.0"→"~> 8.0", and the net-scp/net-sftp floors become>= 4.1.1/>= 4.0.1.ed25519: net-ssh 8 does Ed25519 through OpenSSL and no longer loads the gem.NetSshForwardingNoPutsand its prepend, plusgemfiles/net_ssh_7.gemfileand its CI job.Worth a changelog note either way: net-ssh 8 requires the
opensslgem 3.2+, which Ruby 3.2 doesn't ship, so Bundler installs it as a native gem on 3.2. net-ssh 8 also stops offering SHA-1 RSA host keys anddiffie-hellman-group14-sha1by default, so very old servers need those re-enabled inssh_config.