Skip to content

Fix applicability check for non-existent z-stream branches - #555

Merged
antbob merged 3 commits into
packit:mainfrom
antbob:triage_zstream_applicability
Jun 3, 2026
Merged

antbob merged 3 commits into
packit:mainfrom
antbob:triage_zstream_applicability

Conversation

@antbob

@antbob antbob commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

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.

@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 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.

Comment thread ymir/agents/tasks.py
Comment thread ymir/agents/triage_agent.py
@antbob
antbob force-pushed the triage_zstream_applicability branch from 0e5575a to 70fa6e3 Compare June 2, 2026 14:29
pre-commit-ci Bot and others added 2 commits June 2, 2026 14:29
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

@lbarcziova lbarcziova left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this looks good, thanks for the fix! 🙏

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