refactor(repo): adapt call sites to plain-string Repo.State · Entire

refactor(repo): adapt call sites to plain-string Repo.State

6935d79→main·

Soph·1w ago·2 files·+2 added/-6 removed

Repo.State is now OptString (enum dropped for forward-compat), so drop the now-unnecessary string() conversion in repoRow and update the repoDetailRow test to build the field with NewOptString.

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

Sessions

01KWY2E9WF93G0Q5TQEA45W4ERView transcript

[?
Debug CLI Core and Cell API EndpointsClaude Code·Opus 4.8[1m]·8 steps](/content/gh/entireio/cli/session/3813090c-9892-4ed4-9218-0829d87291b1#timeline-01KWY2E9WF93G0Q5TQEA45W4ER/index.html)

Changes

2

39 unmodified lines

40
41
42
43
44
45
46
47
43
44
45
46

39 unmodified lines

var repoColumns = []string{"ID", "NAME", "PROJECT", "CLUSTER", "STATE"}

func repoRow(r coreapi.Repo) []string {
    state := ""
    if v, ok := r.State.Get(); ok {
        state = string(v)
    }
    return []string{r.ID, r.Name, r.OwningProjectId, r.ClusterHost.Or("-"), state}
    return []string{r.ID, r.Name, r.OwningProjectId, r.ClusterHost.Or("-"), r.State.Or("")}
}

// repoDetailColumns / repoDetailRow extend the shared repo view with the

Mcmd/entire/cli/repo.go+1/-5

104 unmodified lines

105
106
107
108
108
109
110
111

104 unmodified lines

OwningProjectId: "01KS6KFJR2XS6PZ188MVYE07AP",
            ClusterHost:     coreapi.NewOptString("aws-us-east-2.entire.io"),
            Path:            coreapi.NewOptString("acme/web"),
            State:           coreapi.NewOptRepoState(coreapi.RepoStateActive),
            State:           coreapi.NewOptString("active"),
        })
        if len(row) != len(repoDetailColumns) {
            t.Fatalf("row has %d cells, want %d (one per column)", len(row), len(repoDetailColumns))

Mcmd/entire/cli/repo_test.go+1/-1