Commit 6d7715b
authored
fix: follow deployment boundary rules and fail fast (wxo) (#12539)
* feat(wxo): filter configs to key_value_creds, surface type and environment, harden mapper contract
Service layer (service.py):
- Filter list_configs to only return connections with security_scheme == "key_value_creds" in both tenant and deployment scopes
- Surface `environment` field alongside `type` in provider_data for config list items
- Normalize security_scheme via _normalize_optional_text to handle SDK enum/tuple quirks
- Extract _warn_if_expected_ids_missing helper to deduplicate staleness warnings
- Remove defensive isinstance checks on provider responses (trust the provider)
- Replace conflicting-binding error with last-write-wins (app_to_connection_id.update)
- Deduplicate connection IDs before calling get_drafts_by_ids
Mapper layer (mapper.py):
- Fail fast with HTTP 500 if config list item is missing a truthy `type`
- Conditionally include `environment` in shaped config list payload
Payloads (payloads.py):
- Add `environment: str | None` field to WatsonxApiConfigListItem with normalizing validator
Tests:
- Add test for deployment-scope key_value_creds filtering (mixed security schemes)
- Add test for tenant-scope key_value_creds filtering (oauth2 excluded)
- Add test for environment metadata passthrough in mapper and service
- Add tests for provider failure paths (tenant list failure, None response, tool fetch failure)
- Add tests for edge cases (latest-binding-wins, skip enrichment with no connections, malformed detailed connection)
- Update mapper tests to assert fail-fast on missing type
- Update existing fixtures to include security_scheme where required by new filtering
* refactor(deployments): move flow-version tool_name into provider_data
Move provider tool_name from a top-level flow-version response field into
provider_data, aligning API ownership boundaries for provider-originated
non-persisted fields.
- Remove top-level tool_name from DeploymentFlowVersionListItem
- Add tool_name to WatsonxApiDeploymentFlowVersionItemData with normalization
- Update WXO mapper to shape tool_name under provider_data
- Update frontend attachments type and consumer to read provider_data.tool_name
- Update backend tests for new response contract location
- Add explicit RULES.md requirement for non-persisted provider data placement
* make environment required
* refactor list configs method and fix broken tests1 parent 2203a99 commit 6d7715b
14 files changed
Lines changed: 1363 additions & 288 deletions
File tree
- src
- backend
- base/langflow
- api/v1
- mappers/deployments
- watsonx_orchestrate
- schemas
- services/adapters/deployment/watsonx_orchestrate
- core
- tests/unit
- api/v1
- services/deployment
- frontend/src
- controllers/API/queries/deployments
- pages/MainPage/pages/deploymentsPage/components
- lfx/src/lfx/services/adapters/deployment
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
412 | 412 | | |
413 | 413 | | |
414 | 414 | | |
| 415 | + | |
415 | 416 | | |
416 | 417 | | |
417 | 418 | | |
| |||
556 | 557 | | |
557 | 558 | | |
558 | 559 | | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
Lines changed: 47 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| |||
60 | 59 | | |
61 | 60 | | |
62 | 61 | | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
176 | 180 | | |
177 | 181 | | |
178 | 182 | | |
| |||
1007 | 1011 | | |
1008 | 1012 | | |
1009 | 1013 | | |
1010 | | - | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
1011 | 1028 | | |
1012 | 1029 | | |
1013 | 1030 | | |
1014 | | - | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
1015 | 1034 | | |
1016 | 1035 | | |
1017 | 1036 | | |
| |||
1093 | 1112 | | |
1094 | 1113 | | |
1095 | 1114 | | |
1096 | | - | |
1097 | | - | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
1098 | 1119 | | |
1099 | 1120 | | |
1100 | 1121 | | |
| |||
1159 | 1180 | | |
1160 | 1181 | | |
1161 | 1182 | | |
1162 | | - | |
1163 | | - | |
| 1183 | + | |
| 1184 | + | |
1164 | 1185 | | |
1165 | 1186 | | |
1166 | 1187 | | |
1167 | | - | |
| 1188 | + | |
| 1189 | + | |
1168 | 1190 | | |
1169 | 1191 | | |
1170 | 1192 | | |
| |||
1178 | 1200 | | |
1179 | 1201 | | |
1180 | 1202 | | |
| 1203 | + | |
1181 | 1204 | | |
| 1205 | + | |
1182 | 1206 | | |
1183 | | - | |
1184 | | - | |
1185 | | - | |
1186 | | - | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
1187 | 1210 | | |
1188 | 1211 | | |
1189 | 1212 | | |
1190 | 1213 | | |
1191 | | - | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
1192 | 1218 | | |
1193 | 1219 | | |
1194 | 1220 | | |
| |||
1225 | 1251 | | |
1226 | 1252 | | |
1227 | 1253 | | |
1228 | | - | |
1229 | | - | |
1230 | | - | |
1231 | | - | |
1232 | | - | |
1233 | | - | |
1234 | | - | |
1235 | | - | |
1236 | | - | |
1237 | | - | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
1238 | 1262 | | |
1239 | 1263 | | |
1240 | 1264 | | |
| |||
Lines changed: 31 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
| |||
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
30 | 39 | | |
31 | 40 | | |
32 | 41 | | |
| |||
452 | 461 | | |
453 | 462 | | |
454 | 463 | | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
474 | 468 | | |
475 | 469 | | |
476 | 470 | | |
| |||
520 | 514 | | |
521 | 515 | | |
522 | 516 | | |
| 517 | + | |
523 | 518 | | |
524 | 519 | | |
525 | 520 | | |
| |||
528 | 523 | | |
529 | 524 | | |
530 | 525 | | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
531 | 542 | | |
532 | 543 | | |
533 | 544 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
334 | | - | |
| 334 | + | |
335 | 335 | | |
336 | | - | |
| 336 | + | |
337 | 337 | | |
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
342 | | - | |
| 342 | + | |
343 | 343 | | |
344 | 344 | | |
345 | 345 | | |
| |||
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | 361 | | |
371 | 362 | | |
372 | 363 | | |
| |||
0 commit comments