Generate policy data as JSON#272018
Merged
Merged
Conversation
44a4978 to
13514e7
Compare
joaomoreno
reviewed
Oct 20, 2025
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @bpaseroMatched files:
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new system for generating policy data as JSON. Instead of parsing TypeScript source files at build time using tree-sitter, the system now exports policy definitions at runtime and uses the resulting JSON file as input for policy generation.
Key changes:
- Added a new
--export-policy-datacommand-line flag that exports policy definitions to JSON - Introduced new data types (
PolicyCategory,LocalizedValue,ExportedPolicyDataDto) to standardize policy representation - Refactored the policy generator to consume JSON instead of parsing TypeScript AST
- Updated all policy definitions to include required
categoryandlocalizationproperties
Reviewed Changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/vs/workbench/contrib/policyExport/electron-browser/policyExport.contribution.ts |
New contribution that handles policy data export on startup when flag is present |
src/vs/workbench/contrib/policyExport/test/node/policyExport.integrationTest.ts |
Integration test verifying exported data matches checked-in file |
src/vs/base/common/policyDto.ts |
New DTO types for serializing policy data to JSON |
src/vs/base/common/policy.ts |
Added PolicyCategory enum and localization structures to IPolicy interface |
build/lib/policies/policyGenerator.ts |
Refactored to parse JSON instead of TypeScript AST |
build/lib/policies/policyData.jsonc |
Generated JSON file containing all policy definitions |
build/lib/policies/copyPolicyDto.ts |
Build script to copy DTO types from src to build folder |
| Test files (multiple) | Updated mock policy definitions with required category and localization fields |
| Configuration files (multiple) | Added category and localization to all production policy definitions |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
bpasero
reviewed
Oct 20, 2025
joaomoreno
approved these changes
Oct 20, 2025
This comment was marked as off-topic.
This comment was marked as off-topic.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Follow-ups
Behaviour Changes