Skip to content

Running tmt clean will now show disk space freed#4801

Merged
psss merged 8 commits into
mainfrom
avinay-clean-command-disk-space
May 14, 2026
Merged

Running tmt clean will now show disk space freed#4801
psss merged 8 commits into
mainfrom
avinay-clean-command-disk-space

Conversation

@AthreyVinay
Copy link
Copy Markdown
Member

@AthreyVinay AthreyVinay commented Apr 15, 2026

resolves: #4593

Pull Request Checklist

  • implement the feature
  • extend the test coverage
  • include a release note

@AthreyVinay AthreyVinay requested a review from lbrabec as a code owner April 15, 2026 13:12
@AthreyVinay AthreyVinay added the command | clean tmt clean command label Apr 15, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request implements disk space reporting for the clean command by adding utilities to calculate and format file sizes. The cleaning logic for workdirs and testcloud images now logs the amount of space freed, supported by new test assertions. Feedback recommends using lstat to prevent symlink traversal during size calculation and employing floating-point arithmetic in format_size to ensure accurate unit conversion.

Comment thread tmt/base/core.py Outdated
Comment thread tmt/utils/__init__.py Outdated
Comment thread tmt/utils/__init__.py Outdated
Comment thread tmt/base/core.py Outdated
@happz happz added this to planning Apr 22, 2026
@github-project-automation github-project-automation Bot moved this to backlog in planning Apr 22, 2026
@happz happz moved this from backlog to review in planning Apr 22, 2026
@happz happz added the ci | full test Pull request is ready for the full test execution label Apr 22, 2026
@psss psss added this to the 1.74 milestone May 7, 2026
Comment thread tmt/base/core.py Outdated
@AthreyVinay AthreyVinay force-pushed the avinay-clean-command-disk-space branch from c4b334a to dc78e5a Compare May 11, 2026 15:11
Comment thread tmt/steps/provision/testcloud.py Outdated
Comment thread tmt/base/core.py Outdated
@happz happz moved this from review to merge in planning May 14, 2026
Comment thread tmt/base/core.py Outdated
@psss psss force-pushed the avinay-clean-command-disk-space branch from c13bcb5 to 68725ab Compare May 14, 2026 10:15
Copy link
Copy Markdown
Member

@psss psss left a comment

Choose a reason for hiding this comment

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

Works nice! Thanks for implementing this.

@psss psss merged commit 271f00f into main May 14, 2026
34 checks passed
@psss psss deleted the avinay-clean-command-disk-space branch May 14, 2026 12:10
@github-project-automation github-project-automation Bot moved this from merge to done in planning May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci | full test Pull request is ready for the full test execution command | clean tmt clean command

Projects

Status: done

Development

Successfully merging this pull request may close these issues.

tmt clean --dry could show total disk space that would be freed

5 participants