Skip to content

Refactor ssh option passing#723

Merged
selzoc merged 1 commit intomainfrom
refactor-option-parsing
May 5, 2026
Merged

Refactor ssh option passing#723
selzoc merged 1 commit intomainfrom
refactor-option-parsing

Conversation

@selzoc
Copy link
Copy Markdown
Member

@selzoc selzoc commented May 5, 2026

No description provided.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

Warning

Rate limit exceeded

@selzoc has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 47 minutes and 40 seconds before requesting another review.

To continue reviewing without waiting, purchase usage credits in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0dac60ff-1711-4152-abe0-d5ccf9fd4346

📥 Commits

Reviewing files that changed from the base of the PR and between ee6e1cb and 325e9e1.

📒 Files selected for processing (2)
  • ssh/ssh_args.go
  • ssh/ssh_args_test.go

Walkthrough

The SSHArgs.LoginForHost method was updated to change the ssh login argument ordering. The method now returns ["-l", host.Username, "--", host.Host] instead of the previous [host.Host, "-l", host.Username]. This introduces an explicit -- delimiter and repositions the host to the end of the argument list. The corresponding test cases in ssh/ssh_args_test.go were updated to reflect the new argument ordering for both IPv4 and IPv6 login scenarios. No changes were made to exported or public entity signatures.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive No pull request description was provided, making it impossible to assess whether it relates to the changeset. Add a description explaining the rationale for the SSH argument order change and any benefits this refactoring provides.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Refactor ssh option passing' accurately reflects the main change of reordering SSH login arguments and restructuring option passing logic.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor-option-parsing

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
ssh/ssh_args_test.go (1)

42-54: 🧹 Nitpick | 🔵 Trivial | ⚖️ Poor tradeoff

Consider adding an integration test that checks OptsForHost + LoginForHost assembly order.

LoginForHost is only tested in isolation here. A test that exercises the full argument slice as it is passed to exec.Command (or equivalent) would confirm that -- always appears after all -o flags, making the invariant explicit and regression-proof.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ssh/ssh_args_test.go` around lines 42 - 54, Add an integration-style test
that builds the full SSH argument slice by calling SSHArgs.OptsForHost(host) and
appending SSHArgs.LoginForHost(host) (or vice‑versa as your production code
does) and assert that the resulting []string contains all "-o" options before
the literal "--" and that "--" appears immediately before the host string;
specifically target functions OptsForHost and LoginForHost in the test to verify
the assembly order and prevent regressions where "--" might be placed before
option flags.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@ssh/ssh_args_test.go`:
- Around line 42-54: Add an integration-style test that builds the full SSH
argument slice by calling SSHArgs.OptsForHost(host) and appending
SSHArgs.LoginForHost(host) (or vice‑versa as your production code does) and
assert that the resulting []string contains all "-o" options before the literal
"--" and that "--" appears immediately before the host string; specifically
target functions OptsForHost and LoginForHost in the test to verify the assembly
order and prevent regressions where "--" might be placed before option flags.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 7f30b2fb-3520-4f15-9151-21ef6932043d

📥 Commits

Reviewing files that changed from the base of the PR and between e786ee9 and ee6e1cb.

📒 Files selected for processing (2)
  • ssh/ssh_args.go
  • ssh/ssh_args_test.go

coderabbitai[bot]
coderabbitai Bot previously approved these changes May 5, 2026
ai-assisted=yes
[TNZ-94640]

Signed-off-by: Aram Price <aram.price@broadcom.com>
Signed-off-by: Chris Selzo <chris.selzo@broadcom.com>
@selzoc selzoc merged commit 5a0aa3d into main May 5, 2026
46 checks passed
@selzoc selzoc deleted the refactor-option-parsing branch May 5, 2026 23:23
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