Skip to content

Environment.environ instead of os.environ - #5022

Draft
happz wants to merge 3 commits into
document-envvar-precedencefrom
environment-environ
Draft

Environment.environ instead of os.environ#5022
happz wants to merge 3 commits into
document-envvar-precedencefrom
environment-environ

Conversation

@happz

@happz happz commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Pull Request Checklist

  • implement the feature
  • write the documentation
  • extend the test coverage
  • update the specification
  • adjust plugin docstring
  • modify the json schema
  • mention the version
  • include a release note

@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 Jun 29, 2026
@happz happz added this to planning Jun 29, 2026
@github-project-automation github-project-automation Bot moved this to backlog in planning Jun 29, 2026

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

Copy link
Copy Markdown
Contributor

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 replaces direct usage of os.environ and os.getenv with a custom Environment.environ singleton across the codebase, enforcing this via new linter rules. Feedback highlights a critical issue where modifying Environment.environ directly introduces side effects due to its singleton nature, requiring the use of .copy() instead. Additionally, double lookups of environment variables in tmt/config/__init__.py and tmt/plugins/__init__.py should be simplified using assignment expressions.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread tmt/libraries/beakerlib.py Outdated
Comment thread tmt/config/__init__.py Outdated
Comment thread tmt/plugins/__init__.py Outdated
Base automatically changed from plan-cli-environment to main July 3, 2026 11:18
@happz
happz force-pushed the environment-environ branch from 9a0dc49 to d63a63b Compare July 13, 2026 19:18
@happz
happz force-pushed the environment-environ branch from d63a63b to 1280a15 Compare August 12, 2026 20:27
@happz
happz changed the base branch from main to document-envvar-precedence August 12, 2026 20:28
@happz
happz force-pushed the environment-environ branch 2 times, most recently from 5d29da6 to 8b3236b Compare August 20, 2026 13:37
@happz happz added the status | blocked The merging of PR is blocked on some other issue label Aug 20, 2026
@happz
happz force-pushed the environment-environ branch from 8b3236b to 636dbe7 Compare August 20, 2026 15:45
@happz
happz force-pushed the environment-environ branch from 636dbe7 to 09003ef Compare August 22, 2026 12:58
@happz
happz force-pushed the environment-environ branch from 09003ef to 024f457 Compare August 27, 2026 11:14
@happz
happz force-pushed the environment-environ branch from 024f457 to cb2c69a Compare August 27, 2026 11:22
@happz
happz force-pushed the environment-environ branch from cb2c69a to 3c5feb0 Compare August 31, 2026 08:12
@therazix
therazix force-pushed the environment-environ branch from 3c5feb0 to 0515cf7 Compare August 31, 2026 13:34
@happz
happz force-pushed the environment-environ branch from 0515cf7 to 838c013 Compare September 1, 2026 07:34
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 status | blocked The merging of PR is blocked on some other issue

Projects

Status: backlog

Development

Successfully merging this pull request may close these issues.

1 participant