From 36aa22bd180b431ad7c66e9abd4b9b6490434e1b Mon Sep 17 00:00:00 2001 From: mrT23 Date: Mon, 19 Feb 2024 08:30:45 +0200 Subject: [PATCH] Refactor PR help message and update related documentation --- README.md | 10 ++++---- docs/TOOLS_GUIDE.md | 1 + pr_agent/tools/pr_help_message.py | 40 +++++++++++++++---------------- 3 files changed, 26 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 4ec4a073..a13acce1 100644 --- a/README.md +++ b/README.md @@ -115,21 +115,21 @@ ___ ‣ **Auto Description ([`/describe`](./docs/DESCRIBE.md))**: Automatically generating PR description - title, type, summary, code walkthrough and labels. \ -‣ **Auto Review ([`/review`](./docs/REVIEW.md))**: Adjustable feedback about the PR main theme, type, relevant tests, security issues, score, and various suggestions for the PR content. +‣ **Auto Review ([`/review`](./docs/REVIEW.md))**: Adjustable feedback about the PR, possible issues, security concerns, review effort and more. \ ‣ **Question Answering ([`/ask ...`](./docs/ASK.md))**: Answering free-text questions about the PR. \ -‣ **Code Suggestions ([`/improve`](./docs/IMPROVE.md))**: Committable code suggestions for improving the PR. +‣ **Code Suggestions ([`/improve`](./docs/IMPROVE.md))**: Code suggestions for improving the PR. \ ‣ **Update Changelog ([`/update_changelog`](./docs/UPDATE_CHANGELOG.md))**: Automatically updating the CHANGELOG.md file with the PR changes. \ ‣ **Find Similar Issue ([`/similar_issue`](./docs/SIMILAR_ISSUE.md))**: Automatically retrieves and presents similar issues. \ -‣ **Add Documentation 💎 ([`/add_docs`](./docs/ADD_DOCUMENTATION.md))**: Automatically adds documentation to methods/functions/classes that changed in the PR. +‣ **Add Documentation 💎 ([`/add_docs`](./docs/ADD_DOCUMENTATION.md))**: Generates documentation to methods/functions/classes that changed in the PR. \ -‣ **Generate Custom Labels 💎 ([`/generate_labels`](./docs/GENERATE_CUSTOM_LABELS.md))**: Automatically suggests custom labels based on the PR code changes. +‣ **Generate Custom Labels 💎 ([`/generate_labels`](./docs/GENERATE_CUSTOM_LABELS.md))**: Generates custom labels for the PR, based on specific guidelines defined by the user. \ -‣ **Analyze 💎 ([`/analyze`](./docs/Analyze.md))**: Automatically analyzes the PR, and presents changes walkthrough for each component. +‣ **Analyze 💎 ([`/analyze`](./docs/Analyze.md))**: Identify code components that changed in the PR, and enables to interactively generate tests, docs, and code suggestions for each component. \ ‣ **Custom Suggestions 💎 ([`/custom_suggestions`](./docs/CUSTOM_SUGGESTIONS.md))**: Automatically generates custom suggestions for improving the PR code, based on specific guidelines defined by the user. \ diff --git a/docs/TOOLS_GUIDE.md b/docs/TOOLS_GUIDE.md index e356b98c..a993e0ef 100644 --- a/docs/TOOLS_GUIDE.md +++ b/docs/TOOLS_GUIDE.md @@ -5,6 +5,7 @@ - [ASK](./ASK.md) - [SIMILAR_ISSUE](./SIMILAR_ISSUE.md) - [UPDATE CHANGELOG](./UPDATE_CHANGELOG.md) +- [CUSTOM SUGGESTIONS](./CUSTOM_SUGGESTIONS.md) 💎 - [ADD DOCUMENTATION](./ADD_DOCUMENTATION.md) 💎 - [GENERATE CUSTOM LABELS](./GENERATE_CUSTOM_LABELS.md) 💎 - [Analyze](./Analyze.md) 💎 diff --git a/pr_agent/tools/pr_help_message.py b/pr_agent/tools/pr_help_message.py index bc40b614..4189ff85 100644 --- a/pr_agent/tools/pr_help_message.py +++ b/pr_agent/tools/pr_help_message.py @@ -10,27 +10,27 @@ class PRHelpMessage: async def run(self): try: get_logger().info('Getting PR Help Message...') - pr_comment="## PR Agent Intro\n\n" - pr_comment +="🤖 Welcome to the PR Agent, an AI-powered tool for automated pull request analysis, feedback, suggestions and more.""" - pr_comment +="\n\nHere are the tools you can use to interact with the PR Agent:\n" - base_path ="https://github.com/Codium-ai/pr-agent/tree/main/docs" - pr_comment +=f"""\ -\n\n -- [DESCRIBE]({base_path}/DESCRIBE.md) -- [REVIEW]({base_path}/REVIEW.md) -- [IMPROVE]({base_path}/IMPROVE.md) -- [ASK]({base_path}/ASK.md) -- [SIMILAR_ISSUE]({base_path}/SIMILAR_ISSUE.md) -- [UPDATE CHANGELOG]({base_path}/UPDATE_CHANGELOG.md) -- [ADD DOCUMENTATION]({base_path}/ADD_DOCUMENTATION.md) -- [GENERATE CUSTOM LABELS]({base_path}/GENERATE_CUSTOM_LABELS.md) -- [Analyze]({base_path}/Analyze.md) -- [Test]({base_path}/TEST.md) -- [CI Feedback]({base_path}/CI_FEEDBACK.md) -""" - pr_comment +=f"""\n\nNote that each command be [applied 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 invoked manually by [commenting on a PR](https://github.com/Codium-ai/pr-agent/blob/main/Usage.md#online-usage).""" + pr_comment = "## PR Agent Walkthrough\n\n" + pr_comment += "🤖 Welcome to the PR Agent, an AI-powered tool for automated pull request analysis, feedback, suggestions and more.""" + pr_comment += "\n\nHere is a list of tools you can use to interact with the PR Agent:\n" + base_path = "https://github.com/Codium-ai/pr-agent/tree/main/docs" + pr_comment += f"" + 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 += "
ToolDescription
\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: self.git_provider.publish_comment(pr_comment) except Exception as e: get_logger().error(f"Error while running PRHelpMessage: {e}") - return "" + return "" \ No newline at end of file