mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-06 05:40:38 +08:00
Merge pull request #168 from Codium-ai/tr/further_use_commit_messages
Use commit messages in PR tools
This commit is contained in:
@ -1,3 +1,10 @@
|
|||||||
|
## 2023-08-02
|
||||||
|
|
||||||
|
### Enhanced
|
||||||
|
- Updated several tools in the `pr_agent` package to use commit messages in their functionality.
|
||||||
|
- Commit messages are now retrieved and stored in the `vars` dictionary for each tool.
|
||||||
|
- Added a section to display the commit messages in the prompts of various tools.
|
||||||
|
|
||||||
## 2023-08-01
|
## 2023-08-01
|
||||||
|
|
||||||
### Enhanced
|
### Enhanced
|
||||||
|
@ -73,6 +73,11 @@ Description: '{{description}}'
|
|||||||
{%- if language %}
|
{%- if language %}
|
||||||
Main language: {{language}}
|
Main language: {{language}}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
{%- if commit_messages_str %}
|
||||||
|
|
||||||
|
Commit messages:
|
||||||
|
{{commit_messages_str}}
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
|
|
||||||
The PR Diff:
|
The PR Diff:
|
||||||
|
@ -21,6 +21,11 @@ Description: '{{description}}'
|
|||||||
{%- if language %}
|
{%- if language %}
|
||||||
Main language: {{language}}
|
Main language: {{language}}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
{%- if commit_messages_str %}
|
||||||
|
|
||||||
|
Commit messages:
|
||||||
|
{{commit_messages_str}}
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
|
|
||||||
The PR Git Diff:
|
The PR Git Diff:
|
||||||
|
@ -13,6 +13,11 @@ Description: '{{description}}'
|
|||||||
{%- if language %}
|
{%- if language %}
|
||||||
Main language: {{language}}
|
Main language: {{language}}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
{%- if commit_messages_str %}
|
||||||
|
|
||||||
|
Commit messages:
|
||||||
|
{{commit_messages_str}}
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
|
|
||||||
The PR Git Diff:
|
The PR Git Diff:
|
||||||
|
@ -135,6 +135,11 @@ Description: '{{description}}'
|
|||||||
{%- if language %}
|
{%- if language %}
|
||||||
Main language: {{language}}
|
Main language: {{language}}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
{%- if commit_messages_str %}
|
||||||
|
|
||||||
|
Commit messages:
|
||||||
|
{{commit_messages_str}}
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
{%- if question_str %}
|
{%- if question_str %}
|
||||||
######
|
######
|
||||||
|
@ -19,6 +19,11 @@ Description: '{{description}}'
|
|||||||
{%- if language %}
|
{%- if language %}
|
||||||
Main language: {{language}}
|
Main language: {{language}}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
{%- if commit_messages_str %}
|
||||||
|
|
||||||
|
Commit messages:
|
||||||
|
{{commit_messages_str}}
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
|
|
||||||
The PR Diff:
|
The PR Diff:
|
||||||
|
@ -34,6 +34,7 @@ class PRCodeSuggestions:
|
|||||||
"diff": "", # empty diff for initial calculation
|
"diff": "", # empty diff for initial calculation
|
||||||
"num_code_suggestions": get_settings().pr_code_suggestions.num_code_suggestions,
|
"num_code_suggestions": get_settings().pr_code_suggestions.num_code_suggestions,
|
||||||
"extra_instructions": get_settings().pr_code_suggestions.extra_instructions,
|
"extra_instructions": get_settings().pr_code_suggestions.extra_instructions,
|
||||||
|
"commit_messages_str": self.git_provider.get_commit_messages(),
|
||||||
}
|
}
|
||||||
self.token_handler = TokenHandler(self.git_provider.pr,
|
self.token_handler = TokenHandler(self.git_provider.pr,
|
||||||
self.vars,
|
self.vars,
|
||||||
|
@ -27,7 +27,6 @@ class PRDescription:
|
|||||||
self.main_pr_language = get_main_pr_language(
|
self.main_pr_language = get_main_pr_language(
|
||||||
self.git_provider.get_languages(), self.git_provider.get_files()
|
self.git_provider.get_languages(), self.git_provider.get_files()
|
||||||
)
|
)
|
||||||
commit_messages_str = self.git_provider.get_commit_messages()
|
|
||||||
|
|
||||||
# Initialize the AI handler
|
# Initialize the AI handler
|
||||||
self.ai_handler = AiHandler()
|
self.ai_handler = AiHandler()
|
||||||
@ -40,7 +39,7 @@ class PRDescription:
|
|||||||
"language": self.main_pr_language,
|
"language": self.main_pr_language,
|
||||||
"diff": "", # empty diff for initial calculation
|
"diff": "", # empty diff for initial calculation
|
||||||
"extra_instructions": get_settings().pr_description.extra_instructions,
|
"extra_instructions": get_settings().pr_description.extra_instructions,
|
||||||
"commit_messages_str": commit_messages_str
|
"commit_messages_str": self.git_provider.get_commit_messages()
|
||||||
}
|
}
|
||||||
|
|
||||||
# Initialize the token handler
|
# Initialize the token handler
|
||||||
|
@ -24,6 +24,7 @@ class PRInformationFromUser:
|
|||||||
"description": self.git_provider.get_pr_description(),
|
"description": self.git_provider.get_pr_description(),
|
||||||
"language": self.main_pr_language,
|
"language": self.main_pr_language,
|
||||||
"diff": "", # empty diff for initial calculation
|
"diff": "", # empty diff for initial calculation
|
||||||
|
"commit_messages_str": self.git_provider.get_commit_messages(),
|
||||||
}
|
}
|
||||||
self.token_handler = TokenHandler(self.git_provider.pr,
|
self.token_handler = TokenHandler(self.git_provider.pr,
|
||||||
self.vars,
|
self.vars,
|
||||||
|
@ -27,6 +27,7 @@ class PRQuestions:
|
|||||||
"language": self.main_pr_language,
|
"language": self.main_pr_language,
|
||||||
"diff": "", # empty diff for initial calculation
|
"diff": "", # empty diff for initial calculation
|
||||||
"questions": self.question_str,
|
"questions": self.question_str,
|
||||||
|
"commit_messages_str": self.git_provider.get_commit_messages(),
|
||||||
}
|
}
|
||||||
self.token_handler = TokenHandler(self.git_provider.pr,
|
self.token_handler = TokenHandler(self.git_provider.pr,
|
||||||
self.vars,
|
self.vars,
|
||||||
|
@ -59,6 +59,7 @@ class PRReviewer:
|
|||||||
'question_str': question_str,
|
'question_str': question_str,
|
||||||
'answer_str': answer_str,
|
'answer_str': answer_str,
|
||||||
"extra_instructions": get_settings().pr_reviewer.extra_instructions,
|
"extra_instructions": get_settings().pr_reviewer.extra_instructions,
|
||||||
|
"commit_messages_str": self.git_provider.get_commit_messages(),
|
||||||
}
|
}
|
||||||
|
|
||||||
self.token_handler = TokenHandler(
|
self.token_handler = TokenHandler(
|
||||||
|
@ -38,6 +38,7 @@ class PRUpdateChangelog:
|
|||||||
"changelog_file_str": self.changelog_file_str,
|
"changelog_file_str": self.changelog_file_str,
|
||||||
"today": date.today(),
|
"today": date.today(),
|
||||||
"extra_instructions": get_settings().pr_update_changelog.extra_instructions,
|
"extra_instructions": get_settings().pr_update_changelog.extra_instructions,
|
||||||
|
"commit_messages_str": self.git_provider.get_commit_messages(),
|
||||||
}
|
}
|
||||||
self.token_handler = TokenHandler(self.git_provider.pr,
|
self.token_handler = TokenHandler(self.git_provider.pr,
|
||||||
self.vars,
|
self.vars,
|
||||||
|
Reference in New Issue
Block a user