Skip to content

Reset everything after a build failure and let agents start from zero - #273

Merged
nforro merged 1 commit into
packit:mainfrom
nforro:repeated-runs
Oct 14, 2025
Merged

nforro merged 1 commit into
packit:mainfrom
nforro:repeated-runs

Conversation

@nforro

@nforro nforro commented Oct 13, 2025

Copy link
Copy Markdown
Member

No description provided.

Signed-off-by: Nikola Forró <nforro@redhat.com>

@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 correctly modifies the backport and rebase agents to reset the entire environment after a build failure by transitioning the workflow back to the fork_and_prepare_dist_git step. This ensures a clean state for subsequent attempts. The prompts for the agents are also updated to reflect this new behavior. The changes are logical and well-implemented. I have added comments regarding code duplication in the run_build_agent function across both agents, which could be refactored to improve maintainability.

Comment thread agents/backport_agent.py
return "comment_in_jira"
state.build_error = build_result.error
return "run_backport_agent"
return "fork_and_prepare_dist_git"

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.

medium

This change to restart the workflow from fork_and_prepare_dist_git on build failure is a good improvement, as it ensures a clean state for retries.

On a related note, the run_build_agent function is nearly identical in backport_agent.py and rebase_agent.py. This duplication could be addressed in a future refactoring to improve maintainability. Consider moving the common logic to a shared location like agents/package_update_steps.py.

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.

Sure, one day.

Comment thread agents/rebase_agent.py
return "comment_in_jira"
state.build_error = build_result.error
return "run_rebase_agent"
return "fork_and_prepare_dist_git"

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.

medium

This change to restart the workflow from fork_and_prepare_dist_git on build failure is correct and ensures a clean state for retries.

As with the backport_agent, the run_build_agent function here is almost a direct copy of the one in agents/backport_agent.py. To improve maintainability and reduce code duplication, consider refactoring this shared logic into a common function, for example in agents/package_update_steps.py.

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

Let's see how will this work out

Comment thread agents/backport_agent.py

Do your best to fix the issue and then generate a new SRPM.
Everything from the previous attempt has been reset. Start over, follow the instructions from the start
and don't forget to fix the issue.

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.

😂

@nforro
nforro merged commit 46c9f7b into packit:main Oct 14, 2025
6 checks passed
@nforro
nforro deleted the repeated-runs branch October 14, 2025 05:52
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