From 8bda365636576c518e2e13f2f2107d483c8c5a62 Mon Sep 17 00:00:00 2001 From: mrT23 Date: Sun, 31 Mar 2024 12:13:25 +0300 Subject: [PATCH 1/2] docs: Add "Improve Component" tool documentation and update related guides --- docs/docs/tools/improve_component.md | 24 +++++++++++++++++++++++ docs/docs/tools/index.md | 29 ++++++++++++++-------------- docs/docs/tools/test.md | 2 +- docs/mkdocs.yml | 1 + pr_agent/settings/configuration.toml | 5 +++++ 5 files changed, 46 insertions(+), 15 deletions(-) create mode 100644 docs/docs/tools/improve_component.md diff --git a/docs/docs/tools/improve_component.md b/docs/docs/tools/improve_component.md new file mode 100644 index 000000000..d7e0e787d --- /dev/null +++ b/docs/docs/tools/improve_component.md @@ -0,0 +1,24 @@ +## Overview +The `improve_component` tool generates code suggestions for a specific code component that changed in the PR. +it can be invoked manually by commenting on any PR: +``` +/improve_component component_name +``` + +To get a list of the components that changed in the PR and choose the relevant component interactively, use the [`analyze`](./analyze.md) tool. + + +Example result: + +![improve_component1](https://codium.ai/images/pr_agent/improve_component1.png){width=768} + +![improve_component2](https://codium.ai/images/pr_agent/improve_component2.png){width=768} + +**Notes** +- Language that are currently supported by the tool: Python, Java, C++, JavaScript, TypeScript. + +## Configuration options +- `num_code_suggestions`: number of code suggestions to provide. Default is 4 +- `extra_instructions`: Optional extra instructions to the tool. For example: "focus on ...". +- `file`: in case there are several components with the same name, you can specify the relevant file. +- `class_name`: in case there are several methods with the same name in the same file, you can specify the relevant class name. \ No newline at end of file diff --git a/docs/docs/tools/index.md b/docs/docs/tools/index.md index bcd9ed9de..b77097b30 100644 --- a/docs/docs/tools/index.md +++ b/docs/docs/tools/index.md @@ -2,19 +2,20 @@ Here is a list of PR-Agent tools, each with a dedicated page that explains how to use it: -| Tool | Description | -|-------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------| -| **[PR Description (`/describe`](./describe.md))** | Automatically generating PR description - title, type, summary, code walkthrough and labels | -| **[PR Review (`/review`](./review.md))** | Adjustable feedback about the PR, possible issues, security concerns, review effort and more | -| **[Code Suggestions (`/improve`](./improve.md))** | Code suggestions for improving the PR | -| **[Question Answering (`/ask ...`](./ask.md))** | Answering free-text questions about the PR, or on specific code lines | -| **[Update Changelog (`/update_changelog`](./update_changelog.md))** | Automatically updating the CHANGELOG.md file with the PR changes | -| **[Find Similar Issue (`/similar_issue`](./similar_issues.md))** | Automatically retrieves and presents similar issues | -| **💎 [Add Documentation (`/add_docs`](./documentation.md))** | Generates documentation to methods/functions/classes that changed in the PR | -| **💎 [Generate Custom Labels (`/generate_labels`](./custom_labels.md))** | Generates custom labels for the PR, based on specific guidelines defined by the user | -| **💎 [Analyze (`/analyze`](./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`](./custom_suggestions.md))** | Automatically generates custom suggestions for improving the PR code, based on specific guidelines defined by the user | -| **💎 [Generate Tests (`/test component_name`](./test.md))** | Automatically generates unit tests for a selected component, based on the PR code changes | -| **💎 [CI Feedback (`/checks ci_job`](./ci_feedback.md))** | Automatically generates feedback and analysis for a failed CI job | +| Tool | Description | +|------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------| +| **[PR Description (`/describe`](./describe.md))** | Automatically generating PR description - title, type, summary, code walkthrough and labels | +| **[PR Review (`/review`](./review.md))** | Adjustable feedback about the PR, possible issues, security concerns, review effort and more | +| **[Code Suggestions (`/improve`](./improve.md))** | Code suggestions for improving the PR | +| **[Question Answering (`/ask ...`](./ask.md))** | Answering free-text questions about the PR, or on specific code lines | +| **[Update Changelog (`/update_changelog`](./update_changelog.md))** | Automatically updating the CHANGELOG.md file with the PR changes | +| **[Find Similar Issue (`/similar_issue`](./similar_issues.md))** | Automatically retrieves and presents similar issues | +| **💎 [Add Documentation (`/add_docs`](./documentation.md))** | Generates documentation to methods/functions/classes that changed in the PR | +| **💎 [Generate Custom Labels (`/generate_labels`](./custom_labels.md))** | Generates custom labels for the PR, based on specific guidelines defined by the user | +| **💎 [Analyze (`/analyze`](./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`](./custom_suggestions.md))** | Automatically generates custom suggestions for improving the PR code, based on specific guidelines defined by the user | +| **💎 [Generate Tests (`/test component_name`](./test.md))** | Automatically generates unit tests for a selected component, based on the PR code changes | +| **💎 [Improve Component (`/improve_component component_name`](./improve_component.md))** | Generates code suggestions for a specific code component that changed in the PR | +| **💎 [CI Feedback (`/checks ci_job`](./ci_feedback.md))** | Automatically generates feedback and analysis for a failed CI job | Note that the tools marked with 💎 are available only for PR-Agent Pro users. \ No newline at end of file diff --git a/docs/docs/tools/test.md b/docs/docs/tools/test.md index 6c1901b14..4cb46bac9 100644 --- a/docs/docs/tools/test.md +++ b/docs/docs/tools/test.md @@ -5,7 +5,7 @@ It can be invoked manually by commenting on any PR: /test component_name ``` where 'component_name' is the name of a specific component in the PR. -To get a list of the components that changed in the PR, use the [`analyze`](./analyze.md) tool. +To get a list of the components that changed in the PR and choose the relevant component interactively, use the [`analyze`](./analyze.md) tool. An example [result](https://github.com/Codium-ai/pr-agent/pull/598#issuecomment-1913679429): diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index b7e6864d2..e67712e1c 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -27,6 +27,7 @@ nav: - Similar Issues: 'tools/similar_issues.md' - 💎 Analyze: 'tools/analyze.md' - 💎 Test: 'tools/test.md' + - 💎 Improve Component: 'tools/improve_component.md' - 💎 Documentation: 'tools/documentation.md' - 💎 Custom Labels: 'tools/custom_labels.md' - 💎 Custom Suggestions: 'tools/custom_suggestions.md' diff --git a/pr_agent/settings/configuration.toml b/pr_agent/settings/configuration.toml index 837c71d38..765c8342a 100644 --- a/pr_agent/settings/configuration.toml +++ b/pr_agent/settings/configuration.toml @@ -110,6 +110,11 @@ file = "" # in case there are several components with the same name class_name = "" # in case there are several methods with the same name in the same file, you can specify the relevant class name enable_help_text=true +[pr_improve_component] # /improve_component # +num_code_suggestions=4 +extra_instructions = "" +file = "" # in case there are several components with the same name, you can specify the relevant file +class_name = "" [checks] # /checks (pro feature) # enable_auto_checks_feedback=true From ce47adf986593bff404ae06b613c5909fadab72f Mon Sep 17 00:00:00 2001 From: mrT23 Date: Sun, 31 Mar 2024 12:15:29 +0300 Subject: [PATCH 2/2] C# --- docs/docs/tools/analyze.md | 2 +- docs/docs/tools/documentation.md | 2 +- docs/docs/tools/improve_component.md | 2 +- docs/docs/tools/test.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/docs/tools/analyze.md b/docs/docs/tools/analyze.md index 3b7c6d583..0255e759f 100644 --- a/docs/docs/tools/analyze.md +++ b/docs/docs/tools/analyze.md @@ -19,4 +19,4 @@ An example [result](https://github.com/Codium-ai/pr-agent/pull/546#issuecomment- **Notes** -- Language that are currently supported: Python, Java, C++, JavaScript, TypeScript. \ No newline at end of file +- Language that are currently supported: Python, Java, C++, JavaScript, TypeScript, C#. \ No newline at end of file diff --git a/docs/docs/tools/documentation.md b/docs/docs/tools/documentation.md index 4318ee452..9c56386f9 100644 --- a/docs/docs/tools/documentation.md +++ b/docs/docs/tools/documentation.md @@ -19,6 +19,6 @@ For example: **Notes** -- Language that are currently fully supported: Python, Java, C++, JavaScript, TypeScript. +- Language that are currently fully supported: Python, Java, C++, JavaScript, TypeScript, C#. - For languages that are not fully supported, the tool will suggest documentation only for new components in the PR. - A previous version of the tool, that offered support only for new components, was deprecated. \ No newline at end of file diff --git a/docs/docs/tools/improve_component.md b/docs/docs/tools/improve_component.md index d7e0e787d..321114b41 100644 --- a/docs/docs/tools/improve_component.md +++ b/docs/docs/tools/improve_component.md @@ -15,7 +15,7 @@ Example result: ![improve_component2](https://codium.ai/images/pr_agent/improve_component2.png){width=768} **Notes** -- Language that are currently supported by the tool: Python, Java, C++, JavaScript, TypeScript. +- Language that are currently supported by the tool: Python, Java, C++, JavaScript, TypeScript, C#. ## Configuration options - `num_code_suggestions`: number of code suggestions to provide. Default is 4 diff --git a/docs/docs/tools/test.md b/docs/docs/tools/test.md index 4cb46bac9..52e447ceb 100644 --- a/docs/docs/tools/test.md +++ b/docs/docs/tools/test.md @@ -17,7 +17,7 @@ An example [result](https://github.com/Codium-ai/pr-agent/pull/598#issuecomment- ![test3](https://codium.ai/images/pr_agent/test3.png){width=768} **Notes** -- Language that are currently supported by the tool: Python, Java, C++, JavaScript, TypeScript. +- Language that are currently supported by the tool: Python, Java, C++, JavaScript, TypeScript, C#. ## Configuration options