Repository navigation
Reset everything after a build failure and let agents start from zero - #273
Conversation
Signed-off-by: Nikola Forró <nforro@redhat.com>
There was a problem hiding this comment.
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.
| return "comment_in_jira" | ||
| state.build_error = build_result.error | ||
| return "run_backport_agent" | ||
| return "fork_and_prepare_dist_git" |
There was a problem hiding this comment.
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.
| return "comment_in_jira" | ||
| state.build_error = build_result.error | ||
| return "run_rebase_agent" | ||
| return "fork_and_prepare_dist_git" |
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
Let's see how will this work out
|
|
||
| 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. |
No description provided.