Commit 987016b
committed
fix: drop Force on selfupgrade patch; wire MCP issues event-opt-in + total_matched
Three reviewer findings on PR #658.
CRITICAL — selfupgrade: Force on StrategicMergePatch always fails
K8s apimachinery rejects PatchOptions.Force on non-Apply patches
(apimachinery/pkg/apis/meta/v1/validation: "may not be specified
for non-apply patch"). The previous "fix" set Force=true on a
StrategicMergePatch, so self-upgrade has been 422'ing on every
call since that commit landed — masking itself as IsInvalid →
HTTP 400 in our error path.
Drop Force; keep FieldManager:"helm". The FieldManager alone is
what fixes the original bug (apiserver no longer derives "radar"
from User-Agent as the .image owner), and Force was never
necessary for that. Server-side apply with ApplyPatchType + Force
would also work, but that's a bigger surface change for no
additional win in the single-field-patch case.
Tripwire test inverts: Force MUST be nil now, not non-nil. If a
refactor flips it back the test catches it before the binary
ships.
IMPORTANT — MCP issues: event source silently empty post-default-off
After events became opt-in, the MCP issues tool kept the audit
opt-in loop but didn't add the parallel IncludeEvents wiring.
ComposeWithStats requires BOTH wantSource(event) AND
IncludeEvents, so an MCP caller passing source:"event" got zero
event rows while HTTP /api/issues was honoring it correctly.
Loop now sets IncludeEvents for SourceEvent (mirroring the audit
case) and defaults Since=1h when events are enabled and no window
was given — matches the HTTP handler's behavior. Updated the
source + since jsonschema descriptions to make the opt-in rules
discoverable to LLM callers.
IMPORTANT — MCP issues: total_matched missing from response
HTTP /api/issues returns total_matched (uncapped count) so the
caller can tell "200 returned" from "200 of 1000". The MCP
response dropped this field, leaving agents blind to truncation.
Add total_matched to the response map; field is already on
ComposeStats so no compose-layer change needed.1 parent 371175f commit 987016b
3 files changed
Lines changed: 49 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
337 | 337 | | |
338 | 338 | | |
339 | 339 | | |
340 | | - | |
| 340 | + | |
341 | 341 | | |
342 | | - | |
| 342 | + | |
343 | 343 | | |
344 | 344 | | |
345 | 345 | | |
| |||
1492 | 1492 | | |
1493 | 1493 | | |
1494 | 1494 | | |
1495 | | - | |
1496 | | - | |
1497 | | - | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
1498 | 1501 | | |
1499 | | - | |
| 1502 | + | |
| 1503 | + | |
1500 | 1504 | | |
1501 | | - | |
| 1505 | + | |
| 1506 | + | |
1502 | 1507 | | |
1503 | 1508 | | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
1504 | 1512 | | |
1505 | 1513 | | |
1506 | 1514 | | |
1507 | 1515 | | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
1508 | 1521 | | |
1509 | 1522 | | |
1510 | 1523 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
23 | 24 | | |
24 | | - | |
25 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
26 | 35 | | |
27 | | - | |
28 | | - | |
| 36 | + | |
29 | 37 | | |
30 | 38 | | |
31 | 39 | | |
| |||
94 | 102 | | |
95 | 103 | | |
96 | 104 | | |
97 | | - | |
98 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
99 | 109 | | |
100 | 110 | | |
101 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 18 | + | |
| 19 | + | |
21 | 20 | | |
22 | 21 | | |
0 commit comments