From 8d513e078a6ba2fe1e453c60c9e0d2943cdc72e5 Mon Sep 17 00:00:00 2001 From: "Hussam.lawen" Date: Sun, 21 Jan 2024 13:43:37 +0200 Subject: [PATCH 01/11] Add changes title of files and improve table style and alignments --- pr_agent/settings/pr_description_prompts.toml | 5 +- pr_agent/tools/pr_description.py | 71 +++++++++++++------ 2 files changed, 53 insertions(+), 23 deletions(-) diff --git a/pr_agent/settings/pr_description_prompts.toml b/pr_agent/settings/pr_description_prompts.toml index 09d1c6e4..b9c5ce39 100644 --- a/pr_agent/settings/pr_description_prompts.toml +++ b/pr_agent/settings/pr_description_prompts.toml @@ -39,7 +39,8 @@ class PRType(str, Enum): Class FileDescription(BaseModel): filename: str = Field(description="the relevant file full path") - changes_summary: str = Field(description="minimal and concise summary of the changes in the relevant file") + changes_summary: str = Field(description="concise summary of the changes in the relevant file, in bullet points (1-4 bullet points).") + changes_title: str = Field(description="an informative title for the changes in the files, describing its main theme (5-10 words).") label: str = Field(description="a single semantic label that represents a type of code changes that occurred in the File. Possible values (partial list): 'bug fix', 'tests', 'enhancement', 'documentation', 'error handling', 'configuration changes', 'dependencies', 'formatting', 'miscellaneous', ...") {%- endif %} @@ -68,6 +69,8 @@ pr_files: ... changes_summary: | ... + changes_title: | + ... label: | ... ... diff --git a/pr_agent/tools/pr_description.py b/pr_agent/tools/pr_description.py index e3ec92ff..0cc32b7f 100644 --- a/pr_agent/tools/pr_description.py +++ b/pr_agent/tools/pr_description.py @@ -333,10 +333,11 @@ class PRDescription: try: filename = file['filename'].replace("'", "`").replace('"', '`') changes_summary = file['changes_summary'] + changes_title = file['changes_title'].strip() label = file.get('label') if label not in self.file_label_dict: self.file_label_dict[label] = [] - self.file_label_dict[label].append((filename, changes_summary)) + self.file_label_dict[label].append((filename, changes_title, changes_summary)) except Exception as e: get_logger().error(f"Error preparing file label dict {self.pr_id}: {e}") pass @@ -357,9 +358,9 @@ class PRDescription: try: pr_body += "" header = f"Relevant files" - delta = 65 - header += "  " * delta - pr_body += f"""""" + delta = 77 + # header += "  " * delta + pr_body += f"""""" pr_body += """""" for semantic_label in value.keys(): s_label = semantic_label.strip("'").strip('"') @@ -370,19 +371,24 @@ class PRDescription: pr_body += f"""
{header}
{header}
{len(list_tuples)} files""" else: pr_body += f"""
""" - for filename, file_change_description in list_tuples: + for filename, file_changes_title, file_change_description in list_tuples: filename = filename.replace("'", "`") filename_publish = filename.split("/")[-1] - filename_publish = f"{filename_publish}" - if len(filename_publish) < (delta - 5): - filename_publish += "  " * ((delta - 5) - len(filename_publish)) + file_changes_title_br = insert_br_after_x_chars(file_changes_title, x=(delta - 5), + new_line_char="\n\n") + file_changes_title_extended = file_changes_title_br.strip() + "" + if len(file_changes_title_extended) < (delta - 5): + file_changes_title_extended += "  " * ((delta - 5) - len(file_changes_title_extended)) + filename_publish = f"{filename_publish}
{file_changes_title_extended}
" diff_plus_minus = "" + delta_nbsp = "" diff_files = self.git_provider.diff_files for f in diff_files: if f.filename.lower() == filename.lower(): num_plus_lines = f.num_plus_lines num_minus_lines = f.num_minus_lines diff_plus_minus += f"+{num_plus_lines}/-{num_minus_lines}" + delta_nbsp = "  " * max(0, (8 - len(diff_plus_minus))) break # try to add line numbers link to code suggestions @@ -391,21 +397,19 @@ class PRDescription: filename = filename.strip() link = self.git_provider.get_line_link(filename, relevant_line_start=-1) - file_change_description = insert_br_after_x_chars(file_change_description, x=(delta - 5)) + file_change_description_br = insert_br_after_x_chars(file_change_description, x=(delta - 5)) pr_body += f""" - - + """ if use_collapsible_file_list: @@ -419,25 +423,48 @@ class PRDescription: pass return pr_body -def insert_br_after_x_chars(text, x=70): +def insert_br_after_x_chars(text, x=70, new_line_char="
"): """ Insert
into a string after a word that increases its length above x characters. """ if len(text) < x: return text - words = text.split(' ') + lines = text.splitlines() + words = [] + for i,line in enumerate(lines): + words += line.split(' ') + if i x: - new_text += "
" # Insert line break - current_length = 0 # Reset counter + if not is_inside_code: + new_text += f"{new_line_char} " # Insert line break + current_length = 0 # Reset counter + else: + new_text += f"`{new_line_char} `" + # check if inside tag + if word.startswith("`") and not is_inside_code and not word.endswith("`"): + is_inside_code = True + if word.endswith("`"): + is_inside_code = False # Add the word to the new text - new_text += word + " " + if word.endswith("\n"): + new_text += word + else: + new_text += word + " " current_length += len(word) + 1 # Add 1 for the space + + if word.endswith("\n"): + current_length = 0 return new_text.strip() # Remove trailing space From e79919b5c6f87a28aa264891689c8feb06e66f6d Mon Sep 17 00:00:00 2001 From: "Hussam.lawen" Date: Sun, 21 Jan 2024 14:09:17 +0200 Subject: [PATCH 02/11] update describe screenshot to the new describe --- README.md | 2 +- docs/DESCRIBE.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b6c95af2..ea176ffb 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ See the [Tools Guide](./docs/TOOLS_GUIDE.md) for a detailed description of the d

/describe

- +


diff --git a/docs/DESCRIBE.md b/docs/DESCRIBE.md index f6c7041f..289fbc86 100644 --- a/docs/DESCRIBE.md +++ b/docs/DESCRIBE.md @@ -20,7 +20,7 @@ For example: ___ ___ - + ___ ### Configuration options From 329f7fa9d64b96b13d2a82853253ba6dccfd9645 Mon Sep 17 00:00:00 2001 From: mrT23 Date: Sun, 21 Jan 2024 17:06:25 +0200 Subject: [PATCH 03/11] feat: Add custom suggestions tool to README.md --- README.md | 8 ++--- docs/CUSTOM_SUGGESTIONS.md | 62 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 5 deletions(-) create mode 100644 docs/CUSTOM_SUGGESTIONS.md diff --git a/README.md b/README.md index b6c95af2..e95bdab1 100644 --- a/README.md +++ b/README.md @@ -32,11 +32,8 @@ Making pull requests less painful with an AI agent - [Why use PR-Agent?](#why-use-pr-agent) ## News and Updates -### Jan 18, 2024 -We are very happy to share our new paper: -**"Code Generation with AlphaCodium: From Prompt Engineering to Flow Engineering".** - -Go checkout our official implementation [here](https://github.com/Codium-ai/AlphaCodium) +### Jan 21, 2024 +- 💎 Custom suggestions - A new tool, `/custom_suggestions`, was added to PR-Agent Pro. The tool will only propose suggestion that follow specific guidelines defined by a prompt given by the user. See [here](https://github.com/Codium-ai/pr-agent/blob/main/docs/CUSTOM_SUGGESTIONS.md) for more details. ### Jan 17, 2024 - 💎 Inline file summary - The `describe` tool has a new option `--pr_description.inline_file_summary`, which allows to add a summary of each file changes to the Diffview page. See [here](https://github.com/Codium-ai/pr-agent/blob/main/docs/DESCRIBE.md#inline-file-summary-) @@ -164,6 +161,7 @@ See the [Tools Guide](./docs/TOOLS_GUIDE.md) for a detailed description of the d | | ⮑ [Inline file summary](https://github.com/Codium-ai/pr-agent/blob/main/docs/DESCRIBE.md#inline-file-summary-) 💎 | :white_check_mark: | :white_check_mark: | :white_check_mark: | | | Improve | :white_check_mark: | :white_check_mark: | :white_check_mark: | | | ⮑ Extended | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| | [Custom_suggestions](https://github.com/Codium-ai/pr-agent/blob/main/docs/CUSTOM_SUGGESTIONS.md) | :white_check_mark: | :white_check_mark: | :white_check_mark: | | | Reflect and Review | :white_check_mark: | :white_check_mark: | :white_check_mark: | | | Update CHANGELOG.md | :white_check_mark: | :white_check_mark: | :white_check_mark: | | | Find Similar Issue | :white_check_mark: | | | diff --git a/docs/CUSTOM_SUGGESTIONS.md b/docs/CUSTOM_SUGGESTIONS.md new file mode 100644 index 00000000..6b2f6403 --- /dev/null +++ b/docs/CUSTOM_SUGGESTIONS.md @@ -0,0 +1,62 @@ +# Custom Suggestions Tool + +## Table of Contents +- [Overview](#overview) +- [Example usage](#example-usage) +- [Configuration options](#configuration-options) + + +## Overview +The `custom_suggestions` tool scans the PR code changes, and automatically generates custom suggestions for improving the PR code. +It shares similarities with the `imrpove` tool, but with one main difference: the `custom_suggestions` tool will only propose suggestion that follow specific guidelines defined by the prompt in: `pr_custom_suggestions.prompt` configuration. + +The tool can be triggered [automatically](https://github.com/Codium-ai/pr-agent/blob/main/Usage.md#github-app-automatic-tools) every time a new PR is opened, or can be invoked manually by commenting on a PR. + +When commenting, use the following template: + +``` +/custom_suggestions --pr_custom_suggestions.prompt="The suggestions should focus only on the following:\n-...\n-...\n-..." +``` + +With a [configuration file](https://github.com/Codium-ai/pr-agent/blob/main/Usage.md#working-with-github-app), use the following template: + +``` +[pr_custom_suggestions] +prompt="""\ +The suggestions should focus only on the following: +-... +-... +-... +""" +``` +Using a configuration file is recommended, since it allows to use multi-line instructions. + +Don't forget - with this tool, you are the prompter. Be specific, clear, and concise in the instructions. Specify relevant aspects that you want the model to focus on. \ +You might benefit from several trial-and-error iterations, until you get the correct prompt for your use case. + +## Example usage + +Here is an example for a possible prompt: +``` +[pr_custom_suggestions] +prompt="""\ +The suggestions should focus only on the following: +- look for edge cases when implementing a new function +- make sure every variable has a meaningful name +- make sure the code is efficient +""" +``` + +The instructions above are just an example. We want to emphasize that the prompt should be specific and clear, and be tailored to the needs of your project. + +Results obtained with the prompt above: +___ + +___ + +___ + +## Configuration options +`prompt`: the prompt for the tool. Should be a multi-line string. +`num_code_suggestions`: number of code suggestions provided by the 'custom_suggestions' tool. Default is 4. +`enable_help_text`: if set to true, the tool will display a help text in the comment. Default is true. \ No newline at end of file From 27aafb06cb50b26c2ce5f3119ba11b8c7e932389 Mon Sep 17 00:00:00 2001 From: mrT23 Date: Sun, 21 Jan 2024 17:10:23 +0200 Subject: [PATCH 04/11] feat: Add custom suggestions tool to README.md --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e95bdab1..7e7008d5 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,8 @@ Making pull requests less painful with an AI agent ## News and Updates ### Jan 21, 2024 -- 💎 Custom suggestions - A new tool, `/custom_suggestions`, was added to PR-Agent Pro. The tool will only propose suggestion that follow specific guidelines defined by a prompt given by the user. See [here](https://github.com/Codium-ai/pr-agent/blob/main/docs/CUSTOM_SUGGESTIONS.md) for more details. +- 💎 Custom suggestions - A new tool, `/custom_suggestions`, was added to PR-Agent Pro. The tool will propose only suggestion that follow specific guidelines defined by the user. +See [here](https://github.com/Codium-ai/pr-agent/blob/main/docs/CUSTOM_SUGGESTIONS.md) for more details. ### Jan 17, 2024 - 💎 Inline file summary - The `describe` tool has a new option `--pr_description.inline_file_summary`, which allows to add a summary of each file changes to the Diffview page. See [here](https://github.com/Codium-ai/pr-agent/blob/main/docs/DESCRIBE.md#inline-file-summary-) @@ -72,6 +73,8 @@ CodiumAI PR-Agent is an open-source tool to help efficiently review and handle p ‣ **Generate Custom Labels 💎 ([`/generate_labels`](./docs/GENERATE_CUSTOM_LABELS.md))**: Automatically suggests custom labels based on the PR code changes. \ ‣ **Analyze 💎 ([`/analyze`](./docs/Analyze.md))**: Automatically analyzes the PR, and presents changes walkthrough 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. See the [Installation Guide](./INSTALL.md) for instructions on installing and running the tool on different git platforms. @@ -161,7 +164,7 @@ See the [Tools Guide](./docs/TOOLS_GUIDE.md) for a detailed description of the d | | ⮑ [Inline file summary](https://github.com/Codium-ai/pr-agent/blob/main/docs/DESCRIBE.md#inline-file-summary-) 💎 | :white_check_mark: | :white_check_mark: | :white_check_mark: | | | Improve | :white_check_mark: | :white_check_mark: | :white_check_mark: | | | ⮑ Extended | :white_check_mark: | :white_check_mark: | :white_check_mark: | -| | [Custom_suggestions](https://github.com/Codium-ai/pr-agent/blob/main/docs/CUSTOM_SUGGESTIONS.md) | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| | [Custom Suggestions](https://github.com/Codium-ai/pr-agent/blob/main/docs/CUSTOM_SUGGESTIONS.md) 💎 | :white_check_mark: | :white_check_mark: | :white_check_mark: | | | Reflect and Review | :white_check_mark: | :white_check_mark: | :white_check_mark: | | | Update CHANGELOG.md | :white_check_mark: | :white_check_mark: | :white_check_mark: | | | Find Similar Issue | :white_check_mark: | | | From 78d886459a905abb392077b9e158728c94fd11b5 Mon Sep 17 00:00:00 2001 From: mrT23 Date: Sun, 21 Jan 2024 17:15:34 +0200 Subject: [PATCH 05/11] feat: Add custom suggestions tool to README.md --- docs/CUSTOM_SUGGESTIONS.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/CUSTOM_SUGGESTIONS.md b/docs/CUSTOM_SUGGESTIONS.md index 6b2f6403..e6756b42 100644 --- a/docs/CUSTOM_SUGGESTIONS.md +++ b/docs/CUSTOM_SUGGESTIONS.md @@ -8,7 +8,7 @@ ## Overview The `custom_suggestions` tool scans the PR code changes, and automatically generates custom suggestions for improving the PR code. -It shares similarities with the `imrpove` tool, but with one main difference: the `custom_suggestions` tool will only propose suggestion that follow specific guidelines defined by the prompt in: `pr_custom_suggestions.prompt` configuration. +It shares similarities with the `improve` tool, but with one main difference: the `custom_suggestions` tool will only propose suggestion that follow specific guidelines defined by the prompt in: `pr_custom_suggestions.prompt` configuration. The tool can be triggered [automatically](https://github.com/Codium-ai/pr-agent/blob/main/Usage.md#github-app-automatic-tools) every time a new PR is opened, or can be invoked manually by commenting on a PR. @@ -57,6 +57,9 @@ ___ ___ ## Configuration options + `prompt`: the prompt for the tool. Should be a multi-line string. + `num_code_suggestions`: number of code suggestions provided by the 'custom_suggestions' tool. Default is 4. + `enable_help_text`: if set to true, the tool will display a help text in the comment. Default is true. \ No newline at end of file From cba14ada2ca7e3de8018563b164f35352c43ed39 Mon Sep 17 00:00:00 2001 From: Tal Date: Sun, 21 Jan 2024 17:29:29 +0200 Subject: [PATCH 06/11] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7e7008d5..9f32c4b9 100644 --- a/README.md +++ b/README.md @@ -33,12 +33,12 @@ Making pull requests less painful with an AI agent ## News and Updates ### Jan 21, 2024 -- 💎 Custom suggestions - A new tool, `/custom_suggestions`, was added to PR-Agent Pro. The tool will propose only suggestion that follow specific guidelines defined by the user. +- 💎 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. See [here](https://github.com/Codium-ai/pr-agent/blob/main/docs/CUSTOM_SUGGESTIONS.md) for more details. ### Jan 17, 2024 -- 💎 Inline file summary - The `describe` tool has a new option `--pr_description.inline_file_summary`, which allows to add a summary of each file changes to the Diffview page. See [here](https://github.com/Codium-ai/pr-agent/blob/main/docs/DESCRIBE.md#inline-file-summary-) -- The `improve` tool now can present suggestion in a nice collapsible format, which significantly reduces the PR footprint. See [here](https://github.com/Codium-ai/pr-agent/blob/main/docs/IMPROVE.md#summarized-vs-commitable-code-suggestions) for more details. +- 💎 Inline file summary - The `describe` tool has a new option, `--pr_description.inline_file_summary`, which allows adding a summary of each file change to the Diffview page. See [here](https://github.com/Codium-ai/pr-agent/blob/main/docs/DESCRIBE.md#inline-file-summary-) +- The `improve` tool now can present suggestions in a nice collapsible format, which significantly reduces the PR footprint. See [here](https://github.com/Codium-ai/pr-agent/blob/main/docs/IMPROVE.md#summarized-vs-commitable-code-suggestions) for more details. - To accompany the improved interface of the `improve` tool, we change the [default automation settings](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/settings/configuration.toml#L116) of our GithupApp to: ``` pr_commands = [ @@ -47,7 +47,7 @@ pr_commands = [ "/improve --pr_code_suggestions.summarize=true", ] ``` -meaning that by default, for each PR the `describe`, `review`, and `improve` tools will be triggered automatically, and the `improve` tool will present the suggestions in a single comment. +Meaning that by default, for each PR the `describe`, `review`, and `improve` tools will be triggered automatically, and the `improve` tool will present the suggestions in a single comment. You can of course overwrite these defaults by adding a `.pr_agent.toml` file to your repo. See [here](https://github.com/Codium-ai/pr-agent/blob/main/Usage.md#working-with-github-app). From 7178ddac10bf1ef5bd8cc846537579420d414dc6 Mon Sep 17 00:00:00 2001 From: Tal Date: Sun, 21 Jan 2024 17:31:33 +0200 Subject: [PATCH 07/11] Update CUSTOM_SUGGESTIONS.md --- docs/CUSTOM_SUGGESTIONS.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/CUSTOM_SUGGESTIONS.md b/docs/CUSTOM_SUGGESTIONS.md index e6756b42..c8123d34 100644 --- a/docs/CUSTOM_SUGGESTIONS.md +++ b/docs/CUSTOM_SUGGESTIONS.md @@ -8,7 +8,7 @@ ## Overview The `custom_suggestions` tool scans the PR code changes, and automatically generates custom suggestions for improving the PR code. -It shares similarities with the `improve` tool, but with one main difference: the `custom_suggestions` tool will only propose suggestion that follow specific guidelines defined by the prompt in: `pr_custom_suggestions.prompt` configuration. +It shares similarities with the `improve` tool, but with one main difference: the `custom_suggestions` tool will only propose suggestions that follow specific guidelines defined by the prompt in: `pr_custom_suggestions.prompt` configuration. The tool can be triggered [automatically](https://github.com/Codium-ai/pr-agent/blob/main/Usage.md#github-app-automatic-tools) every time a new PR is opened, or can be invoked manually by commenting on a PR. @@ -36,7 +36,7 @@ You might benefit from several trial-and-error iterations, until you get the cor ## Example usage -Here is an example for a possible prompt: +Here is an example of a possible prompt: ``` [pr_custom_suggestions] prompt="""\ @@ -58,8 +58,8 @@ ___ ## Configuration options -`prompt`: the prompt for the tool. Should be a multi-line string. +`prompt`: the prompt for the tool. It should be a multi-line string. `num_code_suggestions`: number of code suggestions provided by the 'custom_suggestions' tool. Default is 4. -`enable_help_text`: if set to true, the tool will display a help text in the comment. Default is true. \ No newline at end of file +`enable_help_text`: if set to true, the tool will display a help text in the comment. Default is true. From 4a5cff4995bb02ba9b1070bb632058d8f642a731 Mon Sep 17 00:00:00 2001 From: Tal Date: Sun, 21 Jan 2024 17:58:01 +0200 Subject: [PATCH 08/11] Update CUSTOM_SUGGESTIONS.md --- docs/CUSTOM_SUGGESTIONS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CUSTOM_SUGGESTIONS.md b/docs/CUSTOM_SUGGESTIONS.md index c8123d34..1be9dfb4 100644 --- a/docs/CUSTOM_SUGGESTIONS.md +++ b/docs/CUSTOM_SUGGESTIONS.md @@ -1,4 +1,4 @@ -# Custom Suggestions Tool +# Custom Suggestions Tool 💎 ## Table of Contents - [Overview](#overview) From 968684b461f44f397592dcac6f6a3b46d4f3183a Mon Sep 17 00:00:00 2001 From: "Hussam.lawen" Date: Mon, 22 Jan 2024 10:25:34 +0200 Subject: [PATCH 09/11] update default config for inline_file_summary to false --- pr_agent/settings/configuration.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pr_agent/settings/configuration.toml b/pr_agent/settings/configuration.toml index 9e7fed43..66cd48bc 100644 --- a/pr_agent/settings/configuration.toml +++ b/pr_agent/settings/configuration.toml @@ -56,7 +56,7 @@ enable_help_text=true ## changes walkthrough section enable_semantic_files_types=true collapsible_file_list='adaptive' # true, false, 'adaptive' -inline_file_summary=true # Pro feature +inline_file_summary=false # false, true, 'table' # markers use_description_markers=false include_generated_by_header=true From 139bbfc67a0caae8f9cfd52b43c6f35d2b305587 Mon Sep 17 00:00:00 2001 From: "Hussam.lawen" Date: Tue, 23 Jan 2024 17:58:55 +0200 Subject: [PATCH 10/11] update docs and usage guide --- docs/DESCRIBE.md | 9 ++++++--- pr_agent/servers/help.py | 11 +++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/docs/DESCRIBE.md b/docs/DESCRIBE.md index 289fbc86..00526a87 100644 --- a/docs/DESCRIBE.md +++ b/docs/DESCRIBE.md @@ -50,12 +50,15 @@ To edit [configurations](./../pr_agent/settings/configuration.toml#L46) related - `collapsible_file_list`: if set to true, the file list in the "Changes walkthrough" section will be collapsible. If set to "adaptive", the file list will be collapsible only if there are more than 8 files. Default is "adaptive". ### Inline file summary 💎 -To enable inline file summary, set `pr_description.inline_file_summary=true` in the configuration file. +> This feature is available only in PR-Agent Pro -When the feature is enabled, PR-Agent Pro will add a collapsable summary of each file change in the "Files changed" tab. This will enable you to quickly understand the changes in each file, while reviewing the code changes (diff view). - +To enable inline file summary, set `pr_description.inline_file_summary` in the configuration file, possible values are: +- `'table'`: File changes walkthrough table will be displayed on the top of the "Files changed" tab, in addition to the "Conversation" tab. + +- `true`: A collapsable file comment with changes title and a changes summary for each file in the PR. +- `false` (`default`): File changes walkthrough will be added only to the "Conversation" tab. *Note that this feature is currently available only for GitHub. diff --git a/pr_agent/servers/help.py b/pr_agent/servers/help.py index d1759c53..50df7eae 100644 --- a/pr_agent/servers/help.py +++ b/pr_agent/servers/help.py @@ -175,6 +175,17 @@ Make sure to provide proper title, and a detailed and well-phrased description f """ output += "\n\n\n\n" + # Inline File Walkthrough + output += "
- {filename_publish} -
    - {filename}

    + {filename_publish} +
    -**{file_change_description}** -
