Skip to content

Conversation

@thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Mar 4, 2025

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/[email protected]+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)

@thaJeztah thaJeztah added this to the 28.0.2 milestone Mar 4, 2025
@codecov-commenter
Copy link

codecov-commenter commented Mar 4, 2025

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           

@thaJeztah thaJeztah changed the title cli/command: internalise and deprecate Cli.NotaryClient cli/command: internalize and deprecate Cli.NotaryClient Mar 4, 2025
@thaJeztah thaJeztah 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
@thaJeztah thaJeztah requested review from Benehiko and vvoland March 4, 2025 14:59
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 <[email protected]>
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 <[email protected]>
@thaJeztah thaJeztah force-pushed the internalize_notaryclient branch from 70f723b to 9bc16bb Compare March 4, 2025 16:40
@thaJeztah
Copy link
Member Author

Rebased to get the updated ubuntu-24.04 runners for CI

@thaJeztah
Copy link
Member Author

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:master Mar 4, 2025
95 checks passed
@thaJeztah thaJeztah deleted the internalize_notaryclient branch March 4, 2025 16:48
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/trust impact/changelog impact/deprecation 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