-
Notifications
You must be signed in to change notification settings - Fork 628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementing Thresholds for Incremental PR Reviews #423
Implementing Thresholds for Incremental PR Reviews #423
Conversation
/describe --pr_description.add_original_user_description=true |
pr_agent/tools/pr_reviewer.py
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zmeir please move all of this to a dedicated, self-contained function.
this is too much content to appear directly
@@ -25,6 +25,9 @@ inline_code_comments = false | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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! |
…l_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_sha
andlast_seen_commit_sha
in theIncrementalPR
class ingit_provider.py
.get_commit_range
method ingithub_provider.py
to assign commit objects instead of commit SHA tofirst_new_commit
andlast_seen_commit
.run
method inpr_reviewer.py
to check for the number of new commits and their recency before starting the review.configuration.toml
to 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_sha
andlast_seen_commit_sha
in theIncrementalPR
class.pr_agent/git_providers/github_provider.py
: Updatedget_commit_range
method to assign commit objects instead of commit SHA tofirst_new_commit
andlast_seen_commit
.pr_agent/tools/pr_reviewer.py
: Modifiedrun
method 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