Commit 33eaf47
fix(admin): always send dry_run on storage-GC requests
`run_storage_gc` built its body with `dry_run.then_some(true)`. The
generated SDK field is `Option<bool>` carrying
`#[serde(skip_serializing_if = "Option::is_none")]`, so on a live run
(no `--dry-run`) the `None` dropped the key entirely and the CLI posted
`{}` to `POST /api/v1/admin/storage-gc`.
That relied on the server defaulting the field. artifact-keeper#3619
removes that default: `dry_run` becomes required and unknown fields are
rejected, so `{}` is refused with 422 and no GC runs. `ak admin
storage-gc run --dry-run` was always fine — it sent `{"dry_run": true}`.
Send the value unconditionally instead, via a small `storage_gc_body`
helper so the body is testable without a client. A live run now posts
`{"dry_run": false}`, which is what the 1.8.x backend already means by
an empty body, so this is safe to merge before #3619 and required
after it.
The added test asserts both bodies; restoring `then_some(true)` fails
it with `left: Object {}`.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W6pg381RiaM9GsdVEyrN8M1 parent 393be2d commit 33eaf47
2 files changed
Lines changed: 32 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
10 | 14 | | |
11 | 15 | | |
12 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3975 | 3975 | | |
3976 | 3976 | | |
3977 | 3977 | | |
| 3978 | + | |
| 3979 | + | |
| 3980 | + | |
| 3981 | + | |
| 3982 | + | |
| 3983 | + | |
| 3984 | + | |
| 3985 | + | |
| 3986 | + | |
| 3987 | + | |
| 3988 | + | |
| 3989 | + | |
3978 | 3990 | | |
3979 | 3991 | | |
3980 | 3992 | | |
3981 | 3993 | | |
3982 | | - | |
3983 | | - | |
3984 | | - | |
| 3994 | + | |
3985 | 3995 | | |
3986 | 3996 | | |
3987 | 3997 | | |
| |||
7204 | 7214 | | |
7205 | 7215 | | |
7206 | 7216 | | |
| 7217 | + | |
| 7218 | + | |
| 7219 | + | |
| 7220 | + | |
| 7221 | + | |
| 7222 | + | |
| 7223 | + | |
| 7224 | + | |
| 7225 | + | |
| 7226 | + | |
| 7227 | + | |
| 7228 | + | |
| 7229 | + | |
| 7230 | + | |
| 7231 | + | |
7207 | 7232 | | |
7208 | 7233 | | |
7209 | 7234 | | |
| |||
0 commit comments