Repository navigation
Fix applicability check for non-existent z-stream branches - #555
Conversation
There was a problem hiding this comment.
Code Review
This pull request extracts the Koji base ref resolution logic into a reusable helper function resolve_zstream_base_ref and integrates it into the CVE applicability check for older z-stream branches when the target branch does not exist yet. Feedback highlights two key issues: first, checking out a specific commit SHA may fail if the repository was cloned with --single-branch, so fetching the ref first is recommended; second, when base ref resolution fails, unconditionally returning "comment_in_jira" may bypass the consolidate_rebuild_siblings step if the resolution is REBUILD.
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.
0e5575a to
70fa6e3
Compare
for more information, see https://pre-commit.ci
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
lbarcziova
left a comment
There was a problem hiding this comment.
this looks good, thanks for the fix! 🙏
For RHEL z-stream branches there is an inconsistency between the code logic and agent instructions here: the code logic falls back to default branch if the target branch doesnt exist ymir/agents/triage_agent.py#L970-L971 however the instructions we give the agent ymir/agents/cve_applicability_agent.py#L116-L118 tells it this is the actual target branch which is false. This leads to triage agent checking c9s or c10s CentOS branches instead of relevant RHEL z-stream branches and incorrectly concluding that backport is not applicable.
This change, when the target z-stream branch does not exist, uses the same logic to locate the relevant branch as used during missing z-stream branch creation ie locate the latest brew/koji build, get commit hash and use it as ref to checkout the relevant code so that we can check for fix applicability without actually creating the target branch (which will be created later by backport agent if required). There is a hardcoded catch that if we fail to check applicability with missing z-stream branch we proceed with backport anyway. This is just a safety net because in most cases if the target branch does not exist that means the fix is likely applicable and the backport is needed.