console: keep the reviewed "nothing to update" sentence byte for byte (#358)
249d942d added rate_limit to the instance PATCH's empty-body sentence, an unreviewed edit that the root moves copy gate (TestMovesLegacyExemptionsAreLegacy) refuses. The sentence is restored to its text at the base; rate_limit stays in the rail's condition, so a body carrying only rate_limit is still accepted. The test now asserts the 400 and the unchanged sentence.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 files changed,
+6
−4
internal/console/apiinstances.go+1 −1internal/console/apiinstances_ratelimit_test.go+5 −3
CI cancelled — superseded by a newer push — run details
CI log
=== gate === .amadan/test-gate.sh amadan: job cancelled — a newer push superseded it
diff --git a/internal/console/apiinstances.go b/internal/console/apiinstances.go| index bfab13f29..41cba2081 100644 |
| --- a/internal/console/apiinstances.go |
| +++ b/internal/console/apiinstances.go |
| @@ -2011,7 +2011,7 @@ func (s *Server) handleAPIInstanceUpdate(w http.ResponseWriter, r *http.Request) |
| if req.Addrs == nil && req.Probe == nil && req.Steering == nil && req.Environment == nil && req.Gate == nil && |
| req.RateLimit == nil { |
| jsonError(w, http.StatusBadRequest, |
| - "nothing to update — send addrs, probe, steering, environment, gate, rate_limit, or a combination") |
| + "nothing to update — send addrs, probe, steering, environment, gate, or a combination") |
| return |
| } |
| var probe *provision.Health |
diff --git a/internal/console/apiinstances_ratelimit_test.go b/internal/console/apiinstances_ratelimit_test.go| index 78523146a..02723d54e 100644 |
| --- a/internal/console/apiinstances_ratelimit_test.go |
| +++ b/internal/console/apiinstances_ratelimit_test.go |
| @@ -101,10 +101,12 @@ func TestPatchRateLimitSetsAndClears(t *testing.T) { |
| t.Fatalf("stored rate_limit after clear = %+v, want nil", rec.RateLimit) |
| } |
| - // The empty-body rail names rate_limit among the patchable fields. |
| + // An empty body is still refused, in the sentence as reviewed: rate_limit |
| + // joins the rail's condition, not its wording. |
| status, _, out = rawReq(t, http.MethodPatch, pu, token, `{}`) |
| - if status != http.StatusBadRequest || !strings.Contains(out, "rate_limit") { |
| - t.Fatalf("empty patch = %d %s, want 400 naming rate_limit", status, out) |
| + const nothing = "nothing to update — send addrs, probe, steering, environment, gate, or a combination" |
| + if status != http.StatusBadRequest || jsonErrorText(t, out) != nothing { |
| + t.Fatalf("empty patch = %d %s, want 400 %q", status, out, nothing) |
| } |
| } |