Skip to content

cli/command: internalize and deprecate Cli.NotaryClient - #5885

Merged
thaJeztah merged 2 commits into
docker:masterfrom
thaJeztah:internalize_notaryclient
Mar 4, 2025
Merged

cli/command: internalize and deprecate Cli.NotaryClient#5885
thaJeztah merged 2 commits into
docker:masterfrom
thaJeztah:internalize_notaryclient

Conversation

@thaJeztah

@thaJeztahthaJeztah commented Mar 4, 2025

Copy link
Copy Markdown
Member

cli/command: internalize constructing Notary client

The CLI.NotaryClient method is a shallow wrapper around trust.GetNotaryRepository
and only depends on the CLI itself to pass its StdErr/StrOut streams.

  • This patch inlines the code to produce the client, skipping the wrapper.
  • Define a local interface for some tests where a dummy notary client was used.

cli/command: deprecate Cli.NotaryClient

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 in our code, which
constructs the client in packages that need it, so we can deprecate this
method.

- Human readable description for the release notes

Go SDK: `cli/command`: deprecate `Cli.NotaryClient`: use [`trust.GetNotaryRepository`](https://pkg.go.dev/github.com/docker/cli@v28.0.1+incompatible/cli/trust#GetNotaryRepository) instead. This method is no longer used and will be removed in the next release.

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

@thaJeztahthaJeztah added this to the 28.0.2 milestone Mar 4, 2025
@codecov-commenter

codecov-commenter commented Mar 4, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 71.42857% with 6 lines in your changes missing coverage. Please review.

Project coverage is 59.28%. Comparing base (539f6de) to head (9bc16bb).
Report is 3 commits behind head on master.

Additional details and impacted files
@@ Coverage Diff @@## master #5885 +/- ##
=======================================
Coverage 59.27% 59.28% =======================================
Files 353 354 +1 Lines 29726 29738 +12 =======================================
+ Hits 17620 17630 +10 - Misses 11134 11136 +2 
Partials 972 972 

@thaJeztahthaJeztah changed the title cli/command: internalise and deprecate Cli.NotaryClientcli/command: internalize and deprecate Cli.NotaryClientMar 4, 2025
@thaJeztahthaJeztah added impact/changelog area/go-sdk Changes affecting the Go SDK impact/go-sdk Noteworthy (compatibility changes) in the Go SDK labels Mar 4, 2025
The CLI.NotaryClient method is a shallow wrapper around trust.GetNotaryRepository
and only depends on the CLI itself to pass its StdErr/StrOut streams.
- This patch inlines the code to produce the client, skipping the wrapper.
- Define a local interface for some tests where a dummy notary client was used.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
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 in our code, which
constructs the client in packages that need it, so we can deprecate this
method.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
thaJeztahforce-pushed the internalize_notaryclient branch from 70f723b to 9bc16bbCompareMarch 4, 2025 16:40
@thaJeztah

Copy link
Copy Markdown
MemberAuthor

Rebased to get the updated ubuntu-24.04 runners for CI

@thaJeztah

Copy link
Copy Markdown
MemberAuthor

Let me bring this one in; I have some follow-ups, but didn't want to put them all in a single PR

@thaJeztah
thaJeztah merged commit c775585 into docker:masterMar 4, 2025
@thaJeztah
thaJeztah deleted the internalize_notaryclient branch March 4, 2025 16:48
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/go-sdkChanges affecting the Go SDKarea/trustimpact/changelogimpact/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.

4 participants

@thaJeztah@codecov-commenter@Benehiko@vvoland