Skip to content

Ignore, but process, conditional macro expansions when updating Release#377

Merged
nforro merged 1 commit intopackit:mainfrom
nforro:release
Feb 12, 2026
Merged

Ignore, but process, conditional macro expansions when updating Release#377
nforro merged 1 commit intopackit:mainfrom
nforro:release

Conversation

@nforro
Copy link
Member

@nforro nforro commented Feb 11, 2026

Flattening the nodes of parsed release string removes conditional macro expansions, so it's not possible to reconstruct them. Process them instead, but treat them as simple string literals, we don't need to process their bodies anyway.

Copy link
Contributor

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

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 addresses an issue with handling conditional macro expansions in spec file Release strings by avoiding flattening the parsed nodes. The change in agents/tools/specfile.py is correct and directly solves the problem. The new tests in agents/tests/unit/test_tools.py validate the fix for z-stream branches. I've added one suggestion to enhance test coverage for non-z-stream branches as well, to ensure all code paths affected by this change are validated.

Flattening the nodes of parsed release string removes conditional macro
expansions, so it's not possible to reconstruct them. Process them
instead, but treat them as simple string literals, we don't need
to process their bodies anyway.

Signed-off-by: Nikola Forró <nforro@redhat.com>
@nforro
Copy link
Member Author

nforro commented Feb 11, 2026

/gemini review

Copy link
Contributor

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

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 correctly addresses an issue where conditional macro expansions in the Release field were lost during updates. By removing the flattening of parsed nodes from the specfile's Release string, the original structure, including conditional macros, is preserved. The change is simple and effective, replacing the custom _parse_release method with a direct call to ValueParser.parse. The new test cases in test_tools.py are well-designed, confirming that the fix works as expected for various scenarios, including z-stream branches. The implementation is clean and the fix is well-tested.

Copy link
Member

@lbarcziova lbarcziova left a comment

Choose a reason for hiding this comment

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

thanks!

@nforro nforro merged commit 52d2b28 into packit:main Feb 12, 2026
7 checks passed
@nforro nforro deleted the release branch February 12, 2026 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments