feat(network): improve service network output clarity#225
Conversation
…tions Restructure `service network` output to clearly separate: - **Private Networking** (between services on Zeabur): shows internal hostname:port for each port - **Public Networking** (connect from outside Zeabur): per-port guidance — TCP/UDP ports show forwarded host:port or prompt to enable port forwarding; HTTP ports indicate domain binding is needed Also fetch ports unconditionally (not only when port forwarding is enabled) so private networking always shows port info. JSON output updated accordingly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughPort retrieval was moved earlier when an environment ID is provided; JSON output now always includes the pre-fetched ports in that case. Non-JSON output was reorganized into "Private Networking" and "Public Networking" sections with new messaging for HTTP ports and port-forwarding states, plus early handling when no ports exist. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@internal/cmd/service/network/network.go`:
- Around line 145-151: The current printing always emits the "Private
Networking" and "Public Networking" headers even when there are no ports; update
the logic around the loops that print ports (the slices ports and publicPorts
and the variables internalHost/externalHost) to only print each section header
if the corresponding slice is non-empty (or environmentID is present), otherwise
print a short fallback line like "No private ports configured" / "No public
ports configured" or skip the section entirely; ensure you modify the blocks
that call f.Log.Infof (and the fmt.Println()) so headers and blank lines are
conditional around the loops that iterate over ports and publicPorts.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 5dcd2be1-2c8c-44c9-8898-7f3565f62b1b
📒 Files selected for processing (1)
internal/cmd/service/network/network.go
When no ports are configured or no environment is specified, show the DNS name with a warning instead of printing empty section headers. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
service networkoutput into Private Networking and Public Networking sectionsBefore
After
Test plan
service networkwith TCP service (port forwarding enabled) — shows forwarded host:portservice networkwith TCP service (port forwarding disabled) — shows warning + enable commandservice networkwith HTTP service — shows "bind a domain to access externally"service network --json— ports array always present regardless of port forwarding state🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Improvements