move cli-plugins metadata types/consts to a separate package by thaJeztah · Pull Request #5902 · docker/cli · GitHub
Skip to content

move cli-plugins metadata types/consts to a separate package - #5902

Merged
thaJeztah merged 2 commits into
docker:masterfrom
thaJeztah:cli_plugin_metadata
Mar 7, 2025
Merged

thaJeztah merged 2 commits into
docker:masterfrom
thaJeztah:cli_plugin_metadata

Conversation

@thaJeztah

@thaJeztah thaJeztah commented Mar 7, 2025 •

Copy link
Copy Markdown
Member

move cli-plugins metadata types/consts to a separate package

This prevents cli-plugins having to import the plugin-manager.

move cli-plugins annotation consts to a separate package

- Human readable description for the release notes

Go SDK: Move various types and consts from `cli-plugins/manager` to a separate package.

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

This prevents cli-plugins having to import the plugin-manager.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah added status/2-code-review area/plugins 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 Mar 7, 2025
@thaJeztah
thaJeztah force-pushed the cli_plugin_metadata branch from 48b4e5c to 292713c Compare March 7, 2025 13:48
@codecov-commenter

codecov-commenter commented Mar 7, 2025 •

Copy link
Copy Markdown

"os"

"github.com/docker/cli/cli-plugins/manager"
"github.com/docker/cli/cli-plugins/metadata"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Went a bit back-and-forth what made most sense;

  • "github.com/docker/cli/cli-plugins/plugin/metadata"
  • "github.com/docker/cli/cli-plugins/metadata"

In the end, decided on the last one (for now), because it's shared between both, but let me know what you think!

Comment on lines +3 to +28
const (
// CommandAnnotationPlugin is added to every stub command added by
// AddPluginCommandStubs with the value "true" and so can be
// used to distinguish plugin stubs from regular commands.
CommandAnnotationPlugin = "com.docker.cli.plugin"

// CommandAnnotationPluginVendor is added to every stub command
// added by AddPluginCommandStubs and contains the vendor of
// that plugin.
CommandAnnotationPluginVendor = "com.docker.cli.plugin.vendor"

// CommandAnnotationPluginVersion is added to every stub command
// added by AddPluginCommandStubs and contains the version of
// that plugin.
CommandAnnotationPluginVersion = "com.docker.cli.plugin.version"

// CommandAnnotationPluginInvalid is added to any stub command
// added by AddPluginCommandStubs for an invalid command (that
// is, one which failed it's candidate test) and contains the
// reason for the failure.
CommandAnnotationPluginInvalid = "com.docker.cli.plugin-invalid"

// CommandAnnotationPluginCommandPath is added to overwrite the
// command path for a plugin invocation.
CommandAnnotationPluginCommandPath = "com.docker.cli.plugin.command_path"
)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Didn't mark these as deprecated yet (nor did I remove the GoDoc strings); we could if we wanted to though.

@thaJeztah thaJeztah added this to the 28.0.2 milestone Mar 7, 2025
@thaJeztah
thaJeztah requested review from Benehiko and vvoland March 7, 2025 15:29
@thaJeztah

Copy link
Copy Markdown
Member Author

cc @Benehiko @vvoland ptal 🤗

Comment on lines -12 to -38

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Are these used by other plugins? Should we deprecate and alias before removing?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Oh! There are aliases, but moved to a separate file; see further up; cli-plugins/manager/annotations.go

I think I had that move in a separate commit originally 🤔 (I can do so separately to make it more clear probably)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ahh right, I confused it with the new file 🙈

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

😅 I had to double-check myself, but it was there 🤗

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 area/plugins impact/go-sdk Noteworthy (compatibility changes) in the Go SDK kind/refactor PR's that refactor, or clean-up code status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants