Commit f3cb756
authored
## Summary
Follow-up to PR #660, which was merged at the round-2 commit before this
Codex P1 fix propagated. The orphaned change:
**Codex round-3 P1**: `?rows=` was optional and parsed to `0` when
omitted; `applyKeyVizRowBudget` then treats `budget <= 0` as "no cap"
and returns every tracked route in one payload — defeating the 1024-row
resource guard the cap was supposed to provide. A normal SPA poll
without `?rows=` would fall into this trap.
- `parseKeyVizParams` now pre-seeds `rows = keyVizRowBudgetCap` so an
omitted query parameter inherits the cap.
- `setKeyVizRowsParam` collapses an explicit `rows=0` to the cap so
callers cannot disable the budget by passing 0.
- Godoc updated: omitted / 0 / negative all yield the cap; explicit
values above the cap are silently clamped down.
## Test plan
- [x] `TestKeyVizHandlerOmittedRowsAppliesDefaultCap` — stages
`keyVizRowBudgetCap+5` routes and confirms both the omitted (`""`) and
`?rows=0` forms truncate down to `keyVizRowBudgetCap`.
- [x] Existing `TestKeyVizHandlerHonorsRowsBudget` and
`TestKeyVizHandlerClampsRowsBudgetToCap` still pass — the change is
additive at the default end.
- [x] `go test -race -count=1 ./internal/admin/...` clean.
- [x] `golangci-lint run ./internal/admin/...` clean.
2 files changed
Lines changed: 79 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
| |||
166 | 168 | | |
167 | 169 | | |
168 | 170 | | |
169 | | - | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
170 | 177 | | |
171 | 178 | | |
172 | 179 | | |
| |||
209 | 216 | | |
210 | 217 | | |
211 | 218 | | |
| 219 | + | |
212 | 220 | | |
213 | 221 | | |
214 | 222 | | |
215 | | - | |
216 | | - | |
| 223 | + | |
| 224 | + | |
217 | 225 | | |
218 | | - | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
219 | 230 | | |
220 | 231 | | |
221 | 232 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
294 | 357 | | |
295 | 358 | | |
296 | 359 | | |
| |||
0 commit comments