Skip to content

cli/command, cil/command/image: remove deprecated methods and functions - #5876

Merged
thaJeztah merged 6 commits into
docker:masterfrom
thaJeztah:less_notary
Mar 21, 2025
Merged

cli/command, cil/command/image: remove deprecated methods and functions#5876
thaJeztah merged 6 commits into
docker:masterfrom
thaJeztah:less_notary

Conversation

@thaJeztah

@thaJeztahthaJeztah commented Mar 1, 2025

Copy link
Copy Markdown
Member

cli/command: remove deprecated NotaryClient from CLI interface

This method is a shallow wrapper around trust.GetNotaryRepository, but
due to its signature resulted in the trust package, and notary dependencies
to become a dependency of the CLI. Consequence of this was that cli-plugins,
which need the cli/command package, would also get notary and its
dependencies as a dependency. It is no longer used, and was deprecated
in 9bc16bb.

This patch removes the NotaryClient method from the interface

cli/command: remove deprecated ManifestStore from CLI interface

This method is a shallow wrapper around manifeststore.NewStore, but
due to its signature resulted in various dependencies becoming a dependency
of the "command" package. Consequence of this was that cli-plugins, which
need the cli/command package, would also get those dependencies. It is no
longer used, and was deprecated in e32d5d5.

This patch removes the ManifestStore method from the interface

cli/command: remove deprecated RegistryClient from CLI interface

This method was a shallow wrapper around registryclient.NewRegistryClient but
due to its signature resulted in various dependencies becoming a dependency
of the "command" package. Consequence of this was that cli-plugins, which
need the cli/command package, would also get those dependencies. It is no
longer used, and was deprecated in 8ad0721.

This patch removes the RegistryClient method from the interface

cli/command/image: remove deprecated TrustedPush

This function was only used by "docker trust sign", and has no known external
consumers. It was deprecated in c6f456b;
this commit removes it.

cli/command/image: remove deprecated PushTrustedReference

This function was only used internally, and has no known external consumers.
It was deprecated in d804360; this commit
removes it.

cli/command/image: remove deprecated TagTrusted

This function was only used internally, and has no known external consumers.
It was deprecated in e37d814; this commit
removes it.

- Human readable description for the release notes

Go-SDK: `cli/command/image`: remove deprecated `TrustedPush`, `TagTrusted`, and `PushTrustedReference` functions.
Go-SDK: `cli/command`: remove deprecated `NotaryClient` and `ManifestStore`, and `RegistryClient` from CLI interface.

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

@thaJeztahthaJeztah added status/2-code-review area/trust kind/refactor PR's that refactor, or clean-up code labels Mar 1, 2025
@codecov-commenter

codecov-commenter commented Mar 1, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.46%. Comparing base (e002576) to head (4541df2).
Report is 11 commits behind head on master.

Additional details and impacted files
@@ Coverage Diff @@## master #5876 +/- ##
==========================================
+ Coverage 59.42% 59.46% +0.04% 
==========================================
Files 358 357 -1 Lines 29768 29747 -21 ==========================================
Hits 17690 17690 + Misses 11113 11092 -21 
Partials 965 965 
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

thaJeztah added a commit to thaJeztah/buildx that referenced this pull request Mar 1, 2025
Testing docker/cli#5876 to remove notary
dependency.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
thaJeztah added a commit to thaJeztah/buildx that referenced this pull request Mar 1, 2025
Testing docker/cli#5876 to remove notary
dependency.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
thaJeztah added a commit to thaJeztah/buildx that referenced this pull request Mar 1, 2025
Testing docker/cli#5876 to remove notary
dependency.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
thaJeztah added a commit to thaJeztah/buildx that referenced this pull request Mar 1, 2025
Testing docker/cli#5876 to remove notary
dependency.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
thaJeztahforce-pushed the less_notary branch 3 times, most recently from 0939e55 to 331753aCompareMarch 2, 2025 13:20
thaJeztah added a commit to thaJeztah/buildx that referenced this pull request Mar 2, 2025
Testing docker/cli#5876 to remove notary
dependency.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
thaJeztahforce-pushed the less_notary branch 3 times, most recently from e017b03 to 749bea0CompareMarch 3, 2025 11:51
thaJeztah added a commit to thaJeztah/buildx that referenced this pull request Mar 3, 2025
Testing docker/cli#5876 to remove notary
dependency.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
thaJeztah added a commit to thaJeztah/buildx that referenced this pull request Mar 4, 2025
Testing docker/cli#5876 to remove notary
dependency.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Comment threadcli-plugins/manager/hooks.go Outdated
Comment on lines +51 to +50
hooks.PrintNextSteps(dockerCli.Err(), nextSteps)
hooks.PrintNextSteps(rootCmd.ErrOrStderr(), nextSteps)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

