Skip to content

Add "frozen" variant of Command class, for base commands#5011

Open
happz wants to merge 2 commits into
mainfrom
frozen-command
Open

Add "frozen" variant of Command class, for base commands#5011
happz wants to merge 2 commits into
mainfrom
frozen-command

Conversation

@happz

@happz happz commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Somme commands serve as basis for other commands, and we must prevent
modification of these base commands. This is related to the recent fix
of Command.__iadd__, and even more recent #5001 bug.

@happz happz added code | style Code style changes not affecting functionality ci | full test Pull request is ready for the full test execution labels Jun 24, 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 FrozenCommand class to prevent in-place modifications of base commands across various package managers. The review feedback points out that returning Self from Command.__add__ incorrectly propagates the frozen state to new command instances created via addition. Change the return type of __add__ to Command and update the corresponding unit tests to assert that addition results in a mutable Command.

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/utils/__init__.py Outdated
Comment thread tests/unit/test_utils.py
Comment thread tmt/utils/__init__.py Outdated
@happz happz added this to planning Jun 24, 2026
@github-project-automation github-project-automation Bot moved this to backlog in planning Jun 24, 2026
@happz happz moved this from backlog to implement in planning Jun 24, 2026
Base automatically changed from dnf-copy-base-command to main June 24, 2026 18:20
@happz happz moved this from implement to review in planning Jun 24, 2026
happz added 2 commits June 29, 2026 14:06
Somme commands serve as basis for other commands, and we must prevent
modification of these base commands. This is related to the recent fix
of `Command.__iadd__`, and even more recent #5001 bug.
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 | style Code style changes not affecting functionality

Projects

Status: review

Development

Successfully merging this pull request may close these issues.

1 participant