feat(console): add workspace block support action - #48462
Closed
heimoshuiyu wants to merge 1 commit into
Closed
Conversation
Contributor
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
heimoshuiyu
force-pushed
the
block-workspace
branch
from
September 11, 2026 08:26
e55e101 to
7bdd9a3
Compare
Contributor
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
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.
Summary
Workspace.blocktopackages/console/core/src/workspace.ts, mirroring the existingWorkspace.unblock(setsis_blocked = true, throws if the workspace does not exist)POST /api/support/actions/block-workspace, mirroringunblock-workspace.ts(bearer auth viaSUPPORT_API_KEY, body{ "workspaceID": "wrk_..." })Motivation
The console already supports unblocking a workspace through the support API, and
zen/util/handler.tsenforcesis_blockedon every Zen API request, but there is no code path that setsis_blocked = true— operators currently have to flip the flag by hand in the database. This adds the missing inverse operation so block/unblock are both first-class support actions.Usage
200—{"success":true,"message":"Workspace blocked"}400— invalid body or workspace not found401— missing/incorrect support keyBlocking is idempotent: an already-blocked workspace still returns 200. Since MySQL reports 0 affected rows for no-op updates,
Workspace.blockfalls back to a select to distinguish "already blocked" (success) from "workspace not found" (400).Note that enforcement happens at the Zen API auth boundary — in-flight streaming responses continue until they finish; only new requests are rejected.
Testing
bun run typecheckinpackages/console/coreandpackages/console/app: no new errors from these files (both packages have pre-existing implicit-any noise from drizzle type inference in this environment)unblock-workspace,delete-account,reset-quota) have no test coverage either