mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-02 11:50:37 +08:00

The new feature can be enabled via the new configuration `github_app.handle_push_event`. To avoid any unwanted side-effects, the current default of this configuration is set to `false`. The high level flow (assuming the configuration is enabled): 1. receive push event from GitHub 2. extract branch and commits from event 3. find PR url for branch (currently does not support PRs from forks) 4. perform configured commands (e.g. `/describe`, `/review -i`) The push event flow is guarded by a backlog queue so that multiple push events on the same branch won't trigger multiple duplicate runs of the PR-Agent commands. Example timeline: 1. push 1 - start handling event 2. push 2 - waiting to be handled while push 1 event is still running 3. push 3 - event is dropped since handling it and handling push 2 is the same, so it is redundant 4. push 1 finished being handled 5. push 2 awakens from wait and continues handling (potentially reviewing the commits of both push 2 and push 3) All of these options are configurable and can be enabled/disabled as per the user's desire. Additional minor changes in this PR: 1. Created `DefaultDictWithTimeout` utility class to avoid too much boilerplate code in managing caches for outdated triggers. 2. Guard against running increment review when there are no new commits. 3. Minor styling changes for incremented review text.
146 lines
4.3 KiB
TOML
146 lines
4.3 KiB
TOML
[config]
|
|
model="gpt-4"
|
|
fallback_models=["gpt-3.5-turbo-16k"]
|
|
git_provider="github"
|
|
publish_output=true
|
|
publish_output_progress=true
|
|
verbosity_level=0 # 0,1,2
|
|
use_extra_bad_extensions=false
|
|
use_repo_settings_file=true
|
|
ai_timeout=180
|
|
max_description_tokens = 500
|
|
max_commits_tokens = 500
|
|
patch_extra_lines = 3
|
|
secret_provider="google_cloud_storage"
|
|
cli_mode=false
|
|
|
|
[pr_reviewer] # /review #
|
|
require_focused_review=false
|
|
require_score_review=false
|
|
require_tests_review=true
|
|
require_security_review=true
|
|
require_estimate_effort_to_review=true
|
|
num_code_suggestions=4
|
|
inline_code_comments = false
|
|
ask_and_reflect=false
|
|
automatic_review=true
|
|
extra_instructions = ""
|
|
|
|
[pr_description] # /describe #
|
|
publish_labels=true
|
|
publish_description_as_comment=false
|
|
add_original_user_description=false
|
|
keep_original_user_title=false
|
|
use_bullet_points=true
|
|
extra_instructions = ""
|
|
# markers
|
|
use_description_markers=false
|
|
include_generated_by_header=true
|
|
|
|
[pr_questions] # /ask #
|
|
|
|
[pr_code_suggestions] # /improve #
|
|
num_code_suggestions=4
|
|
extra_instructions = ""
|
|
rank_suggestions = false
|
|
# params for '/improve --extended' mode
|
|
num_code_suggestions_per_chunk=8
|
|
rank_extended_suggestions = true
|
|
max_number_of_calls = 5
|
|
final_clip_factor = 0.9
|
|
|
|
[pr_add_docs] # /add_docs #
|
|
extra_instructions = ""
|
|
docs_style = "Sphinx Style" # "Google Style with Args, Returns, Attributes...etc", "Numpy Style", "Sphinx Style", "PEP257", "reStructuredText"
|
|
|
|
[pr_update_changelog] # /update_changelog #
|
|
push_changelog_changes=false
|
|
extra_instructions = ""
|
|
|
|
[pr_config] # /config #
|
|
|
|
[github]
|
|
# The type of deployment to create. Valid values are 'app' or 'user'.
|
|
deployment_type = "user"
|
|
ratelimit_retries = 5
|
|
|
|
[github_action]
|
|
# auto_review = true # set as env var in .github/workflows/pr-agent.yaml
|
|
# auto_describe = true # set as env var in .github/workflows/pr-agent.yaml
|
|
# auto_improve = true # set as env var in .github/workflows/pr-agent.yaml
|
|
|
|
[github_app]
|
|
# these toggles allows running the github app from custom deployments
|
|
bot_user = "github-actions[bot]"
|
|
override_deployment_type = true
|
|
# in some deployments it's possible to get duplicate requests if the handling is long,
|
|
# these settings are used to avoid handling duplicate requests.
|
|
duplicate_requests_cache = false
|
|
duplicate_requests_cache_ttl = 60 # in seconds
|
|
# settings for "pull_request" event
|
|
handle_pr_actions = ['opened', 'reopened', 'ready_for_review', 'review_requested']
|
|
pr_commands = [
|
|
"/describe --pr_description.add_original_user_description=true --pr_description.keep_original_user_title=true",
|
|
"/auto_review",
|
|
]
|
|
# settings for "push" event
|
|
handle_push_event = false
|
|
push_event_ignore_bot_commits = true
|
|
push_event_ignore_merge_commits = true
|
|
push_event_wait_for_initial_review = true
|
|
push_event_pending_triggers_backlog = true
|
|
push_event_pending_triggers_ttl = 300
|
|
push_commands = [
|
|
"/describe --pr_description.add_original_user_description=true --pr_description.keep_original_user_title=true",
|
|
"""/auto_review -i \
|
|
--pr_reviewer.require_focused_review=false \
|
|
--pr_reviewer.require_score_review=false \
|
|
--pr_reviewer.require_tests_review=false \
|
|
--pr_reviewer.require_security_review=false \
|
|
--pr_reviewer.require_estimate_effort_to_review=false \
|
|
--pr_reviewer.num_code_suggestions=0 \
|
|
--pr_reviewer.inline_code_comments=false \
|
|
--pr_reviewer.extra_instructions='' \
|
|
"""
|
|
]
|
|
|
|
[gitlab]
|
|
# URL to the gitlab service
|
|
url = "https://gitlab.com"
|
|
|
|
# Polling (either project id or namespace/project_name) syntax can be used
|
|
projects_to_monitor = ['org_name/repo_name']
|
|
|
|
# Polling trigger
|
|
magic_word = "AutoReview"
|
|
|
|
# Polling interval
|
|
polling_interval_seconds = 30
|
|
|
|
[local]
|
|
# LocalGitProvider settings - uncomment to use paths other than default
|
|
# description_path= "path/to/description.md"
|
|
# review_path= "path/to/review.md"
|
|
|
|
[gerrit]
|
|
# endpoint to the gerrit service
|
|
# url = "ssh://gerrit.example.com:29418"
|
|
# user for gerrit authentication
|
|
# user = "ai-reviewer"
|
|
# patch server where patches will be saved
|
|
# patch_server_endpoint = "http://127.0.0.1:5000/patch"
|
|
# token to authenticate in the patch server
|
|
# patch_server_token = ""
|
|
|
|
[litellm]
|
|
#use_client = false
|
|
|
|
[pr_similar_issue]
|
|
skip_comments = false
|
|
force_update_dataset = false
|
|
max_issues_to_scan = 500
|
|
|
|
[pinecone]
|
|
# fill and place in .secrets.toml
|
|
#api_key = ...
|
|
# environment = "gcp-starter" |