Commit e3dc887
fix: Migrate off deprecated GraphQL APIs (#118)
## Summary
- Migrates `stacklet-admin` off GraphQL fields/mutations marked
`@deprecated` in the platform schema, across the repository,
account-group, policy-collection, and binding domains.
- `repository` commands move from the legacy
`repository`/`repositories`/`addRepository`/`removeRepository`/`processRepository`
API to
`repositoryConfig`/`repositoryConfigs`/`addRepositoryConfig`/`removeRepositoryConfig`/`triggerRepositoryScan`.
As a result:
- `repository add` drops `--branch-name`, `--policy-file-suffix`,
`--policy-directory`, `--deep-import` (no longer accepted by
`addRepositoryConfig`).
- `repository process`/`scan`/`show`/`remove` take `--uuid` instead of
`--url`; `repository scan` drops `--start-rev-spec`.
- `account-group` commands move `AccountGroup.items`/`itemCount` to
`accountMappings`, and `addAccountGroupItems`/`removeAccountGroupItems`
to `upsertAccountGroupMappings`/`removeAccountGroupMappings`.
`remove-item` keeps its existing `--uuid`/`--key`/`--provider` interface
via an internal mapping-id lookup (paginated, so it works past the first
page), since the new mutation needs an opaque mapping id. `add-item`
drops `--provider` (unused by the new mutation).
- `policy-collection` commands move `PolicyCollection.items`/`itemCount`
to `policyMappings` (the `add-item`/`remove-item` mutations themselves
were not deprecated, so no CLI interface change there).
- `binding` commands move the deprecated top-level `variables` arg/field
to the structured `executionConfig { variables }`.
- Account and policy commands needed no changes.
## Test plan
- [x] `uv run pytest tests/` — 90 passed
- [x] `uv run ruff check .`
- [x] `uv run ruff format --check .`
- [x] `uv run ty check stacklet/`
- [x] `uv run deptry .`
- [x] **Manual verification against a live local platform deploy** (not
just mocked unit tests):
- `repository list` / `repository show` — confirmed real
`RepositoryConfig` data comes back correctly shaped via
`repositoryConfigs`/`repositoryConfig`.
- `policy-collection list` — confirmed `policyMappings.pageInfo` shape.
- `account-group add` (with `--region`), `add-item`, `show` — confirmed
the new `accountMappings` shape end-to-end (create group → add mapping →
verify mapping visible).
- `account-group remove-item` — confirmed the mapping-id lookup
pre-check resolves correctly and the mapping is actually removed (this
is the path fixed for pagination per Greptile's review comment on this
PR).
- `account-group remove` / `account remove` — cleanup succeeded.
- `binding list` — query accepted by the schema (no existing bindings
locally to exercise the `executionConfig` round-trip on add/update).
- All test data created during manual verification was removed
afterward; no residue left in the shared local deploy.
- Note: `account-group add` requires `--region` for AWS groups —
pre-existing server-side validation unrelated to this migration, just
something to be aware of when testing.
- Not yet exercised manually: `repository add` (needs a reachable git
URL) and `binding add`/`update` (no binding fixture available locally).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>1 parent 697e778 commit e3dc887
8 files changed
Lines changed: 755 additions & 242 deletions
File tree
- stacklet/client/platform
- commands
- graphql/snippets
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
7 | 26 | | |
8 | 27 | | |
9 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
| 7 | + | |
5 | 8 | | |
| 9 | + | |
| 10 | + | |
6 | 11 | | |
| 12 | + | |
7 | 13 | | |
8 | 14 | | |
9 | 15 | | |
| |||
22 | 28 | | |
23 | 29 | | |
24 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
25 | 95 | | |
26 | 96 | | |
27 | 97 | | |
| |||
31 | 101 | | |
32 | 102 | | |
33 | 103 | | |
34 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
35 | 110 | | |
36 | 111 | | |
Lines changed: 81 additions & 75 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
30 | 34 | | |
31 | 35 | | |
32 | 36 | | |
| |||
66 | 70 | | |
67 | 71 | | |
68 | 72 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
76 | 88 | | |
77 | 89 | | |
78 | 90 | | |
| |||
118 | 130 | | |
119 | 131 | | |
120 | 132 | | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
128 | 148 | | |
129 | 149 | | |
130 | 150 | | |
| |||
158 | 178 | | |
159 | 179 | | |
160 | 180 | | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
168 | 196 | | |
169 | 197 | | |
170 | 198 | | |
| |||
189 | 217 | | |
190 | 218 | | |
191 | 219 | | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
199 | 235 | | |
200 | 236 | | |
201 | 237 | | |
| |||
208 | 244 | | |
209 | 245 | | |
210 | 246 | | |
211 | | - | |
212 | | - | |
213 | | - | |
| 247 | + | |
| 248 | + | |
214 | 249 | | |
215 | | - | |
216 | | - | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
217 | 253 | | |
218 | 254 | | |
219 | 255 | | |
220 | | - | |
221 | | - | |
222 | | - | |
| 256 | + | |
223 | 257 | | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | 258 | | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
| 259 | + | |
233 | 260 | | |
234 | 261 | | |
235 | 262 | | |
236 | | - | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
237 | 267 | | |
238 | 268 | | |
239 | 269 | | |
| |||
242 | 272 | | |
243 | 273 | | |
244 | 274 | | |
245 | | - | |
246 | 275 | | |
247 | | - | |
248 | | - | |
| 276 | + | |
249 | 277 | | |
250 | 278 | | |
251 | 279 | | |
252 | 280 | | |
253 | 281 | | |
254 | 282 | | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
| 283 | + | |
| 284 | + | |
263 | 285 | | |
264 | | - | |
265 | | - | |
266 | | - | |
| 286 | + | |
267 | 287 | | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | 288 | | |
283 | 289 | | |
284 | 290 | | |
| |||
288 | 294 | | |
289 | 295 | | |
290 | 296 | | |
291 | | - | |
| 297 | + | |
0 commit comments