Skip to content

Do not needlessly create Z-Stream branch#543

Merged
nforro merged 1 commit into
packit:mainfrom
nforro:z-stream-branches
May 29, 2026
Merged

Do not needlessly create Z-Stream branch#543
nforro merged 1 commit into
packit:mainfrom
nforro:z-stream-branches

Conversation

@nforro
Copy link
Copy Markdown
Member

@nforro nforro commented May 29, 2026

No description provided.

Copy link
Copy Markdown
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 refactors the branch mapping logic in ymir/agents/triage_agent.py to handle older Z-Streams and the latest/upcoming Z-Streams differently. While older Z-Streams are mapped directly to internal RHEL branches, the latest Z-Streams query available branches and fall back to CentOS Stream if the expected branch is missing or if an error occurs. The review feedback highlights a risk in catching generic exceptions during this check, as transient network or gateway failures would cause an incorrect silent fallback to CentOS Stream instead of triggering a retry. It is recommended to let these exceptions propagate to allow the task to be retried.

Comment thread ymir/agents/triage_agent.py Outdated
@nforro nforro force-pushed the z-stream-branches branch from f6d66bb to cb2ce49 Compare May 29, 2026 13:53
@nforro
Copy link
Copy Markdown
Member Author

nforro commented May 29, 2026

/gemini review

Copy link
Copy Markdown
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 refactors the branch mapping logic in ymir/agents/triage_agent.py to handle older Z-Streams and current/upcoming Z-Streams separately. For current Z-Streams, it queries available internal RHEL branches and falls back to CentOS Stream if the expected branch is not found. The reviewer noted that the removal of the try-except block around the external tool call could lead to unhandled exceptions crashing the workflow, and suggested restoring the error handling to ensure robustness.

Comment thread ymir/agents/triage_agent.py
Comment thread ymir/agents/triage_agent.py Outdated
# For Z-stream bugs, always use internal RHEL branch
# Check if branch exists, but use it anyway since it will be created later if needed
if is_zstream or older_zstream:
# For older Z-Streams, always use internal RHEL branch (it must already exist)
Copy link
Copy Markdown
Collaborator

@antbob antbob May 29, 2026

Choose a reason for hiding this comment

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

The assumption that for older z-streams the branch already exist is incorrect. while in majority of cases it should hold true, sometime it is not the case for some packages and the branch has to be created. In this context tho i guess it should be handled elsewhere eg if triage agent is trying to determine patch applicability and the branch does not exist then this should be passed down to backport agent as valid backport target ie the patch we're trying to backport is definitely not in the target branch so it should be backported (and the related branch created). of course the ideal solution would be to look at the previous branch (the new one will be created from) to check for eligibility.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

But the code is fine, only the comment is inaccurate, right?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@nforro the code is fine up to the point where you're no longer calling mcp to get existing branches and returning before that so like i've mentioned it can have implications on triage agent decision to backport or not (i dunno if thats the case tho).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@nforro no, i think its fine, it doesnt really change the behavior, just me being slow today

Signed-off-by: Nikola Forró <nforro@redhat.com>
Assisted-by: Claude Opus 4.6 via Claude Code
Copy link
Copy Markdown
Collaborator

@antbob antbob left a comment

Choose a reason for hiding this comment

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

just some comments on older z-stream branches

@nforro nforro force-pushed the z-stream-branches branch from cb2ce49 to 578e84d Compare May 29, 2026 14:10
Copy link
Copy Markdown
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 9fe0a2a into packit:main May 29, 2026
9 checks passed
@nforro nforro deleted the z-stream-branches branch May 29, 2026 16:04
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.

3 participants