Skip to content

The backend entry knew its type and the CLI dropped it - #59

Merged
EronWright merged 1 commit into
mainfrom
config-show-backend-type
Sep 19, 2026
Merged

EronWright merged 1 commit into
mainfrom
config-show-backend-type

Conversation

@EronWright

Copy link
Copy Markdown
Contributor

What

config_show's index gives every entry an address that spells out its type — random_pet.this, module.vpc, var.region. The backend is the exception: its address is the bare word backend, so the server carries the backend type on the entry itself. configShowView never decoded that field, so the one entry whose identity its address cannot hold rendered as backend · backend.

How

  • Hoist the anonymous entry struct into a named configShowEntryView and decode type.
  • Give it label(), which appends the backend type when there is one — backend local, the same pair config_init's summary already prints (renderers.go:2390).
  • Route both the detail rows and the single-entry compact summary through it: a single-address query is the shape this is usually read in, and with results hidden that line is the whole answer.

Non-backend entries have no type and read exactly as before.

Lockstep

Pairs with turfbuild/doof#137, which made the backend a plot unit and put type on the config_show entry for both dialects (plot and tofu). The field is omitempty, so this renderer is correct against an older server too — it just never sees the field.

That PR also removed config_show's config map; configShowView never decoded it, so nothing here breaks and nothing here needed to change for it.

Verified

  • go vet ./... clean; new tests TestConfigShow_BackendCarriesItsType and TestConfigShow_SingleBackendSummary pass, as do the renderer guard tests (TestEveryTurfToolHasRenderer, TestEveryRendererLeadsWithTitle, TestRenderers_BadJSONFallsBack).
  • Full suite: one pre-existing failure unrelated to this change — TestPermissionListsMatchServerAnnotations reports turf_action_trigger / turf_action_untrigger missing from preApprovedTurfTools. Red on clean main locally; it skips in CI (no server on PATH).

config_show's index gives every entry an address that spells out its type —
random_pet.this, module.vpc, var.region. The backend is the exception: its
address is the bare word "backend", so the server carries the backend type on
the entry instead. configShowView never decoded that field, so the one entry
whose identity its address cannot hold rendered as "backend · backend".

Hoist the anonymous entry struct into configShowEntryView, decode `type`, and
give it a label() that appends the backend type when there is one — "backend
local", the same pair config_init's summary already prints. Both the detail rows
and the single-entry compact summary go through it, since a single-address query
is the shape this is usually read in.
@EronWright
EronWright marked this pull request as ready for review September 19, 2026 00:04
@EronWright
EronWright merged commit 5b64a30 into main Sep 19, 2026
6 checks passed
@EronWright
EronWright deleted the config-show-backend-type branch September 19, 2026 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant