Skip to content

feat: AJDA-2408 add bulk delete ownerless workspaces for organization#87

Merged
ondrajodas merged 4 commits intomainfrom
miro-AJDA-2408
Mar 31, 2026
Merged

feat: AJDA-2408 add bulk delete ownerless workspaces for organization#87
ondrajodas merged 4 commits intomainfrom
miro-AJDA-2408

Conversation

@MiroCillik
Copy link
Copy Markdown
Member

@MiroCillik MiroCillik commented Mar 27, 2026

Summary

  • Adds new manage:delete-organization-ownerless-workspaces command that bulk-deletes sandboxes with inactive token owners across all projects in an organization
  • Creates temporary storage tokens per project, identifies sandboxes whose creator token no longer exists, and deletes them (with their underlying storage workspaces)
  • Supports dry-run (default), --force, and --includeShared options

Test plan

  • Run dry-run against a test organization and verify correct sandboxes are identified
  • Run with --force and verify sandboxes and storage workspaces are deleted
  • Verify --includeShared flag includes shared sandboxes
  • Verify 403 on project access is handled gracefully

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@linear
Copy link
Copy Markdown

linear bot commented Mar 27, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an organization-scoped CLI maintenance command to identify and optionally delete “ownerless” sandboxes (where the creator token no longer exists), including deletion of underlying Storage API workspaces, across all projects in an organization.

Changes:

  • Introduces manage:delete-organization-ownerless-workspaces with dry-run default, --force, and --includeShared.
  • For each organization project: creates a temporary storage token, scans sandboxes, deletes associated storage workspaces + sandboxes (when forced), and prints a summary.
  • Registers the new command in cli.php.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/Keboola/Console/Command/DeleteOrganizationOwnerlessWorkspaces.php New command implementing org-wide scan + (optional) deletion of ownerless sandboxes and their underlying workspaces.
cli.php Adds the new command to the Symfony Console application.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

MiroCillik and others added 3 commits March 27, 2026 14:59
- Skip sandbox on 403 when checking token (warn instead of treating as ownerless)
- Validate organizationId is numeric before casting
- Move "Working token" log to verbose-only output

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@MiroCillik MiroCillik requested a review from ondrajodas March 30, 2026 07:46
Copy link
Copy Markdown
Contributor

@ondrajodas ondrajodas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ondrajodas ondrajodas merged commit 34f2f13 into main Mar 31, 2026
1 check passed
@ondrajodas ondrajodas deleted the miro-AJDA-2408 branch March 31, 2026 08:39
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.

3 participants