chore(control-plane): reconcile crud-gaps work onto friendly-names resolver · Entire

chore(control-plane): reconcile crud-gaps work onto friendly-names resolver

d2eac6d·

toothbrush·3w ago·2 files·+15 added/-0 removed

Rebased onto feat/control-plane-friendly-names, which had independently reworked name resolution to the client-side pickOrg/pickProject design. Kept that resolver and dropped crud-gaps' server-side ?name= variant; this pass adapts the seams: - resolveOrgRef walks all pages (ListOrgs is now paginated) then pickOrg - restore isNotFound + resolvedRefLabel helpers used by the delete commands - writeNotFoundProblem test helper (friendly-names' resolver tests lack it)

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

Sessions

ae2378c10239View transcript

?\ Control Plane Delete and Revoke SafetyClaude Code·Opus 4.8[1m]·1 step

Changes

2

2 unmodified lines

3
4
5
6
7
8
9
9 unmodified lines

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

2 unmodified lines

import (
\t"bytes"
\t"context"
\t"fmt"
\t"net/http"
\t"net/http/httptest"
\t"testing"
9 unmodified lines

// lookup, addressing the resource by id directly.
const testDeleteULID = "01HZX7QABCDEFGHJKMNPQRSTVW"

// writeNotFoundProblem writes a control-plane RFC 7807 404 so the ogen client
// decodes it as *ErrorModelStatusCode (which isNotFound keys on). A bare
// WriteHeader without the problem+json content type would instead surface as a
// decode error.
func writeNotFoundProblem(t *testing.T, w http.ResponseWriter) {
\t t.Helper()
\t w.Header().Set("Content-Type", "application/problem+json")
\t w.WriteHeader(http.StatusNotFound)
\t if _, err := fmt.Fprintf(w, `{\"status\":%d,\"detail\":\"not found\"}`, http.StatusNotFound); err != nil {
\t\t t.Errorf("write problem: %v", err)
\t }
}

// runDeleteCmd points the active-context client at srv via the activeCoreClient
// seam, runs newCmd() with args, and returns its stdout and error. The caller
// must not be parallel: the seam is package-global.

Mcmd/entire/cli/corecmd_delete_test.go+14

1 unmodified line

2
3
4
5
6
7
8

1 unmodified line

import (
\t"context"
\t"fmt"
\t"net/http"
\t"net/http/httptest"
\t"strings"

Mcmd/entire/cli/resolveref_test.go+1