Repository navigation
fix(desktop): add native client workspace quota endpoint - #7402
Merged
cuisongliu merged 1 commit intoOct 21, 2026
Merged
Conversation
cuisongliu
approved these changes
Oct 21, 2026
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
Native desktop billing overviews fail when the missing
/api/workspace/getQuotaroute returns 404, causing the combined balance/quota request to reject.Add a read-only adapter that authenticates regional tokens, reads the token workspace's ResourceQuota using user RBAC, and returns CPU, memory, storage, Pod and NodePort quotas in the existing client contract, with documented units and error behavior.
Sequence Diagram
sequenceDiagram participant Client as Native desktop participant API as GET /api/workspace/getQuota participant Auth as Regional token verification participant K8s as Kubernetes API Client->>API: Request quota with regional token API->>Auth: Verify token and workspace alt Invalid token Auth-->>API: Reject API-->>Client: Envelope code 401 else Valid token Auth-->>API: User identity and workspaceId API->>K8s: Read quota-workspaceId with user credentials alt Read and normalization succeed K8s-->>API: ResourceQuota status API-->>Client: data.quota in millicores, Mi and counts else Read or normalization fails API-->>Client: Error envelope with data null end endValidation
Passed 27 targeted quota/balance tests, ESLint for all changed TypeScript files, and a focused TypeScript check for quota normalization; deployment and authenticated live-client acceptance remain unverified.