From 2be0339a27b09e0174b4993d3f6f3f1a18e679ab Mon Sep 17 00:00:00 2001 From: mrT23 Date: Mon, 19 Feb 2024 21:42:13 +0200 Subject: [PATCH 1/2] help improved --- pr_agent/tools/pr_description.py | 8 +++----- pr_agent/tools/pr_help_message.py | 10 +++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/pr_agent/tools/pr_description.py b/pr_agent/tools/pr_description.py index d7dbec1e..34e7216f 100644 --- a/pr_agent/tools/pr_description.py +++ b/pr_agent/tools/pr_description.py @@ -11,7 +11,7 @@ from pr_agent.algo.pr_processing import get_pr_diff, retry_with_fallback_models from pr_agent.algo.token_handler import TokenHandler from pr_agent.algo.utils import load_yaml, set_custom_labels, get_user_labels, ModelType from pr_agent.config_loader import get_settings -from pr_agent.git_providers import get_git_provider, GithubProvider +from pr_agent.git_providers import get_git_provider from pr_agent.git_providers.git_provider import get_main_pr_language from pr_agent.log import get_logger from pr_agent.servers.help import HelpMessage @@ -107,10 +107,8 @@ class PRDescription: pr_body += HelpMessage.get_describe_usage_guide() pr_body += "\n\n" elif get_settings().pr_description.enable_help_comment: - if isinstance(self.git_provider, GithubProvider): - pr_body +="\n\n___\n\n✨ **PR-Agent usage guide**:\n\n- [ ] Mark this checkbox :gem:, or comment `/help`, to get a list of all PR-Agent tools and their descriptions. " - else: - pr_body +="\n\n___\n\n>Comment `/help` on the PR to to get a list of all PR-Agent tools and their descriptions\n\n___\n\n" + pr_body +="\n\n___\n\n> ✨ **PR-Agent usage**:" + pr_body +="\n>Comment `/help` on the PR to get a list of all available PR-Agent tools and their descriptions\n\n" # final markdown description diff --git a/pr_agent/tools/pr_help_message.py b/pr_agent/tools/pr_help_message.py index 4615135f..2a76a835 100644 --- a/pr_agent/tools/pr_help_message.py +++ b/pr_agent/tools/pr_help_message.py @@ -19,14 +19,14 @@ class PRHelpMessage: tool_names.append(f"[DESCRIBE]({base_path}/DESCRIBE.md)") tool_names.append(f"[REVIEW]({base_path}/REVIEW.md)") tool_names.append(f"[IMPROVE]({base_path}/IMPROVE.md)") - tool_names.append(f"[ANALYZE]({base_path}/Analyze.md)") + tool_names.append(f"[ANALYZE]({base_path}/Analyze.md) šŸ’Ž") tool_names.append(f"[UPDATE CHANGELOG]({base_path}/UPDATE_CHANGELOG.md)") - tool_names.append(f"[ADD DOCUMENTATION]({base_path}/ADD_DOCUMENTATION.md)") + tool_names.append(f"[ADD DOCUMENTATION]({base_path}/ADD_DOCUMENTATION.md) šŸ’Ž") tool_names.append(f"[ASK]({base_path}/ASK.md)") tool_names.append(f"[GENERATE CUSTOM LABELS]({base_path}/GENERATE_CUSTOM_LABELS.md)") - tool_names.append(f"[TEST]({base_path}/TEST.md)") - tool_names.append(f"[CI FEEDBACK]({base_path}/CI_FEEDBACK.md)") - tool_names.append(f"[CUSTOM SUGGESTIONS]({base_path}/CUSTOM_SUGGESTIONS.md)") + tool_names.append(f"[TEST]({base_path}/TEST.md) šŸ’Ž") + tool_names.append(f"[CI FEEDBACK]({base_path}/CI_FEEDBACK.md) šŸ’Ž") + tool_names.append(f"[CUSTOM SUGGESTIONS]({base_path}/CUSTOM_SUGGESTIONS.md) šŸ’Ž") tool_names.append(f"[SIMILAR ISSUE]({base_path}/SIMILAR_ISSUE.md)") descriptions = [] From 82ba285395b2bf424e5bfe292e0ce517730838f8 Mon Sep 17 00:00:00 2001 From: mrT23 Date: Mon, 19 Feb 2024 21:44:00 +0200 Subject: [PATCH 2/2] finalize --- README.md | 2 +- pr_agent/tools/pr_help_message.py | 14 +------------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index a13acce1..bb8dac7e 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ Added ["PR Actions" šŸ’Ž](https://www.codium.ai/images/pr_agent/pr-actions.mp4) ### Jan 28, 2024 -- šŸ’Ž Test - A new tool, [`/test component_name`](https://github.com/Codium-ai/pr-agent/blob/main/docs/TEST.md), was added to PR-Agent Pro. The tool will generate tests for a selected component, based on the PR code changes. +- šŸ’Ž Test - A new tool, [`/test component_name`](https://github.com/Codium-ai/pr-agent/blob/main/docs/TEST.md), was added to PR-Agent Pro. The tool will generate tests for a specific component, based on the PR code changes. - šŸ’Ž Analyze - The [`/analyze`](https://github.com/Codium-ai/pr-agent/blob/main/docs/Analyze.md) tool was updated and simplified. It now presents a summary of the code components that were changed in the PR. ### Jan 21, 2024 - šŸ’Ž Custom suggestions - A new tool, `/custom_suggestions`, was added to PR-Agent Pro. The tool will propose only suggestions that follow specific guidelines defined by the user. diff --git a/pr_agent/tools/pr_help_message.py b/pr_agent/tools/pr_help_message.py index 2a76a835..5677698c 100644 --- a/pr_agent/tools/pr_help_message.py +++ b/pr_agent/tools/pr_help_message.py @@ -38,7 +38,7 @@ class PRHelpMessage: descriptions.append("Generates documentation to methods/functions/classes that changed in the PR.") descriptions.append("Answering free-text questions about the PR.") descriptions.append("Generates custom labels for the PR, based on specific guidelines defined by the user") - descriptions.append("Generates unit tests for a selected component, based on the PR code change.") + descriptions.append("Generates unit tests for a specific component, based on the PR code change.") descriptions.append("Generates feedback and analysis for a failed CI job.") descriptions.append("Generates custom suggestions for improving the PR code, based on specific guidelines defined by the user.") descriptions.append("Automatically retrieves and presents similar issues.") @@ -82,18 +82,6 @@ class PRHelpMessage: pr_comment += f"" for i in range(len(tool_names)): pr_comment += f"\n" - # pr_comment += f"\n" - # pr_comment += f"\n" - # pr_comment += f"\n" - # pr_comment += f"\n" - # pr_comment += f"\n" - # pr_comment += f"\n" - # pr_comment += f"\n" - # pr_comment += f"\n" - # pr_comment += f"\n" - # pr_comment += f"\n" - # pr_comment += f"\n" - # pr_comment += f"\n" pr_comment += "
ToolCommandDescription
\n\n{tool_names[i]}{commands[i]}{descriptions[i]}
\n\n[DESCRIBE]({base_path}/DESCRIBE.md)Generates PR description - title, type, summary, code walkthrough and labels
\n\n[REVIEW]({base_path}/REVIEW.md)Adjustable feedback about the PR, possible issues, security concerns, review effort and more
\n\n[IMPROVE]({base_path}/IMPROVE.md)Code suggestions for improving the PR.
\n\n[ASK]({base_path}/ASK.md)Answering free-text questions about the PR.
\n\n[SIMILAR ISSUE]({base_path}/SIMILAR_ISSUE.md)Automatically retrieves and presents similar issues.
\n\n[UPDATE CHANGELOG]({base_path}/UPDATE_CHANGELOG.md)Automatically updates the changelog.
\n\n[ADD DOCUMENTATION]({base_path}/ADD_DOCUMENTATION.md)Generates documentation to methods/functions/classes that changed in the PR.
\n\n[GENERATE CUSTOM LABELS]({base_path}/GENERATE_CUSTOM_LABELS.md)Generates custom labels for the PR, based on specific guidelines defined by the user
\n\n[ANALYZE]({base_path}/Analyze.md)Identifies code components that changed in the PR, and enables to interactively generate tests, docs, and code suggestions for each component.
\n\n[TEST]({base_path}/TEST.md)Generates unit tests for a selected component, based on the PR code change.
\n\n[CI FEEDBACK]({base_path}/CI_FEEDBACK.md)Generates feedback and analysis for a failed CI job.
\n\n[CUSTOM SUGGESTIONS]({base_path}/CUSTOM_SUGGESTIONS.md)Generates custom suggestions for improving the PR code, based on specific guidelines defined by the user.
\n\n" pr_comment += f"""\n\nNote that each tool be [invoked automatically](https://github.com/Codium-ai/pr-agent/blob/main/Usage.md#github-app-automatic-tools-for-pr-actions) when a new PR is opened, or called manually by [commenting on a PR](https://github.com/Codium-ai/pr-agent/blob/main/Usage.md#online-usage).""" if get_settings().config.publish_output: