Commit c750a38
feat: add create pull request thread tool (#260)
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 <dahellem@microsoft.com>1 parent 79ad732 commit c750a38
2 files changed
+85
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
100 | | - | |
101 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
102 | 103 | | |
103 | 104 | | |
104 | 105 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
518 | 520 | | |
519 | 521 | | |
520 | 522 | | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
521 | 602 | | |
522 | 603 | | |
523 | 604 | | |
| |||
0 commit comments