Skip to content

Separate intrinsic environment variables - #5054

Open
happz wants to merge 3 commits into
mainfrom
intrinsic-environment
Open

Separate intrinsic environment variables#5054
happz wants to merge 3 commits into
mainfrom
intrinsic-environment

Conversation

@happz

@happz happz commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

tmt-owned variables are no longer included in the
HasEnvironment.environment return values. Separating the user-owned and tmt-owned variables will give us precise control over their ordering.

Patch is also dropping support of Environment.update(foo: HasEnvironment) shortcut - an actual Environment instances are required now. Once a class offers both user-provided and tmt-owned variables, update() would have hard time to pick which set to include in the target environment ("both" might also be an answer...).

This should be the penultimate patch of the environment precedence series; the next and almost-final patch will provide unified helper to construct environments so they follow the same process.

Related to #4241.

Pull Request Checklist

  • implement the feature
  • write the documentation

@happz happz added area | environment Environment variables handling ci | full test Pull request is ready for the full test execution labels Jul 9, 2026
@happz happz added this to planning Jul 9, 2026
@github-project-automation github-project-automation Bot moved this to backlog in planning Jul 9, 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 introduces a separation between user-provided and tmt-owned ("intrinsic") environment variables by adding the HasIntrinsicEnvironment abstract base class and refactoring relevant classes (such as Plan, Guest, TestInvocation, and various execution contexts) to inherit from it and expose an intrinsic_environment property. This ensures that tmt-owned variables consistently overwrite user-provided variables. Additionally, Environment.update is simplified to accept only Environment instances. There are no review comments, and I have no feedback to provide.

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.

Base automatically changed from move-environment to main July 10, 2026 09:36
@happz
happz force-pushed the intrinsic-environment branch from 4268aa0 to c777740 Compare July 12, 2026 05:31
@happz happz moved this from backlog to review in planning Jul 12, 2026
@happz
happz marked this pull request as ready for review July 12, 2026 18:35
@happz happz mentioned this pull request Jul 21, 2026
8 tasks

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

I wonder if we can have a more generic way to define this sources. I've hit a similar design issue at scikit-build-core. Basically we need to manage a list of list of environment (outer list of user vs intrisic, inner one from each source)

@happz

happz commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

I wonder if we can have a more generic way to define this sources. I've hit a similar design issue at scikit-build-core. Basically we need to manage a list of list of environment (outer list of user vs intrisic, inner one from each source)

I'm pretty happy with the state of things I reached. Maybe there will be a chance to build something sleaker once envvars become objects rather than just names as strings, but at this point of environment cleanup/secrets bootstrap, I'm perfectly fine with the state of cleanup, and I don't want to dive into more refactoring.

happz added 3 commits August 3, 2026 22:22
tmt-owned variables are no longer included in the
`HasEnvironment.environment` return values. Separating the user-owned
and tmt-owned variables will give us precise control over their
ordering.

Patch is also dropping support of `Environment.update(foo: HasEnvironment)`
shortcut - an actual `Environment` instances are required now. Once a
class offers both user-provided and tmt-owned variables, `update()`
would have hard time to pick which set to include in the target
environment ("both" might also be an answer...).

This should be the penultimate patch of the environment precedence
series; the next and almost-final patch will provide unified helper to
construct environments so they follow the same process.

Related to #2609.
@happz
happz force-pushed the intrinsic-environment branch from dfb2ecb to db4edb8 Compare August 3, 2026 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area | environment Environment variables handling ci | full test Pull request is ready for the full test execution

Projects

Status: review

Development

Successfully merging this pull request may close these issues.

2 participants