feat: add --port flag to azlin for bastion tunnel reuse (#2897)#2937
Merged
feat: add --port flag to azlin for bastion tunnel reuse (#2897)#2937
Conversation
Reduces connection overhead by allowing SSH sessions to reuse an existing bastion tunnel instead of creating a new one per command. Changes: - VMOptions.tunnel_port: new optional int field - Executor.__init__ accepts tunnel_port; _azlin_port_args() helper injects --port <N> into all azlin subcommands (cp, connect, ssh) - SessionManager._execute_ssh_command accepts tunnel_port parameter - CLI: --port option added to both 'exec' and 'start' commands Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
|
🤖 Auto-fixed version bump The version in If you need a minor or major version bump instead, please update |
Contributor
Repo Guardian - PassedAll files in this PR are durable repository content:
No ephemeral content detected.
|
4579583 to
7180bd6
Compare
Contributor
|
🤖 Auto-fixed version bump The version in If you need a minor or major version bump instead, please update |
Contributor
Repo Guardian - PassedAll files in this PR are durable repository content:
No ephemeral content detected.
|
rysweet
added a commit
that referenced
this pull request
Mar 8, 2026
* feat: add --port flag to azlin for bastion tunnel reuse (#2897) Reduces connection overhead by allowing SSH sessions to reuse an existing bastion tunnel instead of creating a new one per command. Changes: - VMOptions.tunnel_port: new optional int field - Executor.__init__ accepts tunnel_port; _azlin_port_args() helper injects --port <N> into all azlin subcommands (cp, connect, ssh) - SessionManager._execute_ssh_command accepts tunnel_port parameter - CLI: --port option added to both 'exec' and 'start' commands Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * ci: trigger full CI pipeline * [skip ci] chore: Auto-bump patch version --------- Co-authored-by: Ubuntu <azureuser@deva.ftnmxvem3frujn3lepas045p5c.xx.internal.cloudapp.net> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--port <N>option toazlin execandazlin startCLI commands to reuse an existing bastion tunnel instead of creating a new one per SSH sessionVMOptions.tunnel_portstores the port;Executor._azlin_port_args()injects--port <N>into allazlinsubcommands (cp,connect,ssh)SessionManager._execute_ssh_commandaccepts optionaltunnel_portfor the same purpose.claude/tools/amplihack/remote/andamplifier-bundle/tools/amplihack/remote/are kept in syncMotivation
Currently each
azlin connect,azlin cp, andazlin sshcall creates a new bastion tunnel, adding overhead per operation. With--port, users can establish one tunnel upfront and reuse it for the session's lifetime.Usage
Test Plan
tests/outside_in/test_bastion_tunnel_reuse.pycover:VMOptions.tunnel_portdefaults toNone, accepts integerExecutor._azlin_port_args()returns[]or['--port', 'N']transfer_contextincludes--portin azlin cp command when setcheck_tmux_statusincludes--portin azlin connect command when setexecandstartaccept--portflag without error--portis wired intoVMOptions.tunnel_portandExecutor(tunnel_port=...)--portis not provideduv run pytest tests/outside_in/test_bastion_tunnel_reuse.py -vQuality Audit
tunnel_portisint | None; click validatestype=intat CLI boundary; no injection risk_azlin_port_args()is a minimal helper eliminating 6 repetitive conditionalsVMOptions(config) →Executor(executes) →cli.py(wires) — cleanNone; existing callers unaffected🤖 Generated with Claude Code