mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-04 21:00:40 +08:00
Remove functionality and references to 'remove_previous_review_comment' option
This commit is contained in:
8
Usage.md
8
Usage.md
@ -212,14 +212,10 @@ 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 -i --pr_reviewer.remove_previous_review_comment=true",
|
"/review --pr_reviewer.num_code_suggestions=0",
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
This means that when new code is pushed to the PR, the PR-Agent will run the `describe` and incremental `review` tools.
|
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.
|
||||||
For the `describe` tool, the `add_original_user_description` and `keep_original_user_title` parameters will be set to true.
|
|
||||||
For the `review` tool, it will run in incremental mode, and the `remove_previous_review_comment` parameter will be set to true.
|
|
||||||
|
|
||||||
Much like the configurations for `pr_commands`, you can override the default tool parameters by uploading a local configuration file to the root of your repo.
|
|
||||||
|
|
||||||
### Working with GitHub Action
|
### Working with GitHub Action
|
||||||
`GitHub Action` is a different way to trigger PR-Agent tools, and uses a different configuration mechanism than `GitHub App`.
|
`GitHub Action` is a different way to trigger PR-Agent tools, and uses a different configuration mechanism than `GitHub App`.
|
||||||
|
@ -77,7 +77,6 @@ For example, if `minimal_commits_for_incremental_review=2` and `minimal_minutes_
|
|||||||
When `require_all_thresholds_for_incremental_review=true` the incremental review __will not__ run, because only 1 out of 2 conditions were met (we have enough commits but the last review is too recent),
|
When `require_all_thresholds_for_incremental_review=true` the incremental review __will not__ run, because only 1 out of 2 conditions were met (we have enough commits but the last review is too recent),
|
||||||
but when `require_all_thresholds_for_incremental_review=false` the incremental review __will__ run, because one condition is enough (we have 3 commits which is more than the configured 2).
|
but when `require_all_thresholds_for_incremental_review=false` the incremental review __will__ run, because one condition is enough (we have 3 commits which is more than the configured 2).
|
||||||
Default is false - the tool will run as long as at least once conditions is met.
|
Default is false - the tool will run as long as at least once conditions is met.
|
||||||
- `remove_previous_review_comment`: if set to true, the tool will remove the previous review comment before adding a new one. Default is false.
|
|
||||||
|
|
||||||
### PR Reflection
|
### PR Reflection
|
||||||
By invoking:
|
By invoking:
|
||||||
|
@ -34,7 +34,6 @@ num_code_suggestions=4
|
|||||||
inline_code_comments = false
|
inline_code_comments = false
|
||||||
ask_and_reflect=false
|
ask_and_reflect=false
|
||||||
#automatic_review=true
|
#automatic_review=true
|
||||||
remove_previous_review_comment=false
|
|
||||||
persistent_comment=true
|
persistent_comment=true
|
||||||
extra_instructions = ""
|
extra_instructions = ""
|
||||||
# review labels
|
# review labels
|
||||||
|
@ -119,8 +119,6 @@ class PRReviewer:
|
|||||||
get_logger().debug(f"PR output", artifact=pr_review)
|
get_logger().debug(f"PR output", artifact=pr_review)
|
||||||
|
|
||||||
if get_settings().config.publish_output:
|
if get_settings().config.publish_output:
|
||||||
previous_review_comment = self._get_previous_review_comment()
|
|
||||||
|
|
||||||
# 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:
|
||||||
self.git_provider.publish_persistent_comment(pr_review,
|
self.git_provider.publish_persistent_comment(pr_review,
|
||||||
@ -130,8 +128,6 @@ class PRReviewer:
|
|||||||
self.git_provider.publish_comment(pr_review)
|
self.git_provider.publish_comment(pr_review)
|
||||||
|
|
||||||
self.git_provider.remove_initial_comment()
|
self.git_provider.remove_initial_comment()
|
||||||
if previous_review_comment:
|
|
||||||
self._remove_previous_review_comment(previous_review_comment)
|
|
||||||
if get_settings().pr_reviewer.inline_code_comments:
|
if get_settings().pr_reviewer.inline_code_comments:
|
||||||
self._publish_inline_code_comments()
|
self._publish_inline_code_comments()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@ -295,7 +291,7 @@ class PRReviewer:
|
|||||||
Get the previous review comment if it exists.
|
Get the previous review comment if it exists.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
if get_settings().pr_reviewer.remove_previous_review_comment and hasattr(self.git_provider, "get_previous_review"):
|
if hasattr(self.git_provider, "get_previous_review"):
|
||||||
return self.git_provider.get_previous_review(
|
return self.git_provider.get_previous_review(
|
||||||
full=not self.incremental.is_incremental,
|
full=not self.incremental.is_incremental,
|
||||||
incremental=self.incremental.is_incremental,
|
incremental=self.incremental.is_incremental,
|
||||||
@ -308,7 +304,7 @@ class PRReviewer:
|
|||||||
Remove the previous review comment if it exists.
|
Remove the previous review comment if it exists.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
if get_settings().pr_reviewer.remove_previous_review_comment and comment:
|
if comment:
|
||||||
self.git_provider.remove_comment(comment)
|
self.git_provider.remove_comment(comment)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
get_logger().exception(f"Failed to remove previous review comment, error: {e}")
|
get_logger().exception(f"Failed to remove previous review comment, error: {e}")
|
||||||
|
Reference in New Issue
Block a user