You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey,
i added the **create_pull_request_thread** functionality to initiate a
new comment thread on a pull request.
## GitHub issue number
#231
## **Associated Risks**
/
## ✅ **PR Checklist**
- [x] **I have read the [contribution
guidelines](https://github.com/microsoft/azure-devops-mcp/blob/main/CONTRIBUTING.md)**
- [x] **I have read the [code of conduct
guidelines](https://github.com/microsoft/azure-devops-mcp/blob/main/CODE_OF_CONDUCT.md)**
- [x] Title of the pull request is clear and informative.
- [x] 👌 Code hygiene
- [x] 🔭 Telemetry added, updated, or N/A
- [x] 📄 Documentation added, updated, or N/A
- [x] 🛡️ Automated tests added, or N/A
## 🧪 **How did you test it?**
Model: Claude Sonnet 4
Prompt:
```
## Code Review Expert: Detailed Analysis and Best Practices
As a senior software engineer with expertise in code quality, security, and performance optimization, perform a code review of the provided git diff.
Focus on delivering actionable feedback in the following areas:
Critical Issues:
- Security vulnerabilities and potential exploits
- Runtime errors and logic bugs
- Performance bottlenecks and optimization opportunities
- Memory management and resource utilization
- Threading and concurrency issues
- Input validation and error handling
Code Quality:
- Adherence to language-specific conventions and best practices
- Design patterns and architectural considerations
- Code organization and modularity
- Naming conventions and code readability
- Documentation completeness and clarity
- Test coverage and testing approach
Maintainability:
- Code duplication and reusability
- Complexity metrics (cyclomatic complexity, cognitive complexity)
- Dependencies and coupling
- Extensibility and future-proofing
- Technical debt implications
Provide specific recommendations with:
- Code examples for suggested improvements
- References to relevant documentation or standards
- Rationale for suggested changes
- Impact assessment of proposed modifications
Format your review using clear sections and bullet points. Include inline code references where applicable.
Note: This review should comply with the project's established coding standards and architectural guidelines.
### Context:
- **DevOps-Project**: z
- **Repository**: y
- **PR number**: x
### Instructions:
1. **Use Azure DevOps integration**:
- Connect to Azure DevOps via MCP Tools
- Load PR details, commits and existing comments
- Analyze the changed files and code diffs
2 **Code standards check against**:
- Copilot Instructions
3. **Sarcastic review style**:
- Be precise but biting in criticism
- Repeat similar issues for multiple files
- Create separate comment threads for each issue
- If possible, always link the file in the comment as well as the line and offset
4. **Azure DevOps Actions**:
- Use `mcp_ado_repo_create_pull_request_thread` for new comments
- Create specific comment threads with file/line references (for the line and offset: rightFileStartLine, rightFileStartOffset, rightFileEndLine, rightFileEndOffset)
- Link specific lines of code and offsets
- Set review priority based on issue severity
5. **Extra information**:
- Ignore deleted comments
- Ignore deleted files
- Always perform a review, even if you think the PR has already been reviewed. Please proceed in such a way that you ignore the old review and start again.
- PullRequest-Status Enum(NotSet = 0, Active = 1, Abandoned = 2, Completed = 3, All = 4)
- Only look at the diffs from the PullRequest
6. **Qualtity**:
1. **Specify filePath** - Full path to the file
2. **Specify rightFileStartLine** - Start line of the problem
3. **Specify rightFileEndLine** - End line of the problem
4. **Specify rightFileStartOffset** - Start offset
5. **Specify rightFileEndOffset** - End offset
### Expected result:
- Each comment with specific file/line reference
- Sarcastic but constructive tone
- Specific recommendations for improvement
- create new short review comments with specific line references
- Reviewing the diffs between the source branch and target branch
```
<img width="1396" height="851" alt="grafik"
src="https://github.com/user-attachments/assets/8aaec603-b890-4a6c-8d04-399a9cc4da18"
/>
---------
Co-authored-by: Dan Hellem <[email protected]>
"Creates a new comment thread on a pull request.",
526
+
{
527
+
repositoryId: z.string().describe("The ID of the repository where the pull request is located."),
528
+
pullRequestId: z.number().describe("The ID of the pull request where the comment thread exists."),
529
+
content: z.string().describe("The content of the comment to be added."),
530
+
project: z.string().optional().describe("Project ID or project name (optional)"),
531
+
filePath: z.string().optional().describe("The path of the file where the comment thread will be created. (optional)"),
532
+
rightFileStartLine: z.number().optional().describe("Position of first character of the thread's span in right file. The line number of a thread's position. Starts at 1. (optional)"),
533
+
rightFileStartOffset: z
534
+
.number()
535
+
.optional()
536
+
.describe(
537
+
"Position of first character of the thread's span in right file. The line number of a thread's position. The character offset of a thread's position inside of a line. Starts at 1. Must only be set if rightFileStartLine is also specified. (optional)"
538
+
),
539
+
rightFileEndLine: z
540
+
.number()
541
+
.optional()
542
+
.describe(
543
+
"Position of last character of the thread's span in right file. The line number of a thread's position. Starts at 1. Must only be set if rightFileStartLine is also specified. (optional)"
544
+
),
545
+
rightFileEndOffset: z
546
+
.number()
547
+
.optional()
548
+
.describe(
549
+
"Position of last character of the thread's span in right file. The character offset of a thread's position inside of a line. Must only be set if rightFileEndLine is also specified. (optional)"
0 commit comments