Repository navigation
Add devpod status --all - #30
Merged
Merged
Conversation
Show the status of all workspaces of the context in one command, as a table or, with --output json, a list. The statuses are retrieved concurrently within --timeout. A workspace whose status can't be retrieved is shown as Error (with an error field in JSON) and makes the command fail after the others are shown. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Apply --timeout to each workspace's status, so workspaces waiting for one of the concurrent slots no longer time out early, and say that the status timed out instead of "context deadline exceeded". - Succeed with --output json when some statuses failed, since the errors are part of the output, so callers can still use the other statuses. - Load the providers only once instead of once per workspace, which also stops repeating their warnings for each workspace. - Show workspaces whose config can't be loaded as Error instead of silently leaving them out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Retrieve the status of a machine that several workspaces share only once per `devpod status --all`, via a MachineStatusCache in StatusOptions. - Print the "no workspaces" hint to stdout with the table, so all of the plain output can be redirected; the reasons for errors stay on stderr. - Share the most-recently-used ordering between devpod list and ListClients (workspace.SortByLastUsed) instead of copying it. - Split RunAll into allStatuses and printStatuses, and add unit tests for them, for ListClients, SortByLastUsed and the machine status cache. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
devpod status --allshows the status of all workspaces of the current context in one command:devpod list.--timeout. A timeout is reported as "timed out after 30s, you can wait longer via --timeout".--container-statusstill applies. The status of a machine that several workspaces share is only retrieved once.devpod list), so it can be piped; the reasons forErrorrows are warnings on stderr.--output jsonprints a list of the sameWorkspaceStatusobjectsdevpod status --output jsonprints for one workspace.workspace.jsoncan't be loaded, is still listed:Errorwith a warning, and after the others are shown the command exits with an error.errorfield, and the command succeeds, because the errors are part of the output and callers can still use the other statuses.--alltogether with a workspace argument is an error. With no workspaces, plain output prints a hint and JSON prints[].Why
Checking which dev containers are running used to need one
devpod statusper workspace.Notes for reviewers
pkg/workspace.ListClientsreturns a client for each workspace of the context, most recently used first, or the error that prevented it. It loads the providers once, not once per workspace, so warnings about a broken provider aren't repeated for every workspace.ListLocalWorkspacesandloadExistingWorkspaceshare their directory listing and machine loading with it, andFindProvidershares its lookup.workspace.SortByLastUsedis now the one place for the most-recently-used ordering, used bydevpod listtoo.client.StatusOptionsgainsMachineStatuses *MachineStatusCache(json:"-"). The workspace client uses it, when set, to share a machine's status between workspaces; every other caller leaves it nil and behaves as before.client.WorkspaceStatusgainsError string \json:"error,omitempty"`, which only--all` sets, so existing JSON output is unchanged.Testing
DEVPOD_HOME, a workspace with a missing provider, a corruptworkspace.json, no workspaces, an invalid argument and an invalid output format, all in both output formats.up-dockere2e spec "should start a new workspace with existing image" now also checks that the workspace isRunninginstatus --all; it passes locally.ListClients,SortByLastUsedand the machine status cache, and pass with-race.🤖 Generated with Claude Code