Skip to content

Backporting agent: rebasing patches - #73

Merged
TomasTomecek merged 8 commits into
packit:mainfrom
TomasTomecek:rebase-patches-with-instructions
Aug 8, 2025
Merged

TomasTomecek merged 8 commits into
packit:mainfrom
TomasTomecek:rebase-patches-with-instructions

Conversation

@TomasTomecek

@TomasTomecek TomasTomecek commented Aug 6, 2025 •

Copy link
Copy Markdown
Member

TODO:

  • wait for Nikola's fixes to tools and retry with more jiras
  • implement for openshift mode as well

Fixes https://github.com/packit/jotnar/issues/54

@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 introduces a new capability for the backporting agent to rebase patches. It also includes configuration changes for the agent's container environment and updates to the agent's tooling and prompts. My review focuses on several key areas. I've identified a hardcoded personal email in the Containerfile and suggested a more robust approach. I've also found critical issues in backport_agent.py, including leftover debugging code that can hang the application and a bug that would cause an UnboundLocalError. Additionally, an invalid type hint in tools/text.py will cause a TypeError. Finally, I've suggested improvements for maintainability regarding a fragile glob pattern. The feedback aims to ensure the code is production-ready, correct, and maintainable.

Comment thread beeai/agents/backport_agent.py
Comment thread beeai/agents/tools/text.py Outdated
Comment thread beeai/Containerfile
Comment thread beeai/agents/backport_agent.py Outdated

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

great progress! I like how with the tools the prompts/instructions are more concise

Comment thread beeai/agents/backport_agent.py Outdated
Comment thread beeai/agents/backport_agent.py
@TomasTomecek
TomasTomecek force-pushed the rebase-patches-with-instructions branch from a1e7912 to 418be84 Compare August 7, 2025 14:50

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

I think the first commit is not supposed to be there.

Comment thread beeai/agents/backport_agent.py Outdated
Comment thread beeai/agents/backport_agent.py Outdated
Comment thread beeai/agents/backport_agent.py Outdated
Comment thread beeai/agents/backport_agent.py Outdated
Comment thread beeai/agents/backport_agent.py Outdated
Comment thread beeai/agents/backport_agent.py Outdated
Comment thread beeai/agents/backport_agent.py Outdated
Comment thread beeai/agents/tools/wicked_git.py Outdated

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

great changes, thanks a lot! 🚀

@TomasTomecek
TomasTomecek force-pushed the rebase-patches-with-instructions branch from 64753de to 06859eb Compare August 8, 2025 08:34
@TomasTomecek

Copy link
Copy Markdown
Member Author

This is now ready for a final review. You can try this easily yourself:

make run-backport-agent-standalone PACKAGE=cups-filters UPSTREAM_FIX=https://github.com/OpenPrinting/cups-filters/commit/41c5f2f6139e4d3693c2483ee4281202a80ae451 BRANCH=c10s JIRA_ISSUE=RHEL-93944 DRY_RUN=true

TomasTomecek and others added 8 commits August 8, 2025 13:41
utilize both instructions and a prompt

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
Co-authored-by: Nikola Forró <nforro@redhat.com>
Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
...unless dry_run

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
- add a simple and a complex test case
- convert output to StringToolOutput, much simpler
- wrap everything in try/except, otherwise errors are not displayed

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
Co-authored-by: Nikola Forró <nforro@redhat.com>
Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
@TomasTomecek
TomasTomecek force-pushed the rebase-patches-with-instructions branch from 54b8c22 to ecb3a89 Compare August 8, 2025 11:41
@TomasTomecek
TomasTomecek merged commit 0a6989a into packit:main Aug 8, 2025
@TomasTomecek
TomasTomecek deleted the rebase-patches-with-instructions branch August 8, 2025 11:41
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