mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-10 15:50:37 +08:00
Compare commits
8 Commits
v0.29
...
hl/flip_2_
Author | SHA1 | Date | |
---|---|---|---|
ad121f8a50 | |||
2c397c28e5 | |||
6c5d434dcd | |||
eb37038785 | |||
f6b5470a96 | |||
f123a6e069 | |||
24240b168b | |||
416c4cbf52 |
@ -49,7 +49,7 @@ publish_labels = ...
|
|||||||
|
|
||||||
!!! example "Possible configurations"
|
!!! example "Possible configurations"
|
||||||
|
|
||||||
- `publish_labels`: if set to true, the tool will publish the labels to the PR. Default is true.
|
- `disable_publish_labels`: if set to true, the tool will not publish the labels to the PR. Default is false.
|
||||||
|
|
||||||
- `publish_description_as_comment`: if set to true, the tool will publish the description as a comment to the PR. If false, it will overwrite the original description. Default is false.
|
- `publish_description_as_comment`: if set to true, the tool will publish the description as a comment to the PR. If false, it will overwrite the original description. Default is false.
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ publish_labels = ...
|
|||||||
|
|
||||||
- `add_original_user_description`: if set to true, the tool will add the original user description to the generated description. Default is true.
|
- `add_original_user_description`: if set to true, the tool will add the original user description to the generated description. Default is true.
|
||||||
|
|
||||||
- `keep_original_user_title`: if set to true, the tool will keep the original PR title, and won't change it. Default is true.
|
- `generate_ai_title`: if set to true, the tool will automatically generate a title for the PR. If false, it will keep the original title. Default is false.
|
||||||
|
|
||||||
- `extra_instructions`: Optional extra instructions to the tool. For example: "focus on the changes in the file X. Ignore change in ...".
|
- `extra_instructions`: Optional extra instructions to the tool. For example: "focus on the changes in the file X. Ignore change in ...".
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ publish_labels = ...
|
|||||||
|
|
||||||
- `enable_pr_type`: if set to false, it will not show the `PR type` as a text value in the description content. Default is true.
|
- `enable_pr_type`: if set to false, it will not show the `PR type` as a text value in the description content. Default is true.
|
||||||
|
|
||||||
- `final_update_message`: if set to true, it will add a comment message [`PR Description updated to latest commit...`](https://github.com/Codium-ai/pr-agent/pull/499#issuecomment-1837412176) after finishing calling `/describe`. Default is true.
|
- `disable_final_update_message`: if set to true, the tool will skip adding a comment message [`PR Description updated to latest commit...`](https://github.com/Codium-ai/pr-agent/pull/499#issuecomment-1837412176) after finishing calling `/describe`. Default is false.
|
||||||
|
|
||||||
- `enable_semantic_files_types`: if set to true, "Changes walkthrough" section will be generated. Default is true.
|
- `enable_semantic_files_types`: if set to true, "Changes walkthrough" section will be generated. Default is true.
|
||||||
- `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".
|
- `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".
|
||||||
|
@ -62,7 +62,7 @@ The configuration parameter `pr_commands` defines the list of tools that will be
|
|||||||
```
|
```
|
||||||
[github_app]
|
[github_app]
|
||||||
pr_commands = [
|
pr_commands = [
|
||||||
"/describe --pr_description.add_original_user_description=true --pr_description.keep_original_user_title=true --pr_description.final_update_message=false",
|
"/describe --pr_description.add_original_user_description=true --pr_description.keep_original_user_title=true --pr_description.disable_final_update_message=true",
|
||||||
"/review --pr_reviewer.num_code_suggestions=0",
|
"/review --pr_reviewer.num_code_suggestions=0",
|
||||||
"/improve",
|
"/improve",
|
||||||
]
|
]
|
||||||
@ -103,7 +103,7 @@ The configuration parameter `push_commands` defines the list of tools that will
|
|||||||
handle_push_trigger = true
|
handle_push_trigger = true
|
||||||
push_commands = [
|
push_commands = [
|
||||||
"/describe --pr_description.add_original_user_description=true --pr_description.keep_original_user_title=true",
|
"/describe --pr_description.add_original_user_description=true --pr_description.keep_original_user_title=true",
|
||||||
"/review --pr_reviewer.num_code_suggestions=0 --pr_reviewer.final_update_message=false",
|
"/review --pr_reviewer.num_code_suggestions=0 --pr_reviewer.disable_final_update_message=true",
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
This means that when new code is pushed to the PR, the PR-Agent will run the `describe` and `review` tools, with the specified parameters.
|
This means that when new code is pushed to the PR, the PR-Agent will run the `describe` and `review` tools, with the specified parameters.
|
||||||
|
@ -229,7 +229,7 @@ class GithubProvider(GitProvider):
|
|||||||
self.publish_comment(pr_comment)
|
self.publish_comment(pr_comment)
|
||||||
|
|
||||||
def publish_comment(self, pr_comment: str, is_temporary: bool = False):
|
def publish_comment(self, pr_comment: str, is_temporary: bool = False):
|
||||||
if is_temporary and not get_settings().config.publish_output_progress:
|
if is_temporary or not get_settings().config.publish_output_progress:
|
||||||
get_logger().debug(f"Skipping publish_comment for temporary comment: {pr_comment}")
|
get_logger().debug(f"Skipping publish_comment for temporary comment: {pr_comment}")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ ask_and_reflect=false
|
|||||||
#automatic_review=true
|
#automatic_review=true
|
||||||
persistent_comment=true
|
persistent_comment=true
|
||||||
extra_instructions = ""
|
extra_instructions = ""
|
||||||
final_update_message = true
|
disable_final_update_message = false
|
||||||
# review labels
|
# review labels
|
||||||
enable_review_labels_security=true
|
enable_review_labels_security=true
|
||||||
enable_review_labels_effort=true
|
enable_review_labels_effort=true
|
||||||
@ -51,13 +51,13 @@ maximal_review_effort=5
|
|||||||
|
|
||||||
|
|
||||||
[pr_description] # /describe #
|
[pr_description] # /describe #
|
||||||
publish_labels=true
|
disable_publish_labels=false
|
||||||
add_original_user_description=true
|
add_original_user_description=true
|
||||||
keep_original_user_title=true
|
generate_ai_title=false
|
||||||
use_bullet_points=true
|
use_bullet_points=true
|
||||||
extra_instructions = ""
|
extra_instructions = ""
|
||||||
enable_pr_type=true
|
enable_pr_type=true
|
||||||
final_update_message = true
|
disable_final_update_message = false
|
||||||
enable_help_text=false
|
enable_help_text=false
|
||||||
enable_help_comment=true
|
enable_help_comment=true
|
||||||
# describe as comment
|
# describe as comment
|
||||||
|
@ -95,7 +95,10 @@ class PRDescription:
|
|||||||
self.file_label_dict = self._prepare_file_labels()
|
self.file_label_dict = self._prepare_file_labels()
|
||||||
|
|
||||||
pr_labels, pr_file_changes = [], []
|
pr_labels, pr_file_changes = [], []
|
||||||
if get_settings().pr_description.publish_labels:
|
# backward compatibility support
|
||||||
|
publish_label = get_settings().pr_reviewer.get("publish_labels", True) \
|
||||||
|
and not get_settings().pr_description.disable_publish_labels
|
||||||
|
if publish_label:
|
||||||
pr_labels = self._prepare_labels()
|
pr_labels = self._prepare_labels()
|
||||||
|
|
||||||
if get_settings().pr_description.use_description_markers:
|
if get_settings().pr_description.use_description_markers:
|
||||||
@ -118,7 +121,7 @@ class PRDescription:
|
|||||||
|
|
||||||
if get_settings().config.publish_output:
|
if get_settings().config.publish_output:
|
||||||
# publish labels
|
# publish labels
|
||||||
if get_settings().pr_description.publish_labels and self.git_provider.is_supported("get_labels"):
|
if publish_label and self.git_provider.is_supported("get_labels"):
|
||||||
original_labels = self.git_provider.get_pr_labels(update=True)
|
original_labels = self.git_provider.get_pr_labels(update=True)
|
||||||
get_logger().debug(f"original labels", artifact=original_labels)
|
get_logger().debug(f"original labels", artifact=original_labels)
|
||||||
user_labels = get_user_labels(original_labels)
|
user_labels = get_user_labels(original_labels)
|
||||||
@ -143,8 +146,10 @@ class PRDescription:
|
|||||||
else:
|
else:
|
||||||
self.git_provider.publish_description(pr_title, pr_body)
|
self.git_provider.publish_description(pr_title, pr_body)
|
||||||
|
|
||||||
# publish final update message
|
# publish final update message - with backward compatibility support
|
||||||
if (get_settings().pr_description.final_update_message):
|
publish_update_message = get_settings().pr_reviewer.get("final_update_message", True)\
|
||||||
|
and not get_settings().pr_description.disable_final_update_message
|
||||||
|
if (publish_update_message):
|
||||||
latest_commit_url = self.git_provider.get_latest_commit_url()
|
latest_commit_url = self.git_provider.get_latest_commit_url()
|
||||||
if latest_commit_url:
|
if latest_commit_url:
|
||||||
pr_url = self.git_provider.get_pr_url()
|
pr_url = self.git_provider.get_pr_url()
|
||||||
@ -301,7 +306,10 @@ class PRDescription:
|
|||||||
|
|
||||||
# Remove the 'PR Title' key from the dictionary
|
# Remove the 'PR Title' key from the dictionary
|
||||||
ai_title = self.data.pop('title', self.vars["title"])
|
ai_title = self.data.pop('title', self.vars["title"])
|
||||||
if get_settings().pr_description.keep_original_user_title:
|
# get config - with backward compatibility
|
||||||
|
keep_user_title = get_settings().pr_reviewer.get("keep_original_user_title", True) \
|
||||||
|
and not get_settings().pr_description.generate_ai_title
|
||||||
|
if keep_user_title:
|
||||||
# Assign the original PR title to the 'title' variable
|
# Assign the original PR title to the 'title' variable
|
||||||
title = self.vars["title"]
|
title = self.vars["title"]
|
||||||
else:
|
else:
|
||||||
|
@ -135,7 +135,9 @@ class PRReviewer:
|
|||||||
if get_settings().config.publish_output:
|
if get_settings().config.publish_output:
|
||||||
# publish the review
|
# publish the review
|
||||||
if get_settings().pr_reviewer.persistent_comment and not self.incremental.is_incremental:
|
if get_settings().pr_reviewer.persistent_comment and not self.incremental.is_incremental:
|
||||||
final_update_message = get_settings().pr_reviewer.final_update_message
|
# get config with backward compatibility
|
||||||
|
final_update_message = get_settings().pr_reviewer.get("final_update_message", True)\
|
||||||
|
and not get_settings().pr_reviewer.disable_final_update_message
|
||||||
self.git_provider.publish_persistent_comment(pr_review,
|
self.git_provider.publish_persistent_comment(pr_review,
|
||||||
initial_header="## PR Review",
|
initial_header="## PR Review",
|
||||||
update_header=True,
|
update_header=True,
|
||||||
|
Reference in New Issue
Block a user