Commit cd02548
Add includeChangedFiles parameter to get_pull_request_by_id (#1117)
Adds an optional `includeChangedFiles` parameter to the existing
`repo_get_pull_request_by_id` tool. When set to `true`, it fetches the
latest PR iteration and returns file-level change metadata (paths and
change types) — no diffs, no file content.
## GitHub Issue
Closes #958
## Approach
Per @danhellem's
[feedback](#958 (comment)),
this avoids tool bloat by extending the existing tool with a parameter
rather than adding a new standalone tool.
**Note:** I was on vacation when the issue was closed — this PR
implements the approved approach from the discussion.
## Changes
- **`src/tools/repositories.ts`** — Added `includeChangedFiles` param;
fetches latest iteration and returns `changedFilesSummary` with change
entries, file count, and pagination info
- **`test/src/tools/repositories.test.ts`** — 7 new test cases: happy
path, disabled/default, empty iterations, null iteration ID, API errors,
and combo with `includeLabels`
- **`docs/TOOLSET.md`** — Updated parameter docs
## Associated Risks
Low risk — additive change behind an opt-in flag (`default: false`), no
change to existing behavior
## ✅ 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
- [ ] 🔭 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?
- All 226 repository tests pass (`npx jest
--testPathPatterns="repositories"`)
- 7 new tests cover: happy path, opt-out, default behavior, empty
iterations, null iteration IDs, API error handling, and combined use
with `includeLabels`
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Dan Hellem <dahellem@microsoft.com>1 parent bf6d04a commit cd02548
File tree
3 files changed
+211
-14
lines changed- docs
- src/tools
- test/src/tools
3 files changed
+211
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
304 | | - | |
| 304 | + | |
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1010 | 1010 | | |
1011 | 1011 | | |
1012 | 1012 | | |
| 1013 | + | |
1013 | 1014 | | |
1014 | | - | |
| 1015 | + | |
1015 | 1016 | | |
1016 | 1017 | | |
1017 | 1018 | | |
1018 | 1019 | | |
1019 | 1020 | | |
| 1021 | + | |
| 1022 | + | |
1020 | 1023 | | |
1021 | 1024 | | |
1022 | 1025 | | |
| |||
1025 | 1028 | | |
1026 | 1029 | | |
1027 | 1030 | | |
1028 | | - | |
1029 | | - | |
| 1031 | + | |
| 1032 | + | |
1030 | 1033 | | |
1031 | 1034 | | |
1032 | 1035 | | |
1033 | 1036 | | |
1034 | 1037 | | |
1035 | | - | |
1036 | | - | |
1037 | | - | |
1038 | | - | |
1039 | 1038 | | |
1040 | 1039 | | |
1041 | | - | |
1042 | | - | |
1043 | | - | |
| 1040 | + | |
| 1041 | + | |
1044 | 1042 | | |
1045 | 1043 | | |
| 1044 | + | |
| 1045 | + | |
1046 | 1046 | | |
1047 | | - | |
1048 | | - | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
1049 | 1083 | | |
1050 | 1084 | | |
1051 | 1085 | | |
| 1086 | + | |
1052 | 1087 | | |
1053 | | - | |
| 1088 | + | |
1054 | 1089 | | |
1055 | 1090 | | |
1056 | 1091 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3862 | 3862 | | |
3863 | 3863 | | |
3864 | 3864 | | |
| 3865 | + | |
| 3866 | + | |
| 3867 | + | |
| 3868 | + | |
| 3869 | + | |
| 3870 | + | |
| 3871 | + | |
| 3872 | + | |
| 3873 | + | |
| 3874 | + | |
| 3875 | + | |
| 3876 | + | |
| 3877 | + | |
| 3878 | + | |
| 3879 | + | |
| 3880 | + | |
| 3881 | + | |
| 3882 | + | |
| 3883 | + | |
| 3884 | + | |
| 3885 | + | |
| 3886 | + | |
| 3887 | + | |
| 3888 | + | |
| 3889 | + | |
| 3890 | + | |
| 3891 | + | |
| 3892 | + | |
| 3893 | + | |
| 3894 | + | |
| 3895 | + | |
| 3896 | + | |
| 3897 | + | |
| 3898 | + | |
| 3899 | + | |
| 3900 | + | |
| 3901 | + | |
| 3902 | + | |
| 3903 | + | |
| 3904 | + | |
| 3905 | + | |
| 3906 | + | |
| 3907 | + | |
| 3908 | + | |
| 3909 | + | |
| 3910 | + | |
| 3911 | + | |
| 3912 | + | |
| 3913 | + | |
| 3914 | + | |
| 3915 | + | |
| 3916 | + | |
| 3917 | + | |
| 3918 | + | |
| 3919 | + | |
| 3920 | + | |
| 3921 | + | |
| 3922 | + | |
| 3923 | + | |
| 3924 | + | |
| 3925 | + | |
| 3926 | + | |
| 3927 | + | |
| 3928 | + | |
| 3929 | + | |
| 3930 | + | |
| 3931 | + | |
| 3932 | + | |
| 3933 | + | |
| 3934 | + | |
| 3935 | + | |
| 3936 | + | |
| 3937 | + | |
| 3938 | + | |
| 3939 | + | |
| 3940 | + | |
| 3941 | + | |
| 3942 | + | |
| 3943 | + | |
| 3944 | + | |
| 3945 | + | |
| 3946 | + | |
| 3947 | + | |
| 3948 | + | |
| 3949 | + | |
| 3950 | + | |
| 3951 | + | |
| 3952 | + | |
| 3953 | + | |
| 3954 | + | |
| 3955 | + | |
| 3956 | + | |
| 3957 | + | |
| 3958 | + | |
| 3959 | + | |
| 3960 | + | |
| 3961 | + | |
| 3962 | + | |
| 3963 | + | |
| 3964 | + | |
| 3965 | + | |
| 3966 | + | |
| 3967 | + | |
| 3968 | + | |
| 3969 | + | |
| 3970 | + | |
| 3971 | + | |
| 3972 | + | |
| 3973 | + | |
| 3974 | + | |
| 3975 | + | |
| 3976 | + | |
| 3977 | + | |
| 3978 | + | |
| 3979 | + | |
| 3980 | + | |
| 3981 | + | |
| 3982 | + | |
| 3983 | + | |
| 3984 | + | |
| 3985 | + | |
| 3986 | + | |
| 3987 | + | |
| 3988 | + | |
| 3989 | + | |
| 3990 | + | |
| 3991 | + | |
| 3992 | + | |
| 3993 | + | |
| 3994 | + | |
| 3995 | + | |
| 3996 | + | |
| 3997 | + | |
| 3998 | + | |
| 3999 | + | |
| 4000 | + | |
| 4001 | + | |
| 4002 | + | |
| 4003 | + | |
| 4004 | + | |
| 4005 | + | |
| 4006 | + | |
| 4007 | + | |
| 4008 | + | |
| 4009 | + | |
| 4010 | + | |
| 4011 | + | |
| 4012 | + | |
| 4013 | + | |
| 4014 | + | |
| 4015 | + | |
| 4016 | + | |
| 4017 | + | |
| 4018 | + | |
| 4019 | + | |
| 4020 | + | |
| 4021 | + | |
| 4022 | + | |
| 4023 | + | |
| 4024 | + | |
| 4025 | + | |
| 4026 | + | |
3865 | 4027 | | |
3866 | 4028 | | |
3867 | 4029 | | |
| |||
0 commit comments