Skip to content

api/types/container.StatsResponseReader: move to client#50521

Merged
thaJeztah merged 3 commits intomoby:masterfrom
thaJeztah:move_StatsResponseReader
Jul 28, 2025
Merged

api/types/container.StatsResponseReader: move to client#50521
thaJeztah merged 3 commits intomoby:masterfrom
thaJeztah:move_StatsResponseReader

Conversation

@thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Jul 26, 2025

This type was only used in the client, and needs a rewrite; let's move it to the client first.

Also fix some minor linting issues in tests.

- How to verify it

- Human readable description for the release notes

Go SDK: api/types/container: move `StatsResponseReader` to `client` package

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

@thaJeztah thaJeztah added this to the 29.0.0 milestone Jul 26, 2025
@thaJeztah thaJeztah added the area/api API label Jul 26, 2025
@thaJeztah thaJeztah added status/2-code-review area/go-sdk impact/go-sdk Noteworthy (compatibility changes) in the Go SDK release-blocker PRs we want to block a release on go-modules labels Jul 26, 2025
This type was only used in the client, and needs a rewrite; let's
move it to the client first.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah force-pushed the move_StatsResponseReader branch from 11a9711 to 97827e1 Compare July 26, 2025 09:22
Comment on lines +88 to +89
ContainerStats(ctx context.Context, container string, stream bool) (StatsResponseReader, error)
ContainerStatsOneShot(ctx context.Context, container string) (StatsResponseReader, error)
Copy link
Contributor

Choose a reason for hiding this comment

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

note: This is a breaking change to the interface, so will need some adjusting in places like: https://github.com/docker/compose/blob/52f04229c0391a16b29191227fd0d6284a9b4592/pkg/api/dryrunclient.go#L398-L405

Copy link
Member Author

@thaJeztah thaJeztah Jul 28, 2025

Choose a reason for hiding this comment

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

So, yes and no! But it makes your head spin thinking about some of these 🤯 🤯 ;

  • ✅ This is an entirely NEW module (github.com/moby/moby/client). It has NO relation with what was previously shipped as github.com/docker/docker/client
  • ✅ So if compose switches to the module, it's not a breaking change, but does require a couple more lines to changes (besides s|docker/docker/|moby/moby/|)
  • ☝️ 👉 which may still be good to highlight in release notes (have some "transition" guide somewhere).
  • ⚠️ BUT!! It might conflict if compose switches to the module, but also imports other modules (like buildx), and code is expected for them to use the same types!
  • 💡 Which is why I had my (still WIP) PR to have a transitional 28.x release that aliases old -> new; [28.x] api: implement api using new module #50475
  • ⚠️ BUT!! ⚠️ this one may be potentially tricky, and I have to verify it, because it would require an alias from github.com/docker/docker/api/xxxx to github.com/moby/moby/client/xxx AND we may need aliases that do the reverse (github.com/docker/docker/client -> github.com/moby/moby/api/xxx (or github.com/moby/moby/client), so it's possible that we end up with a circular import 💥💥💥.
  • 🤞 🤞 🤞 I hope that's not the case, but can't fully have the full picture in my head, so we'll see when I update the PR I linked

@thaJeztah thaJeztah merged commit bc6851e into moby:master Jul 28, 2025
252 of 253 checks passed
@thaJeztah thaJeztah deleted the move_StatsResponseReader branch July 28, 2025 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/api API area/go-sdk go-modules impact/go-sdk Noteworthy (compatibility changes) in the Go SDK release-blocker PRs we want to block a release on status/2-code-review

Projects

Development

Successfully merging this pull request may close these issues.

2 participants