From 796b36f0d1b6dbe2ed5cfd7968ad068877f35fe2 Mon Sep 17 00:00:00 2001 From: ofir-frd Date: Wed, 25 Dec 2024 11:34:41 +0200 Subject: [PATCH 1/9] Add documentation for /implement tool in tools section and related files --- docs/docs/tools/implement.md | 22 ++++++++++++++++++++++ docs/docs/tools/index.md | 2 +- docs/mkdocs.yml | 1 + 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 docs/docs/tools/implement.md diff --git a/docs/docs/tools/implement.md b/docs/docs/tools/implement.md new file mode 100644 index 00000000..529541ab --- /dev/null +++ b/docs/docs/tools/implement.md @@ -0,0 +1,22 @@ +## Overview + +The `implement` tool automatically generates implementation code based on PR review suggestions. +It combines LLM capabilities with static code analysis to help developers implement code changes quickly and with confidence. + + +To use the tool, manually invoke it by commenting in any PR discussion that contains code suggestions: +``` +/implement +``` + +## Example usage + +Invoke the tool manually by commenting `/implement` on any PR review discussion. +The tool will generate code implementation for the selected discussion: + +![implement1](https://codium.ai/images/pr_agent/implement1.png){width=768} + + +**Notes**
+- Languages that are currently supported by the tool: Python, Java, C++, JavaScript, TypeScript, C#.
+- Use `/implement ` to indirectly call the tool. \ No newline at end of file diff --git a/docs/docs/tools/index.md b/docs/docs/tools/index.md index 9b856e23..4301c5b0 100644 --- a/docs/docs/tools/index.md +++ b/docs/docs/tools/index.md @@ -18,5 +18,5 @@ Here is a list of Qodo Merge tools, each with a dedicated page that explains how | **💎 [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 | - +| **💎 [Implement (`/implement`](./implement.md))** | Generates implementation code from review suggestions | Note that the tools marked with 💎 are available only for Qodo Merge Pro users. diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index b168f621..9159197e 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -41,6 +41,7 @@ nav: - 💎 Custom Prompt: 'tools/custom_prompt.md' - 💎 CI Feedback: 'tools/ci_feedback.md' - 💎 Similar Code: 'tools/similar_code.md' + - 💎 Implement: 'tools/implement.md' - Core Abilities: - 'core-abilities/index.md' - Fetching ticket context: 'core-abilities/fetching_ticket_context.md' From 3994a2ba606f01171d099d0e312627f347282b48 Mon Sep 17 00:00:00 2001 From: ofir-frd Date: Wed, 25 Dec 2024 11:34:54 +0200 Subject: [PATCH 2/9] Add .qodo to gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 1d4841e4..e3bf85c3 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ dist/ *.egg-info/ build/ .DS_Store -docs/.cache/ \ No newline at end of file +docs/.cache/ +.qodo \ No newline at end of file From 19f6078ed07711cd128991a4249f4f4e4a0cefee Mon Sep 17 00:00:00 2001 From: ofir-frd Date: Wed, 25 Dec 2024 11:39:53 +0200 Subject: [PATCH 3/9] Add /test tool to tools section and fix typos --- README.md | 2 ++ docs/docs/tools/index.md | 35 ++++++++++++++++++----------------- docs/docs/tools/test.md | 2 +- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 8da99d17..5cdfa724 100644 --- a/README.md +++ b/README.md @@ -144,6 +144,8 @@ ___ \ ‣ **Analyze 💎 ([`/analyze`](https://pr-agent-docs.codium.ai/tools/analyze/))**: Identify code components that changed in the PR, and enables to interactively generate tests, docs, and code suggestions for each component. \ +‣ **Test 💎 ([`/test`](https://pr-agent-docs.codium.ai/tools/analyze/))**: Generate tests for a selected component, based on the PR code changes. +\ ‣ **Custom Prompt 💎 ([`/custom_prompt`](https://pr-agent-docs.codium.ai/tools/custom_prompt/))**: Automatically generates custom suggestions for improving the PR code, based on specific guidelines defined by the user. \ ‣ **Generate Tests 💎 ([`/test component_name`](https://pr-agent-docs.codium.ai/tools/test/))**: Generates unit tests for a selected component, based on the PR code changes. diff --git a/docs/docs/tools/index.md b/docs/docs/tools/index.md index 4301c5b0..3cb46356 100644 --- a/docs/docs/tools/index.md +++ b/docs/docs/tools/index.md @@ -2,21 +2,22 @@ Here is a list of Qodo Merge 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 | -| **[Help (`/help`](./help.md))** | Provides a list of all the available tools. Also enables to trigger them interactively (💎) | -| **💎 [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 Prompt (`/custom_prompt`](./custom_prompt.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 | -| **💎 [Implement (`/implement`](./implement.md))** | Generates implementation code from review suggestions | +| 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 | +| **[Help (`/help`](./help.md))** | Provides a list of all the available tools. Also enables to trigger them interactively (💎) | +| **💎 [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| +| **💎 [Test (`/test`](./implement.md))** | generate tests for a selected component, based on the PR code changes | +| **💎 [Custom Prompt (`/custom_prompt`](./custom_prompt.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 | +| **💎 [Implement (`/implement`](./implement.md))** | Generates implementation code from review suggestions | Note that the tools marked with 💎 are available only for Qodo Merge Pro users. diff --git a/docs/docs/tools/test.md b/docs/docs/tools/test.md index f3cc3910..b37fbd97 100644 --- a/docs/docs/tools/test.md +++ b/docs/docs/tools/test.md @@ -18,7 +18,7 @@ The tool will generate tests for the selected component (if no component is stat (Example taken from [here](https://github.com/Codium-ai/pr-agent/pull/598#issuecomment-1913679429)): **Notes** -- Language that are currently supported by the tool: Python, Java, C++, JavaScript, TypeScript, C#. +- Languages that are currently supported by the tool: Python, Java, C++, JavaScript, TypeScript, C#. - This tool can also be triggered interactively by using the [`analyze`](./analyze.md) tool. From 0f973681ea302127a6364c0dac1d2bc48c67bbf9 Mon Sep 17 00:00:00 2001 From: ofir-frd Date: Wed, 25 Dec 2024 11:43:23 +0200 Subject: [PATCH 4/9] Add /implement tool to README and fix /test tool link --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5cdfa724..4b151f2b 100644 --- a/README.md +++ b/README.md @@ -144,7 +144,7 @@ ___ \ ‣ **Analyze 💎 ([`/analyze`](https://pr-agent-docs.codium.ai/tools/analyze/))**: Identify code components that changed in the PR, and enables to interactively generate tests, docs, and code suggestions for each component. \ -‣ **Test 💎 ([`/test`](https://pr-agent-docs.codium.ai/tools/analyze/))**: Generate tests for a selected component, based on the PR code changes. +‣ **Test 💎 ([`/test`](https://pr-agent-docs.codium.ai/tools/test/))**: Generate tests for a selected component, based on the PR code changes. \ ‣ **Custom Prompt 💎 ([`/custom_prompt`](https://pr-agent-docs.codium.ai/tools/custom_prompt/))**: Automatically generates custom suggestions for improving the PR code, based on specific guidelines defined by the user. \ @@ -153,6 +153,8 @@ ___ ‣ **CI Feedback 💎 ([`/checks ci_job`](https://pr-agent-docs.codium.ai/tools/ci_feedback/))**: Automatically generates feedback and analysis for a failed CI job. \ ‣ **Similar Code 💎 ([`/find_similar_component`](https://pr-agent-docs.codium.ai/tools/similar_code/))**: Retrieves the most similar code components from inside the organization's codebase, or from open-source code. +\ +‣ **Implement 💎 ([`/implement`](https://pr-agent-docs.codium.ai/tools/implement/))**: Generates implementation code from review suggestions. ___ ## Example results From 2d5daf43642d95d7e37add95045235a82c35ed78 Mon Sep 17 00:00:00 2001 From: ofir-frd Date: Thu, 2 Jan 2025 10:34:04 +0200 Subject: [PATCH 5/9] docs: Enhance /implement tool documentation with usage scenarios and examples --- docs/docs/tools/implement.md | 52 +++++++++++++++++++++++++++++------- 1 file changed, 43 insertions(+), 9 deletions(-) diff --git a/docs/docs/tools/implement.md b/docs/docs/tools/implement.md index 529541ab..281003b3 100644 --- a/docs/docs/tools/implement.md +++ b/docs/docs/tools/implement.md @@ -4,19 +4,53 @@ The `implement` tool automatically generates implementation code based on PR rev It combines LLM capabilities with static code analysis to help developers implement code changes quickly and with confidence. -To use the tool, manually invoke it by commenting in any PR discussion that contains code suggestions: -``` -/implement -``` +## Usage Scenarios -## Example usage -Invoke the tool manually by commenting `/implement` on any PR review discussion. -The tool will generate code implementation for the selected discussion: +### 1. For Reviewers + +Reviewers can request code changes by:
+1. Selecting the code block to be modified.
+2. Adding a comment with the syntax: +``` +/implement +``` ![implement1](https://codium.ai/images/pr_agent/implement1.png){width=768} +### 2. For PR Authors + +PR authors can implement suggested changes by replying to a review comment using either:
+1. Add specific implementation details as described above +``` +/implement +``` +2. Use the original review comment as instructions +``` +/implement +``` + +![implement2](https://codium.ai/images/pr_agent/implement2.png){width=768} + + +### 3. For Referencing Comments + +You can reference and implement changes from any comment by: +``` +/implement +``` + +![implement3](https://codium.ai/images/pr_agent/implement3.png){width=768} + +Note that the implementation will occur within the review discussion thread. +Invoke the tool manually by commenting `/implement` on any PR review discussion. + + +**Configuration options**
+- Use `/implement` to implement code change within and based on the review discussion.
+- Use `/implement ` inside a review discussion to implement specific instructions.
+- Use `/implement ` to indirectly call the tool from any comment.
+ **Notes**
-- Languages that are currently supported by the tool: Python, Java, C++, JavaScript, TypeScript, C#.
-- Use `/implement ` to indirectly call the tool. \ No newline at end of file +- Languages that are currently supported by the tool: Python, Java, C++, JavaScript, TypeScript, C#. From 4c82b8a43eb294954cb78704abae81feb078ac91 Mon Sep 17 00:00:00 2001 From: ofir-frd Date: Thu, 2 Jan 2025 10:44:50 +0200 Subject: [PATCH 6/9] docs: Add /implement tool to feature tables and documentation links --- docs/docs/index.md | 1 + docs/docs/overview/index.md | 6 ++++-- docs/docs/overview/pr_agent_pro.md | 15 ++++++++------- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/docs/docs/index.md b/docs/docs/index.md index 74b1e68f..61799c9b 100644 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -44,6 +44,7 @@ Qodo Merge offers extensive pull request functionalities across various git prov | | [Similar Code](https://pr-agent-docs.codium.ai/tools/similar_code/) 💎 | ✅ | | | | | | [Custom Prompt](https://pr-agent-docs.codium.ai/tools/custom_prompt/) 💎 | ✅ | ✅ | ✅ | | | | [Test](https://pr-agent-docs.codium.ai/tools/test/) 💎 | ✅ | ✅ | | | +| | [Implement](https://pr-agent-docs.codium.ai/tools/implement/) 💎 | ✅ | | | | | | | | | | | | USAGE | [CLI](https://qodo-merge-docs.qodo.ai/usage-guide/automations_and_usage/#local-repo-cli) | ✅ | ✅ | ✅ | ✅ | | | [App / webhook](https://qodo-merge-docs.qodo.ai/usage-guide/automations_and_usage/#github-app) | ✅ | ✅ | ✅ | ✅ | diff --git a/docs/docs/overview/index.md b/docs/docs/overview/index.md index 2856cc1e..79317dae 100644 --- a/docs/docs/overview/index.md +++ b/docs/docs/overview/index.md @@ -41,6 +41,8 @@ Qodo Merge offers extensive pull request functionalities across various git prov | | [Add PR Documentation](./tools/documentation.md){:target="_blank"} 💎 | ✅ | ✅ | | ✅ | | | [Generate Custom Labels](./tools/describe.md#handle-custom-labels-from-the-repos-labels-page-💎){:target="_blank"} 💎 | ✅ | ✅ | | ✅ | | | [Analyze PR Components](./tools/analyze.md){:target="_blank"} 💎 | ✅ | ✅ | | ✅ | +| | [Test](https://pr-agent-docs.codium.ai/tools/test/) 💎 | ✅ | ✅ | | | +| | [Implement](https://pr-agent-docs.codium.ai/tools/implement/) 💎 | ✅ | | | | | | | | | | ️ | | USAGE | CLI | ✅ | ✅ | ✅ | ✅ | | | App / webhook | ✅ | ✅ | ✅ | ✅ | @@ -51,8 +53,8 @@ Qodo Merge offers extensive pull request functionalities across various git prov | | Adaptive and token-aware file patch fitting | ✅ | ✅ | ✅ | ✅ | | | Multiple models support | ✅ | ✅ | ✅ | ✅ | | | Incremental PR review | ✅ | | | | -| | [Static code analysis](./tools/analyze.md/){:target="_blank"} 💎 | ✅ | ✅ | ✅ | ✅ | -| | [Multiple configuration options](./usage-guide/configuration_options.md){:target="_blank"} 💎 | ✅ | ✅ | ✅ | ✅ | +| | [Static code analysis](./tools/analyze.md/){:target="_blank"} 💎 | ✅ | ✅ | ✅ | ✅ | +| | [Multiple configuration options](./usage-guide/configuration_options.md){:target="_blank"} 💎 | ✅ | ✅ | ✅ | ✅ | 💎 marks a feature available only in [Qodo Merge Pro](https://www.codium.ai/pricing/){:target="_blank"} diff --git a/docs/docs/overview/pr_agent_pro.md b/docs/docs/overview/pr_agent_pro.md index f6ca393e..5884d204 100644 --- a/docs/docs/overview/pr_agent_pro.md +++ b/docs/docs/overview/pr_agent_pro.md @@ -33,14 +33,15 @@ Here are some of the additional features and capabilities that Qodo Merge Pro of Here are additional tools that are available only for Qodo Merge Pro users: -| Feature | Description | -|---------|-------------| +| Feature | Description | +|---------------------------------------------------------------------------------------|-------------| | [**Custom Prompt Suggestions**](https://qodo-merge-docs.qodo.ai/tools/custom_prompt/) | Generate code suggestions based on custom prompts from the user | -| [**Analyze PR components**](https://qodo-merge-docs.qodo.ai/tools/analyze/) | Identify the components that changed in the PR, and enable to interactively apply different tools to them | -| [**Tests**](https://qodo-merge-docs.qodo.ai/tools/test/) | Generate tests for code components that changed in the PR | -| [**PR documentation**](https://qodo-merge-docs.qodo.ai/tools/documentation/) | Generate docstring for code components that changed in the PR | -| [**Improve Component**](https://qodo-merge-docs.qodo.ai/tools/improve_component/) | Generate code suggestions for code components that changed in the PR | -| [**Similar code search**](https://qodo-merge-docs.qodo.ai/tools/similar_code/) | Search for similar code in the repository, organization, or entire GitHub | +| [**Analyze PR components**](https://qodo-merge-docs.qodo.ai/tools/analyze/) | Identify the components that changed in the PR, and enable to interactively apply different tools to them | +| [**Tests**](https://qodo-merge-docs.qodo.ai/tools/test/) | Generate tests for code components that changed in the PR | +| [**PR documentation**](https://qodo-merge-docs.qodo.ai/tools/documentation/) | Generate docstring for code components that changed in the PR | +| [**Improve Component**](https://qodo-merge-docs.qodo.ai/tools/improve_component/) | Generate code suggestions for code components that changed in the PR | +| [**Similar code search**](https://qodo-merge-docs.qodo.ai/tools/similar_code/) | Search for similar code in the repository, organization, or entire GitHub | +| [**Code implementation**](https://qodo-merge-docs.qodo.ai/tools/implement/) | Generates implementation code from review suggestions | ### Supported languages From 56e15c03486e02a7d0a86cb6675e6b1246c99aac Mon Sep 17 00:00:00 2001 From: ofir-frd Date: Thu, 2 Jan 2025 10:47:28 +0200 Subject: [PATCH 7/9] Add a blank line at the end of the .gitignore file --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e3bf85c3..d67e5669 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,4 @@ dist/ build/ .DS_Store docs/.cache/ -.qodo \ No newline at end of file +.qodo From efc621a58b6316ef2aca4ebb5fff27f657a8239b Mon Sep 17 00:00:00 2001 From: ofir-frd Date: Thu, 2 Jan 2025 10:55:30 +0200 Subject: [PATCH 8/9] fix: update Test tool link to correct documentation file --- docs/docs/tools/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/tools/index.md b/docs/docs/tools/index.md index 3cb46356..4736f62c 100644 --- a/docs/docs/tools/index.md +++ b/docs/docs/tools/index.md @@ -14,7 +14,7 @@ Here is a list of Qodo Merge tools, each with a dedicated page that explains how | **💎 [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| -| **💎 [Test (`/test`](./implement.md))** | generate tests for a selected component, based on the PR code changes | +| **💎 [Test (`/test`](./test.md))** | generate tests for a selected component, based on the PR code changes | | **💎 [Custom Prompt (`/custom_prompt`](./custom_prompt.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 | From 71e477a993d341ac42daba3356f4ca3e28c0168c Mon Sep 17 00:00:00 2001 From: ofir-frd Date: Thu, 2 Jan 2025 11:02:26 +0200 Subject: [PATCH 9/9] docs: standardize language support notes across documentation files --- docs/docs/tools/implement.md | 2 +- docs/docs/tools/test.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/docs/tools/implement.md b/docs/docs/tools/implement.md index 281003b3..a3e24d26 100644 --- a/docs/docs/tools/implement.md +++ b/docs/docs/tools/implement.md @@ -53,4 +53,4 @@ Invoke the tool manually by commenting `/implement` on any PR review discussion. - Use `/implement ` to indirectly call the tool from any comment.
**Notes**
-- Languages that are currently supported by the tool: Python, Java, C++, JavaScript, TypeScript, C#. +- The following languages are currently supported: Python, Java, C++, JavaScript, TypeScript, C#. diff --git a/docs/docs/tools/test.md b/docs/docs/tools/test.md index b37fbd97..fa5c533e 100644 --- a/docs/docs/tools/test.md +++ b/docs/docs/tools/test.md @@ -17,8 +17,8 @@ The tool will generate tests for the selected component (if no component is stat (Example taken from [here](https://github.com/Codium-ai/pr-agent/pull/598#issuecomment-1913679429)): -**Notes** -- Languages that are currently supported by the tool: Python, Java, C++, JavaScript, TypeScript, C#. +**Notes**
+- The following languages are currently supported: Python, Java, C++, JavaScript, TypeScript, C#.
- This tool can also be triggered interactively by using the [`analyze`](./analyze.md) tool.