Commit 3cb803c
authored
Add commentType to createComment and createThread methods (#1370)
This pull request updates the way comments are created in pull request
threads by explicitly setting the `commentType` field to `1` when
creating comments and threads. This ensures that comments are
consistently recognized as standard comments by the API. Related tests
have also been updated to verify the new behavior.
**API integration updates:**
* Added `commentType: 1` to the payload when creating comments with
`gitApi.createComment` in `src/tools/repositories.ts`, ensuring the
comment type is explicitly set.
* Added `commentType: 1` to each comment in the payload when creating
threads with `gitApi.createThread` in `src/tools/repositories.ts`.
**Test updates:**
* Updated all relevant tests in `test/src/tools/repositories.test.ts` to
expect `commentType: 1` in the payloads for both `createComment` and
`createThread` calls, ensuring tests accurately reflect the new API
usage.
[[1]](diffhunk://#diff-ab08119c40bb674907f4cd70e8c549daaf3bcd559398b0f2eddb463bf8eb160aL5434-R5434)
[[2]](diffhunk://#diff-ab08119c40bb674907f4cd70e8c549daaf3bcd559398b0f2eddb463bf8eb160aL5505-R5505)
[[3]](diffhunk://#diff-ab08119c40bb674907f4cd70e8c549daaf3bcd559398b0f2eddb463bf8eb160aL5542-R5542)
[[4]](diffhunk://#diff-ab08119c40bb674907f4cd70e8c549daaf3bcd559398b0f2eddb463bf8eb160aL5579-R5579)
[[5]](diffhunk://#diff-ab08119c40bb674907f4cd70e8c549daaf3bcd559398b0f2eddb463bf8eb160aL5614-R5614)
[[6]](diffhunk://#diff-ab08119c40bb674907f4cd70e8c549daaf3bcd559398b0f2eddb463bf8eb160aL7048-R7048)
[[7]](diffhunk://#diff-ab08119c40bb674907f4cd70e8c549daaf3bcd559398b0f2eddb463bf8eb160aL7089-R7089)
## GitHub issue number
#1368
## **Associated Risks**
N/A
## ✅ **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?**
updated automated tests, all are passing1 parent 1892b9d commit 3cb803c
2 files changed
Lines changed: 9 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1495 | 1495 | | |
1496 | 1496 | | |
1497 | 1497 | | |
1498 | | - | |
| 1498 | + | |
1499 | 1499 | | |
1500 | 1500 | | |
1501 | 1501 | | |
| |||
1657 | 1657 | | |
1658 | 1658 | | |
1659 | 1659 | | |
1660 | | - | |
| 1660 | + | |
1661 | 1661 | | |
1662 | 1662 | | |
1663 | 1663 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5431 | 5431 | | |
5432 | 5432 | | |
5433 | 5433 | | |
5434 | | - | |
| 5434 | + | |
5435 | 5435 | | |
5436 | 5436 | | |
5437 | 5437 | | |
| |||
5502 | 5502 | | |
5503 | 5503 | | |
5504 | 5504 | | |
5505 | | - | |
| 5505 | + | |
5506 | 5506 | | |
5507 | 5507 | | |
5508 | 5508 | | |
| |||
5539 | 5539 | | |
5540 | 5540 | | |
5541 | 5541 | | |
5542 | | - | |
| 5542 | + | |
5543 | 5543 | | |
5544 | 5544 | | |
5545 | 5545 | | |
| |||
5576 | 5576 | | |
5577 | 5577 | | |
5578 | 5578 | | |
5579 | | - | |
| 5579 | + | |
5580 | 5580 | | |
5581 | 5581 | | |
5582 | 5582 | | |
| |||
5611 | 5611 | | |
5612 | 5612 | | |
5613 | 5613 | | |
5614 | | - | |
| 5614 | + | |
5615 | 5615 | | |
5616 | 5616 | | |
5617 | 5617 | | |
| |||
7045 | 7045 | | |
7046 | 7046 | | |
7047 | 7047 | | |
7048 | | - | |
| 7048 | + | |
7049 | 7049 | | |
7050 | 7050 | | |
7051 | 7051 | | |
| |||
7086 | 7086 | | |
7087 | 7087 | | |
7088 | 7088 | | |
7089 | | - | |
| 7089 | + | |
7090 | 7090 | | |
7091 | 7091 | | |
7092 | 7092 | | |
| |||
0 commit comments