-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Hl/ask line #661
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
Hl/ask line #661
Conversation
|
PR Description updated to latest commit (8ed98c8)
|
PR Review
✨ Usage guide:Overview: With a configuration file, use the following template:
See the review usage page for a comprehensive guide on using this tool. |
PR Code Suggestions
✨ Usage guide:Overview: With a configuration file, use the following template:
See the improve usage page for a more comprehensive guide on using this tool. |
|
/ask does this PR contains proper documentation ? |
|
Question: does this PR contain proper documentation ? Answer: Moreover, the PR also includes comments in the code, especially in the However, it's always a good idea to ensure that the documentation is comprehensive and covers all the new features or changes introduced in the PR. It might be helpful to include examples or use-cases in the documentation to provide more context about the new features. ✨ Usage guide:Overview: Note that the tool does not have "memory" of previous questions, and answers each question independently.
See the ask usage page for a comprehensive guide on using this tool. |
|
/improve --pr_code_suggestions.extra_instructions="focus on edge cases" |
PR Code Suggestions
✨ Usage guide:Overview: With a configuration file, use the following template:
See the improve usage page for a more comprehensive guide on using this tool. |
|
/analyze |
PR Analysis
✨ Usage guide:Using static code analysis capabilities, the Language that are currently supported: Python, Java, C++, JavaScript, TypeScript. |
Generated tests for 'extract_hunk_lines_from_patch'
Component signature: def extract_hunk_lines_from_patch(patch: str, file_name, line_start, line_end, side) -> tuple[str, str]:
✨ Usage guide:The where 'component_name' is the name of a specific component in the PR. To get a list of the components that changed in the PR, use the Configuration options: See more information about the test tool in the docs. |
Generated docstring for 'extract_hunk_lines_from_patch'
Component signature: def extract_hunk_lines_from_patch(patch: str, file_name, line_start, line_end, side) -> tuple[str, str]:Docstring: """
Extracts the lines from a patch that correspond to a specific hunk.
Args:
patch (str): The patch string.
file_name: The name of the file in the patch.
line_start: The starting line number of the hunk.
line_end: The ending line number of the hunk.
side: The side of the hunk to extract ('left' or 'right').
Returns:
tuple[str, str]: A tuple containing the patch string with line numbers and the selected lines from the hunk.
Raises:
None
""" |
Generated code suggestions for 'extract_hunk_lines_from_patch'
Component signature: def extract_hunk_lines_from_patch(patch: str, file_name, line_start, line_end, side) -> tuple[str, str]:
|
|
/config |
|
Possible Configurations: pr_description.publish_labels = True pr_questions.enable_help_text = True pr_custom_suggestions.prompt = 'The suggestions should focus only on the following:\n- ...\n- ...\n...\n' pr_add_docs.extra_instructions = '' pr_update_changelog.push_changelog_changes = False pr_analyze.enable_help_text = True pr_test.extra_instructions = '' pr_improve_component.num_code_suggestions = 4 pr_similar_issue.skip_comments = False pr_reviewer.require_focused_review = False pr_code_suggestions.max_context_tokens = 8000 |
| return patch_with_lines_str.rstrip() | ||
|
|
||
|
|
||
| def extract_hunk_lines_from_patch(patch: str, file_name, line_start, line_end, side) -> tuple[str, 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.
תהיה בנאדם, תוסיף דוקסטרינג קצר. אח״כ רוצים להשתמש בזה שוב, וצריכים לנחש מה הפונקציה עושה
| mr = data['merge_request'] | ||
| url = mr.get('url') | ||
| body = data.get('object_attributes', {}).get('note') | ||
| if data.get('object_attributes', {}).get('type') == 'DiffNote' and '/ask' in body: |
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.
move this to a dedicated function
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.
Changes walkthrough
| Relevant files | |||||||
|---|---|---|---|---|---|---|---|
| Enhancement | |||||||
| Configuration changes | |||||||
| Documentation |
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.
| Relevant files | ||||||
|---|---|---|---|---|---|---|
Enhancement
| ||||||
Configuration changes
| ||||||
Documentation
|
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.
Enhancement
| ||||||
Configuration changes
| ||||||
Documentation
|
🔍 Finding similar code for 'reply_to_comment_from_comment_id'
|
🔍 Finding similar code for 'reply_to_comment_from_comment_id'
|
🔍 Finding similar code for 'reply_to_comment_from_comment_id'
|
4 similar comments
🔍 Finding similar code for 'extract_hunk_lines_from_patch'
|
🔍 Finding similar code for 'extract_hunk_lines_from_patch'
|
🔍 Finding similar code for 'extract_hunk_lines_from_patch'
|
Type
enhancement, documentation
Description
PR_LineQuestionsfor handling line-specific queries in PRs.extract_hunk_lines_from_patchto extract lines from patches for focused questions./askcommand usage for specific lines in PRs.Changes walkthrough
6 files
pr_agent.py
Integrate Line-Specific Question Handling in PR Agentpr_agent/agent/pr_agent.py
PR_LineQuestionsfor handling line-specific questions.ask_lineto the command mapping, allowing for line-specificqueries.
git_patch_processing.py
Add Function to Extract Specific Lines from Patchespr_agent/algo/git_patch_processing.py
extract_hunk_lines_from_patchto extract specific lines froma patch.
git_provider.py
Define Method for Replying to Comments by ID in Git Provider Interfacepr_agent/git_providers/git_provider.py
reply_to_comment_from_comment_idmethod stub.github_provider.py
Implement Comment Reply and Reaction Features for GitHub Providerpr_agent/git_providers/github_provider.py
reply_to_comment_from_comment_idfor GitHub.github_app.py
Add Handling for Line Comments in GitHub Apppr_agent/servers/github_app.py
pr_line_questions.py
Implement Line-Specific Question Handlingpr_agent/tools/pr_line_questions.py
PR_LineQuestionsclass for answering line-specificquestions.
2 files
config_loader.py
Update Configuration Loader to Include Line Questions Promptspr_agent/config_loader.py
pr_line_questions_prompts.tomlin the configuration loader.pr_line_questions_prompts.toml
Add Prompts Configuration for Line-Specific Questionspr_agent/settings/pr_line_questions_prompts.toml
1 files
ASK.md
Document Line-Specific Questions Featuredocs/ASK.md
/askcommand on specific lines of code.✨ Usage guide:
Overview:
The
describetool scans the PR code changes, and generates a description for the PR - title, type, summary, walkthrough and labels. The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on a PR.When commenting, to edit configurations related to the describe tool (
pr_descriptionsection), use the following template:With a configuration file, use the following template:
Enabling\disabling automation
meaning the
describetool will run automatically on every PR, will keep the original title, and will add the original user description above the generated description.the tool will replace every marker of the form
pr_agent:marker_namein the PR description with the relevant content, wheremarker_nameis one of the following:type: the PR type.summary: the PR summary.walkthrough: the PR walkthrough.Note that when markers are enabled, if the original PR description does not contain any markers, the tool will not alter the description at all.
Custom labels
The default labels of the
describetool are quite generic: [Bug fix,Tests,Enhancement,Documentation,Other].If you specify custom labels in the repo's labels page or via configuration file, you can get tailored labels for your use cases.
Examples for custom labels:
Main topic:performance- pr_agent:The main topic of this PR is performanceNew endpoint- pr_agent:A new endpoint was added in this PRSQL query- pr_agent:A new SQL query was added in this PRDockerfile changes- pr_agent:The PR contains changes in the DockerfileThe list above is eclectic, and aims to give an idea of different possibilities. Define custom labels that are relevant for your repo and use cases.
Note that Labels are not mutually exclusive, so you can add multiple label categories.
Make sure to provide proper title, and a detailed and well-phrased description for each label, so the tool will know when to suggest it.
Inline File Walkthrough 💎
For enhanced user experience, the
describetool can add file summaries directly to the "Files changed" tab in the PR page.This will enable you to quickly understand the changes in each file, while reviewing the code changes (diffs).
To enable inline file summary, set
pr_description.inline_file_summaryin the configuration file, possible values are:'table': File changes walkthrough table will be displayed on the top of the "Files changed" tab, in addition to the "Conversation" tab.true: A collapsable file comment with changes title and a changes summary for each file in the PR.false(default): File changes walkthrough will be added only to the "Conversation" tab.Utilizing extra instructions
The
describetool can be configured with extra instructions, to guide the model to a feedback tailored to the needs of your project.Be specific, clear, and concise in the instructions. With extra instructions, you are the prompter. Notice that the general structure of the description is fixed, and cannot be changed. Extra instructions can change the content or style of each sub-section of the PR description.
Examples for extra instructions:
Use triple quotes to write multi-line instructions. Use bullet points to make the instructions more readable.
More PR-Agent commands
See the describe usage page for a comprehensive guide on using this tool.