Repository navigation
feat(reset): report reclaimable and reclaimed disk space - #1247
Merged
Merged
Conversation
infer reset ends the preview with Total reclaimable space, and infer reset confirm ends with Total reclaimed space summed over the targets it actually removed. Sizes are measured before os.RemoveAll, walk whole directory trees plus the SQLite database and its WAL sidecars, skip unreadable entries, and format like docker system prune (decimal units, 4 significant digits) via the new formatting.FormatBytes.
3 tasks
inference-gateway-maintainer
Bot
marked this pull request as ready for review
September 18, 2026 20:04
inference-gateway-maintainer
Bot
requested a review
from a team
as a code owner
September 18, 2026 20:04
7 tasks
edenreich
reviewed
Sep 18, 2026
Contributor
|
🎉 This PR is included in version 0.204.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #1243
Summary
infer resetnow ends its preview with aTotal reclaimable space: <size>line andinfer reset confirmends its result withTotal reclaimed space: <size>, the number adocker system prunerun ends with. Sizes are measured before removal so the confirm total counts only targets that were actually deleted, and byte counts are formatted with the newformatting.FormatBytes(decimal units, 4 significant digits, matching docker).Changes
cmd/reset/wipe.go:size()helper: best-effortfilepath.WalkDirover a target; regular-file bytes are summed, unreadable entries are skipped and never fail the reset (the total is a report, not an audit).sqlitePaths()helper replaces the inline 4-path list inwipeso the database,-wal,-shmand-journalsidecars are handled and counted in one place.previewends withTotal reclaimable space:summed over the resolved targets plus SQLite sidecars.wipemeasures each target beforeos.RemoveAlland only adds the bytes of targets that were actually removed, so a partially-blocked wipe reports what it really freed; per-target error reporting is unchanged.internal/platform/formatting: newFormatBytes, matchingdocker system pruneoutput style (0B,4.096kB,1.653GB).TestWipeReportsSpaceTotalsseeds files of known size (dir tree + db + wal sidecars) and asserts both totals (5.696kB);TestWipeReclaimedSpaceExcludesFailuresverifies a blocked target is excluded from the total;TestFormatBytespins the formatter.Verification
go test -tags purego ./cmd/reset ./internal/platform/formatting- passtask precommit:run(mod tidy, fmt, imports check, golangci-lint, markdownlint) - 0 issues