Skip to content

Move Environment class to its own module#5041

Merged
LecrisUT merged 4 commits into
mainfrom
move-environment
Jul 10, 2026
Merged

Move Environment class to its own module#5041
LecrisUT merged 4 commits into
mainfrom
move-environment

Conversation

@happz

@happz happz commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Making tmt.utils smaller, but also part of the secrets implementation: by moving Environment and few other bits, it should be possible to close access to os.environ.

A lot of changes, but just moves - some tmt.utils.Environment turned into from tmt.utils.environment import Environment + bare Environment; the string would have to change anyway, so at least we can treat Environment as a well-known name in the codebase.

Related to #2609.

Pull Request Checklist

  • implement the feature

@happz happz added this to planning Jul 3, 2026
@happz happz added code | style Code style changes not affecting functionality code | no functional change "No Functional Change" intended. Patch should not change tmt's behavior in any way. ci | full test Pull request is ready for the full test execution labels Jul 3, 2026
@github-project-automation github-project-automation Bot moved this to backlog in planning Jul 3, 2026
@happz happz moved this from backlog to implement in planning Jul 3, 2026
Comment thread tmt/utils/environment.py Outdated
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

Base automatically changed from plan-cli-environment to main July 3, 2026 11:18
@happz
happz force-pushed the move-environment branch 2 times, most recently from 9471635 to 7558dd6 Compare July 3, 2026 18:30
@happz happz moved this from implement to review in planning Jul 6, 2026
@psss psss added this to the 1.77 milestone Jul 7, 2026
Comment thread tmt/utils/environment.py
Comment thread tmt/utils/__init__.py Outdated
Comment thread tmt/utils/__init__.py Outdated

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

Looks good, just one leftover in tmt/convert.py:

1118:        data['environment'] = tmt.utils.Environment.from_sequence(testcase.arguments, logger)

@happz
happz force-pushed the move-environment branch from 7558dd6 to 5af9841 Compare July 9, 2026 14:54
@happz

happz commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Looks good, just one leftover in tmt/convert.py:

1118:        data['environment'] = tmt.utils.Environment.from_sequence(testcase.arguments, logger)

Addressed in 5af9841

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

Nice, thanks!

@psss psss moved this from review to merge in planning Jul 10, 2026
happz added 4 commits July 10, 2026 09:40
Making `tmt.utils` smaller, but also part of the secrets implementation:
by moving `Environment` and few other bits, it should be possible to
close access to `os.environ`.

A lot of changes, but just moves - some `tmt.utils.Environment` turned
into `from tmt.utils.environment import Environment` + bare
`Environment`; the string would have to change anyway, so at least we
can treat `Environment` as a well-known name in the codebase.

Related to #2609.
@psss
psss force-pushed the move-environment branch from 5af9841 to e7f0f0c Compare July 10, 2026 07:40
@LecrisUT
LecrisUT merged commit 2e3bf04 into main Jul 10, 2026
34 checks passed
@LecrisUT
LecrisUT deleted the move-environment branch July 10, 2026 09:36
@github-project-automation github-project-automation Bot moved this from merge to done in planning Jul 10, 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 code | no functional change "No Functional Change" intended. Patch should not change tmt's behavior in any way. code | style Code style changes not affecting functionality

Projects

Status: done

Development

Successfully merging this pull request may close these issues.

3 participants