Commit 43d3f27
Missing MCP Tools: Update Architecture (#2426)
* feat(calm-hub): add updateArchitecture MCP tool
* test(calm-hub): add integration tests for updateArchitecture MCP tool
* chore: EasyCLA Failure
* chore: EasyCLA Failure
* fix(calm-hub): resolve MCP updateArchitecture regressions and security gaps
Addresses 4 issues in the MCP updateArchitecture tool:
1. BLOCKER: name/description silently nulled on every update
- Added optional name/description @ToolArgs (matches REST PUT shape)
- Preserve existing values when caller omits them via findArchitectureSummary()
- Added ArgumentCaptor verification in unit tests + post-update regression assertion in integration tests
2. Unsafe semantics: tool description said "publish" but implementation is upsert
- Updated description to explicitly document upsert behavior
- Documented legacy/backwards-compatibility intent
- Clarified that overwrite can silently clobber published versions
3. Configuration gate bypass: allow.put.operations ignored by MCP tool
- Added allowPutOperations @ConfigProperty (defaults to false)
- Tool now refuses to execute when flag is false, matching REST PUT behavior
- Prevents MCP from flipping deployments mutation posture by default
- Integration profiles enable flag for test suite via getConfigOverrides()
4. Unbounded JSON payload on update AND pre-existing gap on create
- Added validateMaxLength(architectureJson, MAX_JSON_PAYLOAD_LENGTH) to updateArchitecture
- Closed pre-existing gap in createArchitecture with same validation
- Tests cover both paths
All 46 unit tests pass.
---------
Co-authored-by: Matthew Bain <66839492+rocketstack-matt@users.noreply.github.com>1 parent e7bb3ab commit 43d3f27
7 files changed
Lines changed: 405 additions & 47 deletions
File tree
- calm-hub/src
- integration-test/java/integration
- main/java/org/finos/calm/mcp/tools
- test/java/org/finos/calm/mcp/tools
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
22 | 30 | | |
23 | 31 | | |
Lines changed: 49 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
368 | 368 | | |
369 | 369 | | |
370 | 370 | | |
371 | | - | |
| 371 | + | |
372 | 372 | | |
373 | 373 | | |
374 | 374 | | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
375 | 417 | | |
376 | 418 | | |
377 | 419 | | |
| |||
385 | 427 | | |
386 | 428 | | |
387 | 429 | | |
388 | | - | |
| 430 | + | |
389 | 431 | | |
390 | 432 | | |
391 | 433 | | |
392 | 434 | | |
393 | 435 | | |
394 | 436 | | |
395 | 437 | | |
396 | | - | |
| 438 | + | |
397 | 439 | | |
398 | 440 | | |
399 | 441 | | |
400 | 442 | | |
401 | 443 | | |
402 | 444 | | |
403 | 445 | | |
404 | | - | |
| 446 | + | |
405 | 447 | | |
406 | 448 | | |
407 | 449 | | |
408 | 450 | | |
409 | 451 | | |
410 | 452 | | |
411 | 453 | | |
412 | | - | |
| 454 | + | |
413 | 455 | | |
414 | 456 | | |
415 | 457 | | |
| |||
418 | 460 | | |
419 | 461 | | |
420 | 462 | | |
421 | | - | |
| 463 | + | |
422 | 464 | | |
423 | 465 | | |
424 | 466 | | |
| |||
427 | 469 | | |
428 | 470 | | |
429 | 471 | | |
430 | | - | |
| 472 | + | |
431 | 473 | | |
432 | 474 | | |
433 | 475 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
24 | 30 | | |
Lines changed: 49 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
328 | 328 | | |
329 | 329 | | |
330 | 330 | | |
331 | | - | |
| 331 | + | |
332 | 332 | | |
333 | 333 | | |
334 | 334 | | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
335 | 377 | | |
336 | 378 | | |
337 | 379 | | |
| |||
345 | 387 | | |
346 | 388 | | |
347 | 389 | | |
348 | | - | |
| 390 | + | |
349 | 391 | | |
350 | 392 | | |
351 | 393 | | |
352 | 394 | | |
353 | 395 | | |
354 | 396 | | |
355 | 397 | | |
356 | | - | |
| 398 | + | |
357 | 399 | | |
358 | 400 | | |
359 | 401 | | |
360 | 402 | | |
361 | 403 | | |
362 | 404 | | |
363 | 405 | | |
364 | | - | |
| 406 | + | |
365 | 407 | | |
366 | 408 | | |
367 | 409 | | |
368 | 410 | | |
369 | 411 | | |
370 | 412 | | |
371 | 413 | | |
372 | | - | |
| 414 | + | |
373 | 415 | | |
374 | 416 | | |
375 | 417 | | |
| |||
378 | 420 | | |
379 | 421 | | |
380 | 422 | | |
381 | | - | |
| 423 | + | |
382 | 424 | | |
383 | 425 | | |
384 | 426 | | |
| |||
387 | 429 | | |
388 | 430 | | |
389 | 431 | | |
390 | | - | |
| 432 | + | |
391 | 433 | | |
392 | 434 | | |
393 | 435 | | |
| |||
Lines changed: 100 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
34 | 44 | | |
35 | 45 | | |
36 | 46 | | |
| |||
129 | 139 | | |
130 | 140 | | |
131 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 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 | + | |
132 | 231 | | |
133 | 232 | | |
134 | 233 | | |
| |||
141 | 240 | | |
142 | 241 | | |
143 | 242 | | |
| 243 | + | |
144 | 244 | | |
145 | 245 | | |
146 | 246 | | |
| |||
0 commit comments