+{filename} +{file_change_description_br}
{diff_plus_minus}{diff_plus_minus}{delta_nbsp}
Inline File Walkthrough 💎
\n\n" + output += """\ +For enhanced user experience, the `describe` tool can add file summaries directly to the "Files changed" tab in the PR page. +This will enable you to quickly understand the changes in each file, while reviewing the code changes (diffs). + +To enable inline file summary, set `pr_description.inline_file_summary` in the configuration file, possible values are: +- 'table': File changes walkthrough table will be displayed on the top of the "Files changed" tab, in addition to the "Conversation" tab. +- true: A collapsable file comment with changes title and a changes summary for each file in the PR. +- false: File changes walkthrough will be added only to the "Conversation" tab. +""" # extra instructions output += "
Utilizing extra instructions
\n\n" output += '''\ From 60c0371854d09d92057763608a0c01c3b546c8d1 Mon Sep 17 00:00:00 2001 From: "Hussam.lawen" Date: Tue, 23 Jan 2024 18:13:08 +0200 Subject: [PATCH 11/11] highlight options --- pr_agent/servers/help.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pr_agent/servers/help.py b/pr_agent/servers/help.py index 50df7eae..505016c2 100644 --- a/pr_agent/servers/help.py +++ b/pr_agent/servers/help.py @@ -182,9 +182,9 @@ For enhanced user experience, the `describe` tool can add file summaries directl This will enable you to quickly understand the changes in each file, while reviewing the code changes (diffs). To enable inline file summary, set `pr_description.inline_file_summary` in the configuration file, possible values are: -- 'table': File changes walkthrough table will be displayed on the top of the "Files changed" tab, in addition to the "Conversation" tab. -- true: A collapsable file comment with changes title and a changes summary for each file in the PR. -- false: File changes walkthrough will be added only to the "Conversation" tab. +- `'table'`: File changes walkthrough table will be displayed on the top of the "Files changed" tab, in addition to the "Conversation" tab. +- `true`: A collapsable file comment with changes title and a changes summary for each file in the PR. +- `false` (default): File changes walkthrough will be added only to the "Conversation" tab. """ # extra instructions output += "
Utilizing extra instructions
\n\n"