Skip to content

Conversation

@thaJeztah
Copy link
Member

cli: remove HasCompletionArg utility

It was only used in a single place and has no external consumers.
Move it to where it's used to keep things together.

cli: deprecate VisitAll, DisableFlagsInUseLine utilities

These utilities were only used internally; create a local copy
where used, and deprecate the ones in cli.

cmd/docker: fix some minor linting issues

- Human readable description for the release notes

Go SDK: cli: deprecate `VisitAll`, `DisableFlagsInUseLine` utilities. These utilities were only used internally and will be removed in the next release.
Go SDK: cli: remove `HasCompletionArg` utility. This utility was only used internally.

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

It was only used in a single place and has no external consumers.
Move it to where it's used to keep things together.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 54.34783% with 21 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/docker/docker.go 56.25% 14 Missing ⚠️
cli/cobra.go 0.00% 4 Missing ⚠️
cli-plugins/plugin/plugin.go 70.00% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@thaJeztah thaJeztah marked this pull request as draft August 15, 2025 14:42
@thaJeztah thaJeztah added the kind/refactor PR's that refactor, or clean-up code label Aug 15, 2025
These utilities were only used internally; create a local copy
where used, and deprecate the ones in cli.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
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 refactors the CLI utilities by deprecating and removing functions that were only used internally. The main changes include removing the HasCompletionArg utility and deprecating VisitAll and DisableFlagsInUseLine utilities while creating local copies where needed.

  • Remove HasCompletionArg utility and move implementation to where it's used
  • Deprecate VisitAll and DisableFlagsInUseLine utilities with local implementations
  • Fix minor linting issues in cmd/docker package

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
cli/cobra.go Deprecates VisitAll and DisableFlagsInUseLine utilities, removes HasCompletionArg
cli/cobra_test.go Removes test for deprecated utilities
cmd/docker/docker.go Adds local implementation of removed utilities and fixes linting issues
cmd/docker/docker_test.go Adds test for local visitAll implementation
cli-plugins/plugin/plugin.go Adds local implementation of visitAll utility
cli-plugins/plugin/plugin_test.go Adds test for local visitAll implementation

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

@thaJeztah thaJeztah merged commit 877a6ef into docker:master Aug 18, 2025
96 checks passed
@thaJeztah thaJeztah deleted the cli_internalize_utils branch August 18, 2025 09:40
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/deprecation kind/refactor PR's that refactor, or clean-up code process/cherry-picked status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants