Skip to content

Commit f1bd67b

Browse files
committed
Remove functionality and references to 'remove_previous_review_comment' option
1 parent 5880221 commit f1bd67b

4 files changed

Lines changed: 4 additions & 14 deletions

File tree

Usage.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,14 +212,10 @@ The configuration parameter `push_commands` defines the list of tools that will
212212
handle_push_trigger = true
213213
push_commands = [
214214
"/describe --pr_description.add_original_user_description=true --pr_description.keep_original_user_title=true",
215-
"/review -i --pr_reviewer.remove_previous_review_comment=true",
215+
"/review --pr_reviewer.num_code_suggestions=0",
216216
]
217217
```
218-
This means that when new code is pushed to the PR, the PR-Agent will run the `describe` and incremental `review` tools.
219-
For the `describe` tool, the `add_original_user_description` and `keep_original_user_title` parameters will be set to true.
220-
For the `review` tool, it will run in incremental mode, and the `remove_previous_review_comment` parameter will be set to true.
221-
222-
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.
218+
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.
223219

224220
### Working with GitHub Action
225221
`GitHub Action` is a different way to trigger PR-Agent tools, and uses a different configuration mechanism than `GitHub App`.

docs/REVIEW.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ For example, if `minimal_commits_for_incremental_review=2` and `minimal_minutes_
7777
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),
7878
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).
7979
Default is false - the tool will run as long as at least once conditions is met.
80-
- `remove_previous_review_comment`: if set to true, the tool will remove the previous review comment before adding a new one. Default is false.
8180

8281
### PR Reflection
8382
By invoking:

pr_agent/settings/configuration.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ num_code_suggestions=4
3434
inline_code_comments = false
3535
ask_and_reflect=false
3636
#automatic_review=true
37-
remove_previous_review_comment=false
3837
persistent_comment=true
3938
extra_instructions = ""
4039
# review labels

pr_agent/tools/pr_reviewer.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,6 @@ async def run(self) -> None:
119119
get_logger().debug(f"PR output", artifact=pr_review)
120120

121121
if get_settings().config.publish_output:
122-
previous_review_comment = self._get_previous_review_comment()
123-
124122
# publish the review
125123
if get_settings().pr_reviewer.persistent_comment and not self.incremental.is_incremental:
126124
self.git_provider.publish_persistent_comment(pr_review,
@@ -130,8 +128,6 @@ async def run(self) -> None:
130128
self.git_provider.publish_comment(pr_review)
131129

132130
self.git_provider.remove_initial_comment()
133-
if previous_review_comment:
134-
self._remove_previous_review_comment(previous_review_comment)
135131
if get_settings().pr_reviewer.inline_code_comments:
136132
self._publish_inline_code_comments()
137133
except Exception as e:
@@ -295,7 +291,7 @@ def _get_previous_review_comment(self):
295291
Get the previous review comment if it exists.
296292
"""
297293
try:
298-
if get_settings().pr_reviewer.remove_previous_review_comment and hasattr(self.git_provider, "get_previous_review"):
294+
if hasattr(self.git_provider, "get_previous_review"):
299295
return self.git_provider.get_previous_review(
300296
full=not self.incremental.is_incremental,
301297
incremental=self.incremental.is_incremental,
@@ -308,7 +304,7 @@ def _remove_previous_review_comment(self, comment):
308304
Remove the previous review comment if it exists.
309305
"""
310306
try:
311-
if get_settings().pr_reviewer.remove_previous_review_comment and comment:
307+
if comment:
312308
self.git_provider.remove_comment(comment)
313309
except Exception as e:
314310
get_logger().exception(f"Failed to remove previous review comment, error: {e}")

0 commit comments

Comments
 (0)