Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support --workdir-root in the tmt clean command #2850

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

skycastlelily
Copy link
Collaborator

@skycastlelily skycastlelily commented Apr 12, 2024

Pull Request Checklist

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

tmt/base.py Outdated Show resolved Hide resolved
@skycastlelily
Copy link
Collaborator Author

Hi Petr, @psss, would you please spare some time to review this merge request,please? This is supposed to address #2807 , sorry for forgetting mentioned it before 1.36 release,and hope we can have this merged for 1.37: )

@skycastlelily skycastlelily added this to the 1.37 milestone Sep 25, 2024
@skycastlelily skycastlelily added the ci | full test Pull request is ready for the full test execution label Sep 25, 2024
@thrix thrix requested a review from happz September 26, 2024 11:36
docs/releases.rst Outdated Show resolved Hide resolved
docs/releases.rst Outdated Show resolved Hide resolved
Copy link
Collaborator

@martinhoyer martinhoyer left a comment

Choose a reason for hiding this comment

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

lgtm. Just nitpicks.
I'm surprised setting a workdir root is so complicated tbh (not necessarily related to these changes). :)

tmt/cli.py Show resolved Hide resolved
tmt/utils/__init__.py Outdated Show resolved Hide resolved
@thrix
Copy link
Collaborator

thrix commented Sep 26, 2024

@skycastlelily would it be possible to log the workdir root please in case the verbose mode is enabled please?

Something like:

❯ env | grep WORKDIR
TMT_WORKDIR_ROOT=/var/home/mvadkert/.local/share/tmt

❯ tmt clean -v
clean
    workdir /var/home/mvadkert/.local/share/tmt
guests
runs
images
    testcloud

tmt/base.py Outdated Show resolved Hide resolved
tmt/base.py Outdated Show resolved Hide resolved
tmt/utils/__init__.py Outdated Show resolved Hide resolved
tmt/options.py Outdated Show resolved Hide resolved
@skycastlelily
Copy link
Collaborator Author

skycastlelily commented Oct 16, 2024 via email

tmt/cli.py Outdated Show resolved Hide resolved
@skycastlelily
Copy link
Collaborator Author

skycastlelily commented Oct 16, 2024 via email

@happz
Copy link
Collaborator

happz commented Oct 18, 2024

@skycastlelily please, check the tests, there seems to be some issue with a missing argument. No idea why pre-commit and linters did not report it :/

Edit: got it. It's the status subcommand in cli.py, it still accepts workdir_root from options, but it must accept _workdir_root, and do the workdir_root = path(_workdir_root) dance.

And linters didn't report it because they don't see into Click and options...

@skycastlelily
Copy link
Collaborator Author

skycastlelily commented Oct 18, 2024 via email

docs/releases.rst Outdated Show resolved Hide resolved
@skycastlelily
Copy link
Collaborator Author

skycastlelily commented Oct 21, 2024 via email

@happz happz added command | clean tmt clean command code | cli Changes related to the command line interface status | ready for merge The only missing piece is to do the rebase the current 'main' and let the CI finish. labels Oct 22, 2024
Copy link
Collaborator

@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.

Looks good, just one nitpick. Also proposing a minore release note enhancement in 94b9098. @skycastlelily, does it look goot to you?

logger=context.obj.logger.clone().apply_verbosity_options(**kwargs),
cli_invocation=CliInvocation.from_context(context))
logger=context.obj.logger.clone().
apply_verbosity_options(**kwargs),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the new line really needed here?

@psss psss changed the title Accept CLI input in effective_workdir_root , and have Clean use it. Support --workdir-root in the tmt clean command Oct 22, 2024
@psss
Copy link
Collaborator

psss commented Oct 22, 2024

@skycastlelily, what about extending /tests/clean/basic a bit to add at least a very basic coverage for the new option?

@psss psss added status | need tests Test coverage to be added for the affected code and removed status | ready for merge The only missing piece is to do the rebase the current 'main' and let the CI finish. labels Oct 22, 2024
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 code | cli Changes related to the command line interface command | clean tmt clean command status | need tests Test coverage to be added for the affected code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants