feat: show the disabled state of deployment targets and workers - #732
Draft
NickJosevski wants to merge 1 commit into
Draft
NickJosevski wants to merge 1 commit into
NickJosevski wants to merge 1 commit into
Conversation
NickJosevski
force-pushed
the
nj/issue-311
branch
from
September 15, 2026 07:25
3c53db2 to
db73ca7
Compare
`enable`/`disable` had no read-back: nothing in the CLI reported whether a target or worker was disabled, so the only way to confirm a toggle was the web UI. Adds the state to every surface that already reports on a machine: - `deployment-target list`, `deployment-target view`, `worker list` and `worker view` gain an IS DISABLED table column, an IsDisabled JSON field, and a "Disabled" line in basic output. - the per-type views (`deployment-target ssh view`, `worker listening-tentacle view`, and the rest) gain a Disabled row; they share one ViewRun each, so that is one line per resource. Follows `tenant list`, which already prints an IS DISABLED column, and names the concept IsDisabled/IS DISABLED/Disabled after the API field on every surface. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
NickJosevski
force-pushed
the
nj/issue-311-show-disabled
branch
from
September 15, 2026 07:30
87bb619 to
fc852af
Compare
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.
Stacked on #694 — merges into
nj/issue-311, notmain. Independent of #731; they touch no files in common.Answers the "should
view/listsurface the disabled state?" question on #694: yes. Without itenable/disablehas no read-back — the only way to confirm a toggle was the web UI.What changed
The state is added to every surface that already reports on a machine:
deployment-target listIS DISABLEDcolumnIsDisableddeployment-target viewIS DISABLEDcolumnIsDisabledDisabled: trueworker listIS DISABLEDcolumnIsDisabledworker viewIS DISABLEDcolumnIsDisabledDisabled: trueThe per-type views (
deployment-target ssh view,worker listening-tentacle view, and the rest) gain aDisabledrow — each set shares oneViewRun, so that is one line per resource.Two deliberate choices:
tenant list, which already prints anIS DISABLEDcolumn — this is not a new idea in the CLI.IsDisabledin JSON,IS DISABLEDin tables,Disabledin basic output — all named after the API field, rather than inverting to "Enabled" on some surfaces.Workers are included because #731 adds
worker enable|disable; shipping that without a way to see the result would recreate the gap this PR closes. Say the word and I'll split them.Test evidence
New tests, all end-to-end through the root command against the mock HTTP server:
pkg/cmd/target/list/list_test.go,pkg/cmd/target/view/view_test.gopkg/cmd/worker/list/list_test.go,pkg/cmd/worker/view/view_test.gopkg/cmd/target/shared/view_test.go,pkg/cmd/worker/shared/view_test.go— one per-type view each, covering the sharedViewRunrow.Each asserts the table column, the JSON field and (where applicable) the basic-output line, for both an enabled and a disabled machine.
go build ./...clean;go test ./pkg/...all pass, no failures.gofmt/go vetreport only pre-existing issues in files this PR does not touch. No live server is required.Note on the rebase
Rebased onto current
main, which had rewrittentarget/list,target/view,worker/listandworker/view(#717 and the worker endpoint fixes). Two things to know:describeTargetType/describeWorkerStyle/machinescommon.GetCommunicationStyleversions.mainalready has internal (package list/package view) test files atlist_test.goandview_test.goin all four directories, so these tests now sit beside them in*_disabled_test.goas external_testpackages. Intarget/viewthey reuse therootResourcethatview_ecs_test.goalready defines rather than declaring a second one.🤖 Generated with Claude Code