Skip to content

Conversation

@Benehiko
Copy link
Member

This patch deprecates exported network commands and moves the implementation details to an unexported function.

Commands that are affected include:

  • network.NewNetworkCommand
  • network.NewPruneCommand

- What I did

- How I did it

- How to verify it

- Human readable description for the release notes

Go SDK: cli/command/network: deprecate `NewNetworkCommand`. These functions will be removed in the next release.

- A picture of a cute animal (not mandatory but encouraged)

@Benehiko Benehiko requested review from Copilot and thaJeztah August 20, 2025 10:30
Copy link

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

This PR deprecates exported network commands by adding deprecation warnings and moving the implementation to unexported functions. This follows a pattern of encapsulating command creation to prevent direct imports while maintaining backward compatibility.

  • Deprecate NewNetworkCommand and NewPruneCommand functions with deprecation comments
  • Create unexported newNetworkCommand and newPruneCommand functions containing the actual implementation
  • Update parameter naming from dockerCli to dockerCLI for consistency
  • Add staticcheck suppressions for deprecated function usage

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
cli/command/network/prune.go Deprecates NewPruneCommand and creates unexported newPruneCommand with consistent parameter naming
cli/command/network/cmd.go Deprecates NewNetworkCommand and creates unexported newNetworkCommand, updates all subcommand calls to use unexported functions
cli/command/commands/commands.go Adds staticcheck suppression for deprecated NewNetworkCommand usage

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

This patch deprecates exported network commands and moves the
implementation details to an unexported function.

Commands that are affected include:

- network.NewNetworkCommand
- network.NewPruneCommand

Signed-off-by: Alano Terblanche <[email protected]>
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 11.76471% with 15 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cli/command/network/cmd.go 0.00% 11 Missing ⚠️
cli/command/network/prune.go 40.00% 3 Missing ⚠️
cli/command/commands/commands.go 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@Benehiko Benehiko added impact/changelog impact/deprecation kind/refactor PR's that refactor, or clean-up code area/go-sdk Changes affecting the Go SDK impact/go-sdk Noteworthy (compatibility changes) in the Go SDK labels Aug 20, 2025
@Benehiko Benehiko added this to the 29.0.0 milestone Aug 20, 2025
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah thaJeztah merged commit 642adae into docker:master Aug 20, 2025
104 of 105 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/go-sdk Changes affecting the Go SDK impact/changelog impact/deprecation impact/go-sdk Noteworthy (compatibility changes) in the Go SDK kind/refactor PR's that refactor, or clean-up code process/cherry-picked

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants