-
Notifications
You must be signed in to change notification settings - Fork 624
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
Adding Estimated Review Effort Feature and Handling Cases with No Detected Language #306
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -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 effort to review [1-5]": "⏱️", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: Consider using a more descriptive key for the "Estimated effort to review [1-5]" feature.
Suggested change
|
||||||
} | ||||||
|
||||||
for key, value in output_data.items(): | ||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -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_effort_to_review %} | ||||||||||||||||||||||||||||
Estimated effort to review [1-5]: | ||||||||||||||||||||||||||||
type: string | ||||||||||||||||||||||||||||
description: >- | ||||||||||||||||||||||||||||
Estimate, on a scale of 1-5 (inclusive), the time and effort required to review this PR by an experienced and knowledgeable developer. 1 means short and easy review , 5 means long and hard review. | ||||||||||||||||||||||||||||
Take into account the size, complexity, quality, and the needed changes of the PR code diff. | ||||||||||||||||||||||||||||
Explain your answer shortly (1-2 sentences). | ||||||||||||||||||||||||||||
{%- endif %} | ||||||||||||||||||||||||||||
Comment on lines
+89
to
+95
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: Consider using a numeric type for the "Estimated effort to review [1-5]" input instead of a string.
Suggested change
|
||||||||||||||||||||||||||||
PR Feedback: | ||||||||||||||||||||||||||||
General suggestions: | ||||||||||||||||||||||||||||
type: string | ||||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -231,10 +231,14 @@ def _prepare_pr_answer(self) -> Tuple[str, str]: | |||||||||||||||||||||||||||||||
pr_body += f"## {key}:\n" | ||||||||||||||||||||||||||||||||
if 'walkthrough' in key.lower(): | ||||||||||||||||||||||||||||||||
# for filename, description in value.items(): | ||||||||||||||||||||||||||||||||
if self.git_provider.is_supported("gfm_markdown"): | ||||||||||||||||||||||||||||||||
pr_body += "<details> <summary>files:</summary>\n\n" | ||||||||||||||||||||||||||||||||
for file in value: | ||||||||||||||||||||||||||||||||
filename = file['filename'].replace("'", "`") | ||||||||||||||||||||||||||||||||
description = file['changes in file'] | ||||||||||||||||||||||||||||||||
pr_body += f'`{filename}`: {description}\n' | ||||||||||||||||||||||||||||||||
if self.git_provider.is_supported("gfm_markdown"): | ||||||||||||||||||||||||||||||||
pr_body +="</details>\n" | ||||||||||||||||||||||||||||||||
Comment on lines
+234
to
+241
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: Consider using a context manager to handle the opening and closing of the details tag.
Suggested change
|
||||||||||||||||||||||||||||||||
else: | ||||||||||||||||||||||||||||||||
# if the value is a list, join its items by comma | ||||||||||||||||||||||||||||||||
if type(value) == list: | ||||||||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -59,6 +59,7 @@ def __init__(self, pr_url: str, is_answer: bool = False, is_auto: bool = False, | |||||||||||
"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_effort_to_review": get_settings().pr_reviewer.require_estimate_effort_to_review, | ||||||||||||
Comment on lines
59
to
+62
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: Consider using a dictionary comprehension to make the code more readable and concise.
Suggested change
|
||||||||||||
'num_code_suggestions': get_settings().pr_reviewer.num_code_suggestions, | ||||||||||||
'question_str': question_str, | ||||||||||||
'answer_str': answer_str, | ||||||||||||
|
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.
Suggestion: Consider using a more Pythonic way to create a list with a single dictionary.