Gate Throughput Bucket selector on preview registration#3198
Merged
Conversation
Fixes #3189. The Throughput Bucket selector was shown for every non-emulator account, even when the Throughput Buckets preview is not registered on the subscription. Query the subscription feature registration for Microsoft.DocumentDB/ThroughputBuckets and only show the selector when the feature state is Registered; fail closed for emulator, missing Azure metadata, and ARM/authorization errors. Default the webview state to hidden until capability detection resolves.
Contributor
✅ Build (Compile, Lint, Prettier, l10n, Package)🧱 Step Results
📥 Artifacts (run) |
Contributor
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/vitestThe overall coverage in the branch remains at 76%, unchanged from the branch. Show a code coverage summary of the most impacted files.
Updated |
Contributor
🧪 Tests (Unit + Integration)🧪 Results
📈 Coverage |
Contributor
🎭 E2E Tests (Playwright + VS Code)🧪 Result
📥 Artifacts (run)
|
bk201-
previously approved these changes
Jul 13, 2026
…uckets-feature-gate # Conflicts: # package-lock.json # package.json # src/utils/azureClients.ts
bk201-
approved these changes
Jul 14, 2026
Contributor
|
@microsoft-github-policy-service rerun |
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.
Fixes #3189.
Problem
The Throughput Bucket selector in the Query Editor was shown for every non-emulator account, even when the Throughput Buckets preview is not registered on the subscription. Throughput Buckets is a subscription-scoped preview, so the account model alone doesn't indicate whether the feature is usable — resulting in a control that has no effect.
Fix
Microsoft.DocumentDB/ThroughputBucketsand only show the selector when the feature state isRegistered.Implementation notes
@azure/arm-featuresand acreateFeatureClienthelper (masks the subscription ID).throughputBucketsFeature.ts) so it can be unit-tested without VS Code host dependencies.Files
src/cosmosdb/throughputBuckets.ts— connection-aware capability detectionsrc/cosmosdb/throughputBucketsFeature.ts— pure registration predicatesrc/cosmosdb/throughputBuckets.test.ts— unit testssrc/panels/trpc/routers/queryEditorRouter.ts— gate wired into Query Editor initsrc/utils/azureClients.ts—createFeatureClientsrc/webviews/cosmosdb/QueryEditor/state/QueryEditorState.tsx— hidden default statepackage.json/package-lock.json— new dependencyValidation