Account for circular expansion of tags#539
Conversation
There was a problem hiding this comment.
Code Review
This pull request addresses circular macro expansion issues in RPM tags by manually deleting tag macros before expansion and invalidating the parser cache. The review feedback highlights that the current implementation in specfile.py is ineffective because the use of extra_macros triggers a re-parse that restores the deleted macros. Key recommendations include refactoring the duplicated logic into a helper method to improve maintainability, ensuring consistent cache invalidation, using %{nil} for efficient context loading, and expanding test coverage to verify all affected paths.
|
Build succeeded. ✔️ pre-commit SUCCESS in 2m 07s |
Signed-off-by: Nikola Forró <nforro@redhat.com> Assisted-by: Claude Opus 4.6 via Claude Code
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request addresses circular macro expansion issues by manually managing the RPM macro stack and invalidating the parser cache. Review feedback suggests ensuring that the parser cache is consistently invalidated whenever the macro stack is modified, specifically in add_changelog_entry and expanded_release. There is also a concern regarding the performance impact of frequent cache invalidations, which may lead to O(N^2) complexity when processing multiple tags.
|
Build succeeded. ✔️ pre-commit SUCCESS in 2m 01s |
|
Build succeeded (gate pipeline). ✔️ pre-commit SUCCESS in 2m 05s |
RELEASE NOTES BEGIN
Fixed an issue where the value of a tag could have been incorrectly expanded if the spec file contained a macro definition shadowing the tag name, e.g.:
In this case, with
distbeing.fc44,Specfile.expanded_releasereturned12.fc44.fc44instead of12.fc44.RELEASE NOTES END