Skip to content

fix: add missing --network flag for ip static-nat enable command - #45

Open
cokerrd wants to merge 1 commit into
zsoftly:mainfrom
cokerrd:fix/enable-static-nat
Open

fix: add missing --network flag for ip static-nat enable command#45
cokerrd wants to merge 1 commit into
zsoftly:mainfrom
cokerrd:fix/enable-static-nat

Conversation

@cokerrd

@cokerrd cokerrd commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Addresses #44

  • Added --network flag which now passes the correct request to the api
  • Corrected the help text example
  • Updated test to include network
  • Corrected output on enabling static-nat

Previous output
Screenshot 2026-07-23 at 00 13 51

corrected output
Screenshot 2026-07-23 at 00 53 09

Demo

Screen.Recording.2026-07-23.at.00.36.53.mov

Summary by CodeRabbit

  • New Features

    • Static NAT enablement now requires a target network in addition to the instance.
    • Public IPs are associated with both the selected instance and network.
  • Improvements

    • Command output now provides a simplified status and message summary.
    • Success responses are reported more clearly after enabling Static NAT.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Static NAT enablement now requires a network slug, includes it in the API request, returns the response envelope, and displays the resulting status and message in the CLI.

Changes

Static NAT network association

Layer / File(s) Summary
Static NAT API contract
pkg/api/ipaddress/ipaddress.go, pkg/api/ipaddress/ipaddress_test.go
The request includes network, EnableStaticNAT accepts the network slug and returns the response envelope, and tests validate the updated request and success status.
CLI network wiring and output
internal/commands/ip.go
The command requires --network, forwards it to the API service, and prints STATUS/MESSAGE output.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

Suggested reviewers: ditahm6, ditahkk, godsonten, clintonche

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding the missing --network flag to ip static-nat enable.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
pkg/api/ipaddress/ipaddress_test.go (1)

191-198: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Cover the response message used by the CLI.

The updated command renders ip.Message, but this test only verifies Status; populate Message in the fixture and assert result.Message so the response-envelope/output contract is covered.

🤖 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 `@pkg/api/ipaddress/ipaddress_test.go` around lines 191 - 198, Update the
response fixture used by this test to populate the Message field, then add an
assertion for result.Message alongside the existing result.Status check. Verify
the expected message emitted by the CLI response envelope while preserving the
current body assertions.
🤖 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.

Nitpick comments:
In `@pkg/api/ipaddress/ipaddress_test.go`:
- Around line 191-198: Update the response fixture used by this test to populate
the Message field, then add an assertion for result.Message alongside the
existing result.Status check. Verify the expected message emitted by the CLI
response envelope while preserving the current body assertions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fef6a324-2442-4c88-8535-3a64fc8b855b

📥 Commits

Reviewing files that changed from the base of the PR and between b9d121c and ef62931.

📒 Files selected for processing (3)
  • internal/commands/ip.go
  • pkg/api/ipaddress/ipaddress.go
  • pkg/api/ipaddress/ipaddress_test.go

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.

1 participant