This is a difference; before this, we would take the Err() output from the CLI, and now we switched to the Cobra cmd's StdErr() - we should look in our code altogether to consider using that (instead of depending on the DockerCLI to provide us the stderr/stdout; I think they're coupled either way.

@thaJeztah
thaJeztahforce-pushed the less_notary branch 5 times, most recently from 27de409 to bb474a6CompareMarch 5, 2025 21:09
@thaJeztah
thaJeztahforce-pushed the less_notary branch 5 times, most recently from 88fe1f9 to 0a60a49CompareMarch 11, 2025 09:12
@thaJeztahthaJeztah mentioned this pull request Mar 12, 2025
8 tasks
@thaJeztah
thaJeztahforce-pushed the less_notary branch 4 times, most recently from c5dad66 to 45c0ebeCompareMarch 19, 2025 17:57
@thaJeztahthaJeztah changed the title cli/command: remove NotaryClient from CLI interfacecli/command, cil/command/image: remove deprecated methods and functionsMar 19, 2025
@thaJeztahthaJeztah added impact/deprecation impact/go-sdk Noteworthy (compatibility changes) in the Go SDK labels Mar 19, 2025
@thaJeztahthaJeztah added this to the 28.0.3 milestone Mar 19, 2025
This method is a shallow wrapper around trust.GetNotaryRepository, but
due to its signature resulted in the trust package, and notary dependencies
to become a dependency of the CLI. Consequence of this was that cli-plugins,
which need the cli/command package, would also get notary and its
dependencies as a dependency. It is no longer used, and was deprecated
in 9bc16bb.
This patch removes the NotaryClient method from the interface
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This method is a shallow wrapper around manifeststore.NewStore, but
due to its signature resulted in various dependencies becoming a dependency
of the "command" package. Consequence of this was that cli-plugins, which
need the cli/command package, would also get those dependencies. It is no
longer used, and was deprecated in e32d5d5.
This patch removes the ManifestStore method from the interface
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This method was a shallow wrapper around registryclient.NewRegistryClient but
due to its signature resulted in various dependencies becoming a dependency
of the "command" package. Consequence of this was that cli-plugins, which
need the cli/command package, would also get those dependencies. It is no
longer used, and was deprecated in 8ad0721.
This patch removes the RegistryClient method from the interface
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This function was only used by "docker trust sign", and has no known external
consumers. It was deprecated in c6f456b;
this commit removes it.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This function was only used internally, and has no known external consumers.
It was deprecated in d804360; this commit
removes it.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This function was only used internally, and has no known external consumers.
It was deprecated in e37d814; this commit
removes it.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
thaJeztah marked this pull request as ready for review March 20, 2025 12:34
thaJeztah added a commit to thaJeztah/buildx that referenced this pull request Mar 20, 2025
Testing docker/cli#5876 to remove notary
dependency.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

@tianontianon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Surprising nobody (and I'm not a maintainer here, so FWIW), this LGTM 😇

@thaJeztah

Copy link
Copy Markdown
MemberAuthor

Thanks both! I'll wait for others to have a last look Tomorrow before merging, but looks like we can go ahead.

For others visiting this PR; removing these methods technically is a "breaking" change, so would require a major version update.

However, the cli/command package was never really designed as a public API, and gained features and functions that were ultimately for "internal use".

The features removed here specifically were intended for internal use in the CLI itself, and not for external consumers, but had a big impact on every (cli-plugin) user that used the docker/cli as dependency.

I did a search through public repositories, and could not find any consumer of these functions (and I would not expect any user of out code to actually be using these), so removing these should very unlikely impact any user of the code, other than in a "positive" way of many (indirect) dependencies being removed 🎉

@thaJeztah

Copy link
Copy Markdown
MemberAuthor

Let me bring this one in 👍

@thaJeztah
thaJeztah merged commit 255a5f6 into docker:masterMar 21, 2025
@thaJeztah
thaJeztah deleted the less_notary branch March 21, 2025 08:31
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/trustimpact/deprecationimpact/go-sdkNoteworthy (compatibility changes) in the Go SDKkind/refactorPR's that refactor, or clean-up codestatus/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@thaJeztah@codecov-commenter@tianon@akerouanton@robmry@vvoland