Handle koji_build and bodhi_update retrigger from a main PR#2903
Conversation
Signed-off-by: Nikola Forró <nforro@redhat.com>
Summary of ChangesHello @nforro, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a compatibility issue where the Koji build system does not recognize 'main' as a valid branch name. By introducing logic to translate 'main' to 'rawhide' for relevant operations, it ensures that Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request effectively addresses the issue of Koji not recognizing the 'main' branch by implementing a conversion to 'rawhide' in relevant handlers. This ensures that koji_build and bodhi_update retriggering functions as expected for pull requests targeting the 'main' branch.
| if (branch := self.project.get_pr(self.data.pr_id).target_branch) == "main": | ||
| # Koji doesn't recognize main, only rawhide | ||
| return "rawhide" |
There was a problem hiding this comment.
This logic for converting 'main' to 'rawhide' is also present in packit_service/worker/handlers/distgit.py (lines 1238-1240) and packit_service/worker/helpers/sidetag.py (lines 282-284). While functional, duplicating this specific conversion logic across multiple files can lead to inconsistencies if the rule needs to be updated in the future. Consider centralizing this conversion into a shared utility function or constant to improve maintainability and ensure a single source of truth for Koji branch naming conventions.
|
Build succeeded. ✔️ pre-commit SUCCESS in 1m 47s |
|
Build succeeded (gate pipeline). ✔️ pre-commit SUCCESS in 1m 42s |
079d040
into
packit:main
Fixes #2902.