Repository navigation
Commit 2ffa682
authored
fix: update queryOrder parameters to use SDK enum keys in configurePi… (#1657)
This pull request improves the handling and validation of the
`queryOrder` parameter for build and definition queries in the pipelines
tooling. Instead of accepting any string, the code now enforces that
only valid Azure DevOps SDK enum values are allowed. The tests have also
been updated to verify this stricter validation and correct enum
mapping.
**Parameter validation and typing improvements:**
* Changed the `queryOrder` parameter in both build and definition query
schemas to use a `z.enum` of the actual SDK enum keys, ensuring only
valid values are accepted. (`src/tools/pipelines.ts`)
[[1]](diffhunk://#diff-61ea19714cb175a5845bd938c66c5f6f0226448eb281419059c7c3ef889fb29eR9-R11)
[[2]](diffhunk://#diff-61ea19714cb175a5845bd938c66c5f6f0226448eb281419059c7c3ef889fb29eL172-R175)
[[3]](diffhunk://#diff-61ea19714cb175a5845bd938c66c5f6f0226448eb281419059c7c3ef889fb29eL317-R320)
**Testing enhancements:**
* Added and updated tests to verify that the `queryOrder` parameter only
accepts valid enum keys (case-sensitive), and that the correct SDK enum
values are used when invoking the Azure DevOps API.
(`test/src/tools/pipelines.test.ts`)
[[1]](diffhunk://#diff-fb7cbb4ca60175990b48782444c077c05ca3c38613aa12b0d8169ed3da0eb6cbL7-R7)
[[2]](diffhunk://#diff-fb7cbb4ca60175990b48782444c077c05ca3c38613aa12b0d8169ed3da0eb6cbR49-R63)
[[3]](diffhunk://#diff-fb7cbb4ca60175990b48782444c077c05ca3c38613aa12b0d8169ed3da0eb6cbR424)
[[4]](diffhunk://#diff-fb7cbb4ca60175990b48782444c077c05ca3c38613aa12b0d8169ed3da0eb6cbL419-R435)
[[5]](diffhunk://#diff-fb7cbb4ca60175990b48782444c077c05ca3c38613aa12b0d8169ed3da0eb6cbR779)
[[6]](diffhunk://#diff-fb7cbb4ca60175990b48782444c077c05ca3c38613aa12b0d8169ed3da0eb6cbL785-R802)
## GitHub issue number
#1654
## **Associated Risks**
None
## ✅ **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?**
Manual tested, confirmed with copilot, updated automated tests1 parent 52072ff commit 2ffa682
2 files changed
Lines changed: 25 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
9 | 12 | | |
10 | 13 | | |
11 | 14 | | |
| |||
169 | 172 | | |
170 | 173 | | |
171 | 174 | | |
172 | | - | |
| 175 | + | |
173 | 176 | | |
174 | 177 | | |
175 | 178 | | |
| |||
314 | 317 | | |
315 | 318 | | |
316 | 319 | | |
317 | | - | |
| 320 | + | |
318 | 321 | | |
319 | 322 | | |
320 | 323 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
49 | 64 | | |
50 | 65 | | |
51 | 66 | | |
| |||
406 | 421 | | |
407 | 422 | | |
408 | 423 | | |
| 424 | + | |
409 | 425 | | |
410 | 426 | | |
411 | 427 | | |
| |||
416 | 432 | | |
417 | 433 | | |
418 | 434 | | |
419 | | - | |
| 435 | + | |
420 | 436 | | |
421 | 437 | | |
422 | 438 | | |
| |||
760 | 776 | | |
761 | 777 | | |
762 | 778 | | |
| 779 | + | |
763 | 780 | | |
764 | 781 | | |
765 | 782 | | |
| |||
782 | 799 | | |
783 | 800 | | |
784 | 801 | | |
785 | | - | |
| 802 | + | |
786 | 803 | | |
787 | 804 | | |
788 | 805 | | |
| |||
0 commit comments