api/types: move disk usage structs to daemon backend by austinvazquez · Pull Request #50764 · moby/moby · GitHub
Skip to content

api/types: move disk usage structs to daemon backend - #50764

Merged
thaJeztah merged 4 commits into
moby:masterfrom
austinvazquez:move-disk-usage-types-to-daemon-backend
Aug 20, 2025
Merged

thaJeztah merged 4 commits into
moby:masterfrom
austinvazquez:move-disk-usage-types-to-daemon-backend

Conversation

@austinvazquez

@austinvazquez austinvazquez commented Aug 18, 2025 •

Copy link
Copy Markdown
Contributor

- What I did
Partial for #50740

This change moves the disk usage structs in api/types/build, api/types/container, api/types/images and api/types/volumes to backend server definitions where the code was actually used.

- How I did it

- How to verify it

- Human readable description for the release notes

api/types: daemon: move the disk usage structs to the backend server

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

@austinvazquez austinvazquez added area/api API impact/api area/daemon Core Engine kind/refactor PR's that refactor, or clean-up code labels Aug 19, 2025
@austinvazquez
austinvazquez marked this pull request as ready for review August 19, 2025 03:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the disk usage data structures by moving them from the public API types packages to the daemon backend where they are actually used. This is part of a larger effort to better organize the codebase and reduce dependencies in the public API.

  • Moves disk usage structs from api/types/* packages to daemon/server/backend
  • Updates all references to use the new backend types instead of the public API types
  • Removes the now-unused disk usage files from the public API packages

Reviewed Changes

Copilot reviewed 8 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
daemon/server/backend/disk_usage.go Defines new disk usage structs moved from public API packages
daemon/server/router/system/system_routes.go Updates reference to use new backend BuildCacheDiskUsage type
daemon/disk_usage.go Updates function signatures and struct instantiations to use backend types
daemon/daemon.go Updates singleflight group type parameters to use backend types
api/types/*/disk_usage.go Removes disk usage struct definitions from public API packages

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread daemon/server/backend/disk_usage.go
Comment thread daemon/server/backend/disk_usage.go
Comment thread daemon/server/backend/disk_usage.go
Comment thread daemon/server/backend/disk_usage.go
@austinvazquez
austinvazquez requested a review from dmcgowan August 19, 2025 03:15
Comment thread api/types/build/disk_usage.go Outdated
Comment on lines +4 to +5

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Similar to the other PR; probably better to make this a separate PR for the 28.x branch that only adds the deprecation message, then in this PR make it a commit that moves it (no deprecation step between).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Opened #50768

@austinvazquez
austinvazquez force-pushed the move-disk-usage-types-to-daemon-backend branch from 271160b to 251b4a0 Compare August 19, 2025 12:50
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
@austinvazquez
austinvazquez force-pushed the move-disk-usage-types-to-daemon-backend branch from 251b4a0 to c4e82ba Compare August 19, 2025 13:12

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks!

@thaJeztah
thaJeztah merged commit c8c4996 into moby:master Aug 20, 2025
@austinvazquez
austinvazquez deleted the move-disk-usage-types-to-daemon-backend branch August 20, 2025 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/api API area/daemon Core Engine impact/api kind/refactor PR's that refactor, or clean-up code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants