From bd80beeb48c1f4f2f6ebbd2b440f1b1f5df83c09 Mon Sep 17 00:00:00 2001 From: Josh Spicer <23246594+joshspicer@users.noreply.github.com> Date: Wed, 1 Apr 2026 16:06:35 -0700 Subject: [PATCH] policyExport: add `included` flag to PolicyDto output (#307240) * policyExport: add 'included' flag to PolicyDto output Add the `included` boolean field to the exported `PolicyDto` so that downstream consumers (docs website, UI generators) can determine whether a policy-managed setting is also user-configurable. - `included: false` means the setting is policy-only (e.g. `ExtensionGalleryServiceUrlConfigKey` which sets `included: false` on its configuration schema). - `included: true` (the default) means the setting appears in the normal Settings UI in addition to being policy-manageable. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * policyExport: update policyData.jsonc with included flag Regenerate the checked-in policyData.jsonc to include the new 'included' field on every policy entry, matching the export logic. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- build/lib/policies/policyData.jsonc | 57 ++++++++++++------- .../contrib/policyExport/common/policyDto.ts | 7 +++ .../policyExport.contribution.ts | 2 + 3 files changed, 47 insertions(+), 19 deletions(-) diff --git a/build/lib/policies/policyData.jsonc b/build/lib/policies/policyData.jsonc index 23e21914f05..84c357c7a45 100644 --- a/build/lib/policies/policyData.jsonc +++ b/build/lib/policies/policyData.jsonc @@ -50,7 +50,8 @@ } }, "type": "string", - "default": "" + "default": "", + "included": false }, { "key": "chat.mcp.gallery.serviceUrl", @@ -64,7 +65,8 @@ } }, "type": "string", - "default": "" + "default": "", + "included": false }, { "key": "extensions.allowed", @@ -78,7 +80,8 @@ } }, "type": "object", - "default": "*" + "default": "*", + "included": true }, { "key": "chat.tools.global.autoApprove", @@ -92,7 +95,8 @@ } }, "type": "boolean", - "default": false + "default": false, + "included": true }, { "key": "chat.tools.eligibleForAutoApproval", @@ -106,7 +110,8 @@ } }, "type": "object", - "default": {} + "default": {}, + "included": true }, { "key": "chat.mcp.access", @@ -139,7 +144,8 @@ "none", "registry", "all" - ] + ], + "included": true }, { "key": "chat.extensionTools.enabled", @@ -153,7 +159,8 @@ } }, "type": "boolean", - "default": true + "default": true, + "included": true }, { "key": "chat.agent.enabled", @@ -167,7 +174,8 @@ } }, "type": "boolean", - "default": true + "default": true, + "included": true }, { "key": "chat.editMode.hidden", @@ -181,7 +189,8 @@ } }, "type": "boolean", - "default": true + "default": true, + "included": true }, { "key": "chat.useHooks", @@ -195,7 +204,8 @@ } }, "type": "boolean", - "default": true + "default": true, + "included": true }, { "key": "chat.tools.terminal.enableAutoApprove", @@ -209,7 +219,8 @@ } }, "type": "boolean", - "default": true + "default": true, + "included": true }, { "key": "update.mode", @@ -247,7 +258,8 @@ "manual", "start", "default" - ] + ], + "included": true }, { "key": "telemetry.telemetryLevel", @@ -285,7 +297,8 @@ "error", "crash", "off" - ] + ], + "included": true }, { "key": "telemetry.feedback.enabled", @@ -299,7 +312,8 @@ } }, "type": "boolean", - "default": true + "default": true, + "included": true }, { "key": "workbench.browser.enableChatTools", @@ -313,7 +327,8 @@ } }, "type": "boolean", - "default": false + "default": false, + "included": true }, { "key": "github.copilot.nextEditSuggestions.enabled", @@ -327,7 +342,8 @@ } }, "type": "boolean", - "default": true + "default": true, + "included": true }, { "key": "github.copilot.chat.reviewSelection.enabled", @@ -341,7 +357,8 @@ } }, "type": "boolean", - "default": true + "default": true, + "included": true }, { "key": "github.copilot.chat.reviewAgent.enabled", @@ -355,7 +372,8 @@ } }, "type": "boolean", - "default": true + "default": true, + "included": true }, { "key": "github.copilot.chat.claudeAgent.enabled", @@ -369,7 +387,8 @@ } }, "type": "boolean", - "default": true + "default": true, + "included": true } ] } diff --git a/src/vs/workbench/contrib/policyExport/common/policyDto.ts b/src/vs/workbench/contrib/policyExport/common/policyDto.ts index 0408c74fc6e..2f8e0add693 100644 --- a/src/vs/workbench/contrib/policyExport/common/policyDto.ts +++ b/src/vs/workbench/contrib/policyExport/common/policyDto.ts @@ -25,6 +25,13 @@ export interface PolicyDto { type?: string | string[]; default?: unknown; enum?: string[]; + + /** + * When `false`, the setting is not user-configurable and can only be + * managed via policy. Downstream consumers (e.g. docs website) can use + * this to hide the setting from their UI. Defaults to `true`. + */ + included?: boolean; } export interface ExportedPolicyDataDto { diff --git a/src/vs/workbench/contrib/policyExport/electron-browser/policyExport.contribution.ts b/src/vs/workbench/contrib/policyExport/electron-browser/policyExport.contribution.ts index e78e85ab2b4..10e196dd8e0 100644 --- a/src/vs/workbench/contrib/policyExport/electron-browser/policyExport.contribution.ts +++ b/src/vs/workbench/contrib/policyExport/electron-browser/policyExport.contribution.ts @@ -99,6 +99,7 @@ export class PolicyExportContribution extends Disposable implements IWorkbenchCo type: schema.type, default: schema.default, enum: schema.enum, + included: schema.included !== false, }); } } @@ -129,6 +130,7 @@ export class PolicyExportContribution extends Disposable implements IWorkbenchCo }, type: 'boolean', default: true, + included: true, }); added++; }