From 5c5015b2671ae3221cbd9833aecb757ba93208ba Mon Sep 17 00:00:00 2001 From: Gadi Zimerman Date: Tue, 18 Jul 2023 14:45:15 +0300 Subject: [PATCH 1/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0728bbce..9165af8f 100644 --- a/README.md +++ b/README.md @@ -132,7 +132,7 @@ Here are several ways to install and run PR-Agent: ## How it works -![PR-Agent Tools](https://www.codium.ai/wp-content/uploads/2023/07/pr-agent-schema-updated.png) +![PR-Agent Tools](https://www.codium.ai/wp-content/uploads/2023/07/codiumai-diagram-v4.jpg) Check out the [PR Compression strategy](./PR_COMPRESSION.md) page for more details on how we convert a code diff to a manageable LLM prompt From c5077854752cfdeac50ebbac328af0fa8c258705 Mon Sep 17 00:00:00 2001 From: mrT23 Date: Tue, 18 Jul 2023 16:32:51 +0300 Subject: [PATCH 2/3] bugfix --- pr_agent/algo/utils.py | 1 + pr_agent/tools/pr_reviewer.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pr_agent/algo/utils.py b/pr_agent/algo/utils.py index f813b8cd..9fe7a3a2 100644 --- a/pr_agent/algo/utils.py +++ b/pr_agent/algo/utils.py @@ -17,6 +17,7 @@ def convert_to_markdown(output_data: dict) -> str: "Focused PR": "✨", "Security concerns": "🔒", "General PR suggestions": "💡", + "Insights from user's answers": "📝", "Code suggestions": "🤖" } diff --git a/pr_agent/tools/pr_reviewer.py b/pr_agent/tools/pr_reviewer.py index 4f6fde74..8da08dfa 100644 --- a/pr_agent/tools/pr_reviewer.py +++ b/pr_agent/tools/pr_reviewer.py @@ -24,7 +24,7 @@ class PRReviewer: self.is_answer = is_answer if self.is_answer and not self.git_provider.is_supported("get_issue_comments"): raise Exception(f"Answer mode is not supported for {settings.config.git_provider} for now") - answer_str = question_str = self._get_user_answers() + answer_str, question_str = self._get_user_answers() self.ai_handler = AiHandler() self.patches_diff = None self.prediction = None From 77f243b7abcb4287b4fb535da35ae47f1618369d Mon Sep 17 00:00:00 2001 From: zmeir Date: Tue, 18 Jul 2023 16:22:41 +0300 Subject: [PATCH 3/3] Allow passing CLI args (helps with debugging) --- pr_agent/cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pr_agent/cli.py b/pr_agent/cli.py index ca9d5db0..d6af7cf6 100644 --- a/pr_agent/cli.py +++ b/pr_agent/cli.py @@ -10,7 +10,7 @@ from pr_agent.tools.pr_questions import PRQuestions from pr_agent.tools.pr_reviewer import PRReviewer -def run(): +def run(args=None): parser = argparse.ArgumentParser(description='AI based pull request analyzer', usage="""\ Usage: cli.py --pr-url []. For example: @@ -35,7 +35,7 @@ reflect - Ask the PR author questions about the PR. 'reflect', 'review_after_reflect'], default='review') parser.add_argument('rest', nargs=argparse.REMAINDER, default=[]) - args = parser.parse_args() + args = parser.parse_args(args) logging.basicConfig(level=os.environ.get("LOGLEVEL", "INFO")) command = args.command.lower() if command in ['ask', 'ask_question']: