Implementing Thresholds for Incremental PR Reviews#423
Conversation
|
/describe --pr_description.add_original_user_description=true |
| if self.is_auto and self.incremental.is_incremental and not self.incremental.first_new_commit_sha: | ||
| get_logger().info(f"Incremental review is enabled for {self.pr_url} but there are no new commits") | ||
| return None | ||
| if self.incremental.is_incremental: |
There was a problem hiding this comment.
@zmeir please move all of this to a dedicated, self-contained function.
this is too much content to appear directly
| ask_and_reflect=false | ||
| automatic_review=true | ||
| remove_previous_review_comment=false | ||
| require_all_thresholds_for_incremental_review=false |
There was a problem hiding this comment.
can you stack all the 'incremental' parameters ?
i don't want the config to be just a long incoherent list
something like
/# incremental parameters:
minimal_commits_for_incremental_review=0
minimal_minutes_for_incremental_review=0
...
|
@zmeir i gave some comments. in addition, this is a complicated ability. |
|
@zmeir Thanks for adding this configuration / criteria! |
…ntal_review_thresholds Implementing Thresholds for Incremental PR Reviews
PR Type:
Enhancement
PR Description:
This PR introduces new configurations to manage the frequency of automatic incremental reviews triggered by a push event. The main changes include:
first_new_commit_shaandlast_seen_commit_shain theIncrementalPRclass ingit_provider.py.get_commit_rangemethod ingithub_provider.pyto assign commit objects instead of commit SHA tofirst_new_commitandlast_seen_commit.runmethod inpr_reviewer.pyto check for the number of new commits and their recency before starting the review.configuration.tomlto specify the minimum number of commits and minimum time elapsed for an incremental review.PR Main Files Walkthrough:
files:
pr_agent/git_providers/git_provider.py: Introduced propertiesfirst_new_commit_shaandlast_seen_commit_shain theIncrementalPRclass.pr_agent/git_providers/github_provider.py: Updatedget_commit_rangemethod to assign commit objects instead of commit SHA tofirst_new_commitandlast_seen_commit.pr_agent/tools/pr_reviewer.py: Modifiedrunmethod to check for the number of new commits and their recency before starting the review.pr_agent/settings/configuration.toml: Added new configurations to specify the minimum number of commits and minimum time elapsed for an incremental review.User Description:
These new configurations allow limiting the rate of automatic incremental reviews when triggered by a push event to reduce the noise it may generate in the PR