Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions agents/backport_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ def get_prompt() -> str:

{{.}}

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.

😂

{{/build_error}}
"""

Expand Down Expand Up @@ -309,7 +310,7 @@ async def run_build_agent(state):
)
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.


async def update_release(state):
try:
Expand Down
5 changes: 3 additions & 2 deletions agents/rebase_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ def get_prompt() -> str:

{{.}}

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.
{{/build_error}}
"""

Expand Down Expand Up @@ -280,7 +281,7 @@ async def run_build_agent(state):
)
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.


async def update_release(state):
try:
Expand Down