Skip to content

Conversation

@cdalar
Copy link
Owner

@cdalar cdalar commented Aug 12, 2024

No description provided.

@CLAassistant
Copy link

CLAassistant commented Feb 5, 2025

CLA assistant check
All committers have signed the CLA.

@cdalar cdalar marked this pull request as ready for review August 16, 2025 18:14
@cdalar cdalar requested a review from Copilot August 16, 2025 18:14

This comment was marked as outdated.

cdalar and others added 4 commits August 16, 2025 20:16
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@codecov
Copy link

codecov bot commented Sep 3, 2025

Codecov Report

❌ Patch coverage is 10.15707% with 858 lines in your changes missing coverage. Please review.
✅ Project coverage is 10.76%. Comparing base (fc3e52e) to head (da8d33a).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
internal/cloud/hetzner.go 8.44% 141 Missing ⚠️
internal/cloud/aws.go 0.00% 126 Missing ⚠️
cmd/network.go 5.50% 103 Missing ⚠️
cmd/templates.go 1.19% 83 Missing ⚠️
cmd/vm.go 7.86% 82 Missing ⚠️
internal/provideraws/common.go 0.00% 60 Missing ⚠️
internal/tools/scp.go 57.14% 40 Missing and 8 partials ⚠️
cmd/create.go 2.17% 45 Missing ⚠️
cmd/ssh.go 2.50% 39 Missing ⚠️
internal/tools/remote-run.go 0.00% 39 Missing ⚠️
... and 5 more
Additional details and impacted files
@@            Coverage Diff            @@
##            main     #480      +/-   ##
=========================================
+ Coverage   8.23%   10.76%   +2.52%     
=========================================
  Files         31       34       +3     
  Lines       3036     3856     +820     
=========================================
+ Hits         250      415     +165     
- Misses      2764     3411     +647     
- Partials      22       30       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cdalar cdalar requested a review from Copilot September 5, 2025 17:45
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds comprehensive jumphost support and network management capabilities to the onctl cloud management tool. The PR enables connecting to VMs through jump hosts for secure access patterns and provides full network lifecycle management across cloud providers.

  • Implements SSH ProxyJump functionality for secure VM access through jump hosts
  • Adds network resource management with CRUD operations for AWS and Hetzner
  • Enhances VM listing to only show running instances across all providers

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
internal/tools/ssh.go Adds jumphost support to SSH connections using ProxyJump
internal/tools/scp.go Implements jumphost functionality for SCP file transfers
internal/tools/remote-run.go Adds jumphost support for remote SSH connections
internal/provideraws/common.go Adds GetLatestUbuntu2204AMI function with dynamic AMI selection
internal/cloud/hetzner.go Adds network management and filters VM list to running instances
internal/cloud/gcp.go Filters VM list to running instances and adds stub network methods
internal/cloud/cloud.go Adds network management interfaces and jumphost VM field
internal/cloud/azure.go Filters VM list to running instances and adds stub network methods
internal/cloud/aws.go Adds network management and filters VM list to running instances
cmd/vm.go New command for VM network attach/detach operations
cmd/ssh.go Adds jumphost resolution and IP selection logic
cmd/root.go Initializes network managers for supported providers
cmd/network.go New command for network CRUD operations
cmd/create.go Adds jumphost support for VM creation and domain registration

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +65 to +75
func (r *Remote) downloadFileWithJumpHost(srcPath, dstPath string) error {
// Create a temporary file for the private key
tempKeyFile, err := os.CreateTemp("", "onctl_ssh_key_*")
if err != nil {
return fmt.Errorf("failed to create temp key file: %v", err)
}
defer func() {
if err := os.Remove(tempKeyFile.Name()); err != nil {
log.Printf("Failed to remove temp key file: %v", err)
}
}()
Copy link

Copilot AI Sep 5, 2025

Choose a reason for hiding this comment

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

[nitpick] The code for creating and cleaning up temporary key files is duplicated in both downloadFileWithJumpHost and uploadFileWithJumpHost methods. Consider extracting this logic into a helper method to reduce duplication and improve maintainability.

Copilot uses AI. Check for mistakes.
DeviceIndex: aws.Int64(0),
// SubnetId: aws.String(subnetIds[0]),
AssociatePublicIpAddress: aws.Bool(true),
AssociatePublicIpAddress: aws.Bool(server.JumpHost == ""), // Only associate public IP if no jumphost
Copy link

Copilot AI Sep 5, 2025

Choose a reason for hiding this comment

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

[nitpick] The condition server.JumpHost == \"\" is used to determine whether to associate a public IP address. This logic should be more explicit and potentially configurable. Consider adding a dedicated boolean field or method to make this decision clearer.

Copilot uses AI. Check for mistakes.
Comment on lines +154 to +155
var targetIP string
if resolvedJumpHost != "" && (vm.IP == "" || vm.IP == "<nil>") {
Copy link

Copilot AI Sep 5, 2025

Choose a reason for hiding this comment

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

[nitpick] The string comparison vm.IP == \"<nil>\" suggests inconsistent handling of nil/empty IP addresses. Consider standardizing how empty IP addresses are represented throughout the codebase (e.g., always use empty string or a dedicated constant).

Copilot uses AI. Check for mistakes.
@socket-security
Copy link

socket-security bot commented Sep 5, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedgolang/​github.com/​charmbracelet/​glamour@​v0.10.0100100100100100

View full report

configuration examples
- Updated golang.org/x/net to v0.43.0 from main
- Kept golang.org/x/image dependency for go-term-markdown
- Resolved go.mod conflicts
- Remove github.com/MichaelMure/go-term-markdown dependency
- Add github.com/charmbracelet/glamour v0.10.0 dependency
- Update templates.go to use glamour.NewTermRenderer with auto-style detection
- Improve markdown rendering with better terminal compatibility
- Tested with onctl templates describe azure command
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.

3 participants