Consolidate workspace tooling: state check, delete-by-id, external buckets + docs - #106
Open
jirkasemmler wants to merge 2 commits into
Open
Consolidate workspace tooling: state check, delete-by-id, external buckets + docs#106jirkasemmler wants to merge 2 commits into
jirkasemmler wants to merge 2 commits into
Conversation
The "Workspaces and sandboxes" section had drifted from the code and gave no guidance on choosing between the commands, which all look interchangeable from their names but destroy different things. - Explain up front what each command actually destroys: deleting a workspace removes the workspace record and backend user, deleting a configuration (trash + purge) cascades to its workspaces. That distinction is safe for keboola.sandboxes, where the configuration is the sandbox, and destructive for transformation components, where it is the user's code. - Add a "Which command should I use?" table plus rules of thumb, including that the orphaned/ownerless pairs are the same logic at project and organization scope, and that "orphaned" selects purely by component + age. - Document manage:delete-organization-ownerless-workspaces, which existed but was missing from the README entirely. - Drop the storage:delete-project-sandboxes section: the command was removed in a30168d when sandboxes-api was replaced by editor-service sessions, but its documentation stayed behind. - Correct the signatures that no longer matched the code: storage:delete-orphaned-workspaces takes hostname-suffix before until-date and matches a single component, not a list, and has --ignore-backend-errors / --manage-token which were undocumented; manage:delete-organization-workspaces takes component, cutoff and host suffix as options rather than positional arguments, and accepts a comma-separated list of organization IDs; manage:describe-organization-workspaces writes an activeUser column that was missing from the documented header. - Correct manage:mass-delete-project-workspaces: it resolves schemas through editor sessions and purges the parent configuration, it does not queue delete jobs and wait for them. Call out that workspaces without an editor session cannot be found, so its "not found" list is the meaningful output. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ting Consolidates the outstanding workspace tooling into this branch, replacing PRs #92, #98 and #100. Adds three commands and documents them; no existing command is modified. manage:check-project-workspaces-state (read-only) Triage step for a known list of workspaces: reports whether each is still live and whether its configuration is live, trashed or gone, and suggests the follow-up command. Configuration state is resolved per branch, because branches hold independent copies under the same id and merging them misclassifies a config that is live in one branch and trashed in another. Also reports each configuration's most recent job from the Queue API, which is usually what decides whether it is still in use, and runs a sanity query for any job in the project first so that blank lastJob columns are not misread as "never used". manage:delete-project-workspaces-by-id List-driven deletion with layered guards: password-login only unless --any-login-type, optional expected-schema verification, and configuration deletion only behind --with-configuration and only when that configuration owns exactly the listed workspace. Deletes the workspace without touching the configuration by default. A purge refused with storage.components.cannotDeleteConfiguration is counted as failed rather than deleted, since in that case the configuration is still in the trash and its workspace and backend user still exist. manage:list-external-buckets (read-only) Stack-wide CSV audit of external buckets with created date, isReadOnly and whether KBC.description metadata is set. Drops its temporary token even when listing fails, and continues past projects it cannot reach. README gains entries for all three, and the "Which command should I use?" table now points at the by-id command as the preferred list-driven option over manage:mass-delete-project-workspaces, which needs an interactively pasted token per project and always purges the configuration. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This was referenced Jul 30, 2026
Closed
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.
Replaces #92, #98 and #100, which are closed in favour of this branch.
Adds three commands and documents the whole workspace-deletion family. No existing command is modified.
New commands
manage:check-project-workspaces-state(read-only)Triage step for a known list of workspaces: reports whether each is still live and whether its configuration is live, trashed or gone, and suggests the follow-up command.
lastJob*columns are not misread as "never used".manage:delete-project-workspaces-by-idList-driven deletion with layered guards — the intended default for "I have a concrete list of workspaces to remove":
--any-login-typeexpectedSchemaverification per row--with-configuration, and only when that configuration owns exactly the workspace you listedstorage.components.cannotDeleteConfigurationis counted as failed, not deleted — in that case the configuration is still in the trash and its workspace and backend user still existmanage:list-external-buckets(read-only)Stack-wide CSV audit of external buckets with created date,
isReadOnlyand whetherKBC.descriptionmetadata is set. Drops its temporary token even when listing fails, and continues past projects it cannot reach.Documentation
The Workspaces and sandboxes section had drifted from the code and gave no guidance on choosing between commands that all look interchangeable from their names but destroy different things.
keboola.sandboxes, where the configuration is the sandbox; destructive for transformation components, where it is the user's code.*-orphaned-*and*-ownerless-*pairs are each the same selection logic at project vs. organization scope, and "orphaned" detects nothing — it selects purely by component + age.manage:delete-organization-ownerless-workspaces, which existed in code but was missing from the README entirely.storage:delete-project-sandboxessection — that command was deleted in a30168d when sandboxes-api was replaced by editor-service sessions, but its docs stayed behind.storage:delete-orphaned-workspaces—hostname-suffixcomes beforeuntil-date; matches a single component, not a list;--ignore-backend-errors/--manage-tokenwere undocumented.manage:delete-organization-workspaces— component / cutoff / host suffix are options, not positional arguments;organizationIdtakes a comma-separated list.manage:describe-organization-workspaces— documented CSV header was missing theactiveUsercolumn.manage:mass-delete-project-workspaces— it resolves schemas through editor sessions and purges the parent configuration; it does not queue delete jobs and wait for them. Workspaces without an editor session cannot be found, so its "not found" list is the meaningful output.Verification
phpcs,phpstan(level 9),phpunitand a CLI boot check all pass. Verified that all 32 registered commands (setName()+#[AsCommand]) are documented and that the README references no command that does not exist.Not run against any real stack, organization or project — not even in dry-run.
Additional notes
Deliberately not included, so this stays reviewable: merging the project/organization command pairs, retiring
manage:mass-delete-project-workspaces, and a--drop-from-metadatamode that would let the by-id command reachstorage:workspace:drop-failed-workspaces-from-metadatawith an explicit list. That last one is the one genuinely missing capability — today the backend-user purge path is only reachable through the component+age heuristic instorage:delete-orphaned-workspaces --ignore-backend-errors.