Commit 12424fe
authored
feat(mrs): add MR versions support (list and get diff versions) (#271)
* feat(mrs): add MR versions support (list and get diff versions)
- Add `versions` action to list all diff versions of a merge request
- Add `version` action to get specific version with file diffs
- Add integration tests for new actions
- Add documentation examples for versions/version actions
Closes #268
* test(mrs): add unit tests for versions and version actions
- Add unit tests for action: versions (list MR diff versions)
- Add unit tests for action: version (get specific version)
- Add superRefine validation test for version_id field
- Update tool description assertions
* fix(mrs): add passthrough to versions schemas for superRefine validation
- Add .passthrough() to ListMergeRequestVersionsSchema
- Add .passthrough() to GetMergeRequestVersionSchema
- Add negative-case tests for action-field validation
* test(mrs): use word boundary regex for version action check
Use /\bversion\b/ instead of toContain("version") to ensure
the test verifies distinct "version" action, not just a substring
match from "versions".
* fix(mrs): reject get/diffs-specific fields in versions/version actions
Add superRefine validation to reject branch_name, include_diverged_commits_count,
and include_rebase_in_progress fields when used with versions or version actions.
These fields are only valid for get and diffs actions.
* build(deps): add @types/picomatch for type safety
Fixes TypeScript lint errors with picomatch usage in MR diffs handler.
* refactor(mrs): rename constant to accurately describe purpose
Rename getAndDiffsSharedFields to fieldsInvalidForVersionActions
and add comment clarifying which fields are get-only vs shared.
* fix(ci): generate prisma client before running tests
coverage-pages.yml was missing prisma generate step,
causing "Cannot find module prisma/client" errors.
* test(mrs): use regex patterns for error message assertions
Replace exact string matching with regex patterns to make tests
more resilient to Zod error message format changes.1 parent 2c2d31c commit 12424fe
File tree
8 files changed
+521
-5
lines changed- .github/workflows
- docs/tools
- src/entities/mrs
- tests
- integration/schemas
- unit/entities/mrs
8 files changed
+521
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
52 | 55 | | |
53 | 56 | | |
54 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
80 | 97 | | |
81 | 98 | | |
82 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
473 | 473 | | |
474 | 474 | | |
475 | 475 | | |
476 | | - | |
| 476 | + | |
477 | 477 | | |
478 | 478 | | |
479 | 479 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
| 182 | + | |
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| |||
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
312 | 332 | | |
313 | 333 | | |
314 | 334 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
205 | 231 | | |
206 | 232 | | |
207 | 233 | | |
| |||
210 | 236 | | |
211 | 237 | | |
212 | 238 | | |
| 239 | + | |
| 240 | + | |
213 | 241 | | |
214 | 242 | | |
215 | 243 | | |
| |||
250 | 278 | | |
251 | 279 | | |
252 | 280 | | |
| 281 | + | |
253 | 282 | | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
254 | 291 | | |
255 | 292 | | |
256 | 293 | | |
| |||
306 | 343 | | |
307 | 344 | | |
308 | 345 | | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
309 | 359 | | |
310 | 360 | | |
311 | 361 | | |
| |||
318 | 368 | | |
319 | 369 | | |
320 | 370 | | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
321 | 384 | | |
322 | 385 | | |
323 | 386 | | |
| |||
0 commit comments