From 38c997567a2e2be51aca6a82a03aab64ff16f7d7 Mon Sep 17 00:00:00 2001 From: Kynan Ware <47394200+BagToad@users.noreply.github.com> Date: Wed, 4 Mar 2026 05:01:52 -0700 Subject: [PATCH 1/2] Fix incorrect integer conversion from int to uint16 in port forwarder (#12831) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- internal/codespaces/portforwarder/port_forwarder.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/codespaces/portforwarder/port_forwarder.go b/internal/codespaces/portforwarder/port_forwarder.go index 7f696c1a497..b24f8f637f5 100644 --- a/internal/codespaces/portforwarder/port_forwarder.go +++ b/internal/codespaces/portforwarder/port_forwarder.go @@ -264,7 +264,11 @@ func (fwd *CodespacesPortForwarder) UpdatePortVisibility(ctx context.Context, re } // Delete the existing tunnel port to update - err = fwd.connection.TunnelManager.DeleteTunnelPort(ctx, fwd.connection.Tunnel, uint16(remotePort), fwd.connection.Options) + port, err := convertIntToUint16(remotePort) + if err != nil { + return fmt.Errorf("error converting port: %w", err) + } + err = fwd.connection.TunnelManager.DeleteTunnelPort(ctx, fwd.connection.Tunnel, port, fwd.connection.Options) if err != nil { return fmt.Errorf("error deleting tunnel port: %w", err) } From d594c5e91870e11e0d44d67677b48cacc142e170 Mon Sep 17 00:00:00 2001 From: Kynan Ware <47394200+BagToad@users.noreply.github.com> Date: Wed, 4 Mar 2026 07:53:27 -0700 Subject: [PATCH 2/2] docs: add examples to gh issue close help text (#12830) Add examples for closing issues, closing with a comment, closing as duplicate, and closing with a reason. --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Babak K. Shandiz --- pkg/cmd/issue/close/close.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/pkg/cmd/issue/close/close.go b/pkg/cmd/issue/close/close.go index 19510bf89a9..4c1c7d382bf 100644 --- a/pkg/cmd/issue/close/close.go +++ b/pkg/cmd/issue/close/close.go @@ -5,6 +5,7 @@ import ( "net/http" "time" + "github.com/MakeNowJust/heredoc" "github.com/cli/cli/v2/api" fd "github.com/cli/cli/v2/internal/featuredetection" "github.com/cli/cli/v2/internal/ghrepo" @@ -38,7 +39,20 @@ func NewCmdClose(f *cmdutil.Factory, runF func(*CloseOptions) error) *cobra.Comm cmd := &cobra.Command{ Use: "close { | }", Short: "Close issue", - Args: cobra.ExactArgs(1), + Example: heredoc.Doc(` + # Close issue + $ gh issue close 123 + + # Close issue and add a closing comment + $ gh issue close 123 --comment "Closing this issue" + + # Close issue as a duplicate of issue #456 + $ gh issue close 123 --duplicate-of 456 + + # Close issue as not planned + $ gh issue close 123 --reason "not planned" + `), + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { issueNumber, baseRepo, err := shared.ParseIssueFromArg(args[0]) if err != nil {