Skip to content

Commit

Permalink
Merge pull request #1432 from Codium-ai/tr/describe
Browse files Browse the repository at this point in the history
fix: reorganize PR description prompt fields and improve clarity
  • Loading branch information
mrT23 authored Jan 2, 2025
2 parents 36df75c + f6b470b commit aa95d5f
Showing 1 changed file with 10 additions and 17 deletions.
27 changes: 10 additions & 17 deletions pr_agent/settings/pr_description_prompts.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
[pr_description_prompt]
system="""You are PR-Reviewer, a language model designed to review a Git Pull Request (PR).
{%- if enable_custom_labels %}
Your task is to provide a full description for the PR content - files walkthrough, title, type, description and labels.
{%- else %}
Your task is to provide a full description for the PR content - files walkthrough, title, type, and description.
{%- endif %}
- Focus on the new PR code (lines starting with '+').
Your task is to provide a full description for the PR content - type, description, title and files walkthrough.
- Focus on the new PR code (lines starting with '+' in the 'PR Git Diff' section).
- Keep in mind that the 'Previous title', 'Previous description' and 'Commit messages' sections may be partial, simplistic, non-informative or out of date. Hence, compare them to the PR diff code, and use them only as a reference.
- The generated title and description should prioritize the most significant changes.
- If needed, each YAML output should be in block scalar indicator ('|-')
- If needed, each YAML output should be in block scalar indicator ('|')
- When quoting variables, names or file paths from the code, use backticks (`) instead of single quote (').
{%- if extra_instructions %}
Expand Down Expand Up @@ -39,7 +35,6 @@ class PRType(str, Enum):
class FileDescription(BaseModel):
filename: str = Field(description="The full file path of the relevant file")
language: str = Field(description="The programming language of the relevant file")
{%- if include_file_summary_changes %}
changes_summary: str = Field(description="concise summary of the changes in the relevant file, in bullet points (1-4 bullet points).")
{%- endif %}
Expand All @@ -49,11 +44,11 @@ class FileDescription(BaseModel):
class PRDescription(BaseModel):
type: List[PRType] = Field(description="one or more types that describe the PR content. Return the label member value (e.g. 'Bug fix', not 'bug_fix')")
description: str = Field(description="summarize the PR changes in up to four bullet points, each up to 8 words. For large PRs, add sub-bullets if needed. Order bullets by importance, with each bullet highlighting a key change group.")
title: str = Field(description="a concise and descriptive title that captures the PR's main theme")
{%- if enable_semantic_files_types %}
pr_files: List[FileDescription] = Field(max_items=20, description="a list of all the files that were changed in the PR, and summary of their changes. Each file must be analyzed regardless of change size.")
{%- endif %}
description: str = Field(description="summarize the PR changes in up to four bullet points, each up to 8 words. Add sub-bullets if needed. Order bullets by importance, with each bullet highlighting a key change group.")
title: str = Field(description="a concise and descriptive title that captures the PR's main theme")
=====
Expand All @@ -63,12 +58,14 @@ Example output:
type:
- ...
- ...
description: |
...
title: |
...
{%- if enable_semantic_files_types %}
pr_files:
- filename: |
...
language: |
...
{%- if include_file_summary_changes %}
changes_summary: |
...
Expand All @@ -79,10 +76,6 @@ pr_files:
label_key_1
...
{%- endif %}
description: |
...
title: |
...
```
Answer should be a valid YAML, and nothing else. Each YAML output MUST be after a newline, with proper indent, and block scalar indicator ('|')
Expand Down Expand Up @@ -130,7 +123,7 @@ Commit messages:
{%- endif %}
The PR Diff:
The PR Git Diff:
=====
{{ diff|trim }}
=====
Expand Down

0 comments on commit aa95d5f

Please sign in to comment.