chore(control-plane): reconcile crud-gaps work onto friendly-names resolver · Entire
chore(control-plane): reconcile crud-gaps work onto friendly-names resolver
42c3eb4→main·
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](/content/gh/entireio/cli/session/8e196be2-884b-4372-a672-2e81e2857e10#timeline-ae2378c10239/index.html)
Changes
2
cmd/entire/cli
Mcorecmd_delete_test.go+14
Mresolveref_test.go+1
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) {
\tt.Helper()
\tw.Header().Set("Content-Type", "application/problem+json")
\tw.WriteHeader(http.StatusNotFound)
\tif _, err := fmt.Fprintf(w, `{"status":%d,"detail":"not found"}`, http.StatusNotFound); err != nil {
\t\tt.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