diff --git a/pr_agent/algo/utils.py b/pr_agent/algo/utils.py index 1dfc6dc1..7af40f67 100644 --- a/pr_agent/algo/utils.py +++ b/pr_agent/algo/utils.py @@ -42,6 +42,7 @@ def convert_to_markdown(output_data: dict, gfm_supported: bool=True) -> str: "General suggestions": "💡", "Insights from user's answers": "📝", "Code feedback": "🤖", + "Estimated time to review": "⏱️", } for key, value in output_data.items(): diff --git a/pr_agent/settings/configuration.toml b/pr_agent/settings/configuration.toml index 73371907..40abcce8 100644 --- a/pr_agent/settings/configuration.toml +++ b/pr_agent/settings/configuration.toml @@ -18,6 +18,7 @@ require_focused_review=false require_score_review=false require_tests_review=true require_security_review=true +require_estimate_time_to_review=false num_code_suggestions=4 inline_code_comments = false ask_and_reflect=false diff --git a/pr_agent/settings/pr_reviewer_prompts.toml b/pr_agent/settings/pr_reviewer_prompts.toml index 7c21f433..a89ea7eb 100644 --- a/pr_agent/settings/pr_reviewer_prompts.toml +++ b/pr_agent/settings/pr_reviewer_prompts.toml @@ -85,6 +85,14 @@ PR Analysis: code diff changes are too scattered, then the PR is not focused. Explain your answer shortly. {%- endif %} +{%- if require_estimate_time_to_review %} + Estimated time to review: + type: string + description: >- + Estimate, in minutes, how much time it would take for an experienced developer to review this PR, and provide meaningful feedback. + Take into account the size, complexity, quality and possible needed changes of the PR code diff. + Explain your answer shortly (1-2 sentences). +{%- endif %} PR Feedback: General suggestions: type: string diff --git a/pr_agent/tools/pr_reviewer.py b/pr_agent/tools/pr_reviewer.py index 7f790d3b..fb8984a2 100644 --- a/pr_agent/tools/pr_reviewer.py +++ b/pr_agent/tools/pr_reviewer.py @@ -59,6 +59,7 @@ class PRReviewer: "require_tests": get_settings().pr_reviewer.require_tests_review, "require_security": get_settings().pr_reviewer.require_security_review, "require_focused": get_settings().pr_reviewer.require_focused_review, + "require_estimate_time_to_review": get_settings().pr_reviewer.require_estimate_time_to_review, 'num_code_suggestions': get_settings().pr_reviewer.num_code_suggestions, 'question_str': question_str, 'answer_str': answer_str,