Skip to content
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

Refactoring and Enhancement of PR Agent Prompts #501

Merged
merged 8 commits into from
Dec 4, 2023
Merged

Conversation

mrT23
Copy link
Collaborator

@mrT23 mrT23 commented Dec 3, 2023

type:

Refactoring, Enhancement


description:

This PR includes several changes to the PR agent's prompts:

  • Improved clarity and formatting across all prompts.
  • Enhanced instructions for generating documentation, code suggestions, and PR descriptions.
  • Refactored prompts for better readability and understanding.
  • Updated the presentation of PR diffs, commit messages, and descriptions in the prompts.

main_files_walkthrough:

files:
  • pr_agent/settings/pr_add_docs.toml: Improved the clarity of the instructions for generating documentation. Updated the presentation of PR diffs and extra instructions.
  • pr_agent/settings/pr_code_suggestions_prompts.toml: Enhanced the instructions for providing code suggestions. Updated the presentation of PR diffs, descriptions, and extra instructions.
  • pr_agent/settings/pr_custom_labels.toml: Updated the presentation of extra instructions and Pydantic definitions.
  • pr_agent/settings/pr_description_prompts.toml: Improved the instructions for generating PR descriptions. Updated the presentation of extra instructions and Pydantic definitions.
  • pr_agent/settings/pr_information_from_user_prompts.toml: Updated the presentation of PR diffs, descriptions, and commit messages.
  • pr_agent/settings/pr_questions_prompts.toml: Updated the presentation of PR diffs, descriptions, and commit messages.
  • pr_agent/settings/pr_reviewer_prompts.toml: Updated the presentation of PR diffs, descriptions, commit messages, and questions.
  • pr_agent/settings/pr_sort_code_suggestions_prompts.toml: Updated the presentation of code suggestions.
  • pr_agent/settings/pr_update_changelog_prompts.toml: Updated the presentation of PR diffs, descriptions, commit messages, and the CHANGELOG.md file.

@mrT23 mrT23 requested a review from hussam789 December 3, 2023 15:27
@mrT23
Copy link
Collaborator Author

mrT23 commented Dec 3, 2023

/describe

Copy link
Contributor

github-actions bot commented Dec 3, 2023

PR Analysis

  • 🎯 Main theme: Refactoring and enhancement of prompts in various PR agent settings files
  • 📝 PR summary: This PR primarily focuses on improving the formatting, clarity, and instructions in various PR agent settings files. The changes include refining prompts, enhancing descriptions, and improving the overall readability of the instructions.
  • 📌 Type of PR: Refactoring
  • 🧪 Relevant tests added: No
  • ⏱️ Estimated effort to review [1-5]: 2, because the changes are mostly textual and do not involve complex code changes. However, it requires a careful review to ensure the instructions and prompts are clear and accurate.
  • 🔒 Security concerns: No security concerns found

PR Feedback

  • 💡 General suggestions: The changes made in the PR are generally good and improve the readability and clarity of the prompts. However, it would be beneficial to ensure consistency in the use of terminology across all files. For example, the term 'PR Diff' is used in some files, while 'PR Git Diff' is used in others. It would be better to stick to one term for consistency.

  • 🤖 Code feedback:
    • relevant file: pr_agent/settings/pr_code_suggestions_prompts.toml
      suggestion: Consider using bullet points for the 'Specific instructions' section to improve readability. [medium]
      relevant line: Specific instructions:

    • relevant file: pr_agent/settings/pr_reviewer_prompts.toml
      suggestion: The term 'PR Git Diff' is used here, while 'PR Diff' is used in other files. Consider using consistent terminology across all files. [medium]
      relevant line: The PR Git Diff:

How to use

Instructions

To invoke the PR-Agent, add a comment using one of the following commands:
/review: Request a review of your Pull Request.
/describe: Update the PR title and description based on the contents of the PR.
/improve [--extended]: Suggest code improvements. Extended mode provides a higher quality feedback.
/ask <QUESTION>: Ask a question about the PR.
/update_changelog: Update the changelog based on the PR's contents.
/add_docs: Generate docstring for new components introduced in the PR.
/generate_labels: Generate labels for the PR based on the PR's contents.
see the tools guide for more details.

To edit any configuration parameter from the configuration.toml, add --config_path=new_value.
For example: /review --pr_reviewer.extra_instructions="focus on the file: ..."
To list the possible configuration parameters, add a /config comment.

Copy link
Contributor

github-actions bot commented Dec 3, 2023

PR Code Suggestions

💡 Suggestion:

Use consistent terminology in the PR Diff example.

File: pr_agent/settings/pr_code_suggestions_prompts.toml (5-18)

Example code:

Existing code:

Example for the PR Diff format:
======
## src/file1.py

@@ -12,3 +12,4 @@ def func1():
__new hunk__
12  code line1 that remained unchanged in the PR
14 +new code line1 added in the PR
15 +new code line2 added in the PR
16  code line2 that remained unchanged in the PR
__old hunk__
 code line1 that remained unchanged in the PR
-code line that was removed in the PR
 code line2 that remained unchanged in the PR

Improved code:

Example for the PR Diff format:
======
## src/file1.py

@@ -12,3 +12,4 @@ def func1():
__new hunk__
12  code line1 that remained unchanged in the PR
14 +new code line1 added in the PR
15 +new code line2 added in the PR
16  code line3 that remained unchanged in the PR
__old hunk__
 code line1 that remained unchanged in the PR
-code line2 that was removed in the PR
 code line3 that remained unchanged in the PR

💡 Suggestion:

Use consistent formatting for the PR Diff.

File: pr_agent/settings/pr_description_prompts.toml (118-121)

Example code:

Existing code:

The PR Diff:
======
{{ diff|trim }}
======

Improved code:

The PR Diff:
======

{{ diff|trim }}


💡 Suggestion:

Use consistent formatting for the PR Diff.

File: pr_agent/settings/pr_reviewer_prompts.toml (224-227)

Example code:

Existing code:

The PR Diff:
======
{{ diff|trim }}
======

Improved code:

The PR Diff:
======

{{ diff|trim }}


💡 Suggestion:

Use consistent formatting for the PR Diff.

File: pr_agent/settings/pr_custom_labels.toml (77-80)

Example code:

Existing code:

The PR Git Diff:
======
{{ diff|trim }}
======

Improved code:

The PR Git Diff:
======

{{ diff|trim }}

</details>

___

@github-actions github-actions bot changed the title Tr/prompt tuning Refactoring and Enhancement of PR Agent Prompts Dec 3, 2023
@github-actions github-actions bot added enhancement New feature or request Refactoring labels Dec 3, 2023
Copy link
Contributor

github-actions bot commented Dec 3, 2023

PR Description updated to latest commit (4dcbce4)

@mrT23 mrT23 merged commit fe79624 into main Dec 4, 2023
3 checks passed
@mrT23 mrT23 deleted the tr/prompt_tuning branch December 4, 2023 11:18
yochail pushed a commit to yochail/pr-agent that referenced this pull request Feb 11, 2024
Refactoring and Enhancement of PR Agent Prompts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants