Commit 4b7cafc
feat(BA-5829): convert AppConfigFragment GQL mutations to bulk-only (BEP-1052 §3)
BEP-1052 §3 specifies every write as bulk; the single-item mutations
previously exposed are replaced with the five bulk mutations below.
Internal service / repository single-row methods remain (bulk actions
loop over them with per-item transactions) so only the external GQL
surface is touched in this commit.
GQL mutations:
- `adminBulkCreateAppConfigFragments(input)` — any scope
- `adminBulkUpdateAppConfigFragments(input)` — any scope
- `adminBulkPurgeAppConfigFragments(input)` — absent keys no-oped
- `bulkCreateMyAppConfigFragments(input)` — USER + current_user, recomputed AppConfig
- `bulkUpdateMyAppConfigFragments(input)` — USER + current_user, recomputed AppConfig
Each item runs in its own transaction; failures collected per-item
in `failed: [AppConfigFragmentBulkError!]!`.
Service / Processor additions:
- `data/app_config_fragment/bulk_types.py` — per-item / error dataclasses
- `services/app_config_fragment/actions/admin_bulk_{create,update,purge}.py`
+ `bulk_{create,update}_my.py` — 5 actions + results
- `AppConfigFragmentService.admin_bulk_create` / `admin_bulk_update` /
`admin_bulk_purge` / `bulk_create_my` / `bulk_update_my` — loop over
admin repo; per-item try / except; my-path recomputes merged view.
- `AppConfigFragmentProcessors` wires the 5 new processors +
`supported_actions()` extended.
DTO additions (`common/dto/manager/v2/app_config_fragment/`):
- `AdminAppConfigFragmentItemInput`, `AdminBulkCreate/Update/PurgeAppConfigFragmentsInput`
- `MyAppConfigFragmentItemInput`, `BulkCreate/UpdateMyAppConfigFragmentsInput`
- `AppConfigFragmentBulkError`, `PurgeAppConfigFragmentKey`
- `AdminBulkCreate/Update/PurgeAppConfigFragmentsPayload`
`BulkCreate/UpdateMyAppConfigFragmentsPayload` live in
`common/dto/manager/v2/app_config/response.py` next to `AppConfigNode`
to avoid a circular import (they carry recomputed `AppConfigNode`s).
Adapter additions (`api/adapters/app_config_fragment.py`):
- `admin_bulk_create` / `admin_bulk_update` / `admin_bulk_purge` /
`my_bulk_create` / `my_bulk_update` — convert v2 DTO input →
service bulk items → service result → v2 DTO payload.
`my_bulk_*` resolve the current user via `current_user()`.
GQL types added under `api/gql/app_config_fragment/types/`:
- `bulk_inputs.py` — 7 input types
- `bulk_payloads.py` — 5 payload types + `AppConfigFragmentBulkErrorGQL`
+ `PurgeAppConfigFragmentKeyGQL`
Five new root mutations registered in `schema.py`; the three prior
single-item mutations (`adminCreate/Update/PurgeAppConfigFragment`)
are removed along with their resolvers.
REST bulk surface lands next in BA-5830.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 2fd3c48 commit 4b7cafc
21 files changed
Lines changed: 1176 additions & 77 deletions
File tree
- src/ai/backend
- common/dto/manager/v2
- app_config_fragment
- app_config
- manager
- api
- adapters
- gql
- app_config_fragment
- resolver
- types
- data/app_config_fragment
- services/app_config_fragment
- actions
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| |||
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| 31 | + | |
| 32 | + | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
| |||
Lines changed: 28 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| 20 | + | |
| 21 | + | |
17 | 22 | | |
18 | 23 | | |
19 | 24 | | |
| |||
55 | 60 | | |
56 | 61 | | |
57 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
2 | 6 | | |
3 | 7 | | |
4 | 8 | | |
| 9 | + | |
| 10 | + | |
5 | 11 | | |
| 12 | + | |
6 | 13 | | |
7 | 14 | | |
8 | 15 | | |
9 | 16 | | |
10 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
11 | 22 | | |
12 | 23 | | |
13 | 24 | | |
14 | 25 | | |
15 | 26 | | |
| 27 | + | |
16 | 28 | | |
17 | 29 | | |
18 | 30 | | |
| |||
25 | 37 | | |
26 | 38 | | |
27 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
28 | 48 | | |
29 | 49 | | |
30 | 50 | | |
31 | 51 | | |
32 | 52 | | |
33 | 53 | | |
| 54 | + | |
| 55 | + | |
34 | 56 | | |
35 | 57 | | |
36 | 58 | | |
37 | 59 | | |
| 60 | + | |
38 | 61 | | |
39 | 62 | | |
40 | 63 | | |
| 64 | + | |
41 | 65 | | |
42 | 66 | | |
43 | 67 | | |
| |||
Lines changed: 52 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
17 | 21 | | |
18 | 22 | | |
19 | 23 | | |
| 24 | + | |
| 25 | + | |
20 | 26 | | |
| 27 | + | |
21 | 28 | | |
22 | 29 | | |
23 | 30 | | |
| |||
77 | 84 | | |
78 | 85 | | |
79 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
80 | 132 | | |
81 | 133 | | |
82 | 134 | | |
| |||
Lines changed: 61 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
18 | 22 | | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
22 | 26 | | |
| 27 | + | |
23 | 28 | | |
24 | 29 | | |
25 | 30 | | |
| |||
89 | 94 | | |
90 | 95 | | |
91 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
92 | 146 | | |
93 | 147 | | |
94 | 148 | | |
95 | 149 | | |
96 | 150 | | |
97 | 151 | | |
98 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
0 commit comments