The backend entry knew its type and the CLI dropped it - #59
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 wordbackend, so the server carries the backend type on the entry itself.configShowViewnever decoded that field, so the one entry whose identity its address cannot hold rendered asbackend · backend.How
configShowEntryViewand decodetype.label(), which appends the backend type when there is one —backend local, the same pairconfig_init's summary already prints (renderers.go:2390).Non-backend entries have no
typeand read exactly as before.Lockstep
Pairs with turfbuild/doof#137, which made the backend a plot unit and put
typeon theconfig_showentry for both dialects (plot and tofu). The field isomitempty, so this renderer is correct against an older server too — it just never sees the field.That PR also removed
config_show'sconfigmap;configShowViewnever decoded it, so nothing here breaks and nothing here needed to change for it.Verified
go vet ./...clean; new testsTestConfigShow_BackendCarriesItsTypeandTestConfigShow_SingleBackendSummarypass, as do the renderer guard tests (TestEveryTurfToolHasRenderer,TestEveryRendererLeadsWithTitle,TestRenderers_BadJSONFallsBack).TestPermissionListsMatchServerAnnotationsreportsturf_action_trigger/turf_action_untriggermissing frompreApprovedTurfTools. Red on cleanmainlocally; it skips in CI (no server on PATH).