Skip to content

Add policy support for linux - #272579

Merged
Paul (pwang347) merged 1 commit into
mainfrom
pawang/policiesLinux
Oct 22, 2025
Merged

Paul (pwang347) merged 1 commit into
mainfrom
pawang/policiesLinux

Conversation

@pwang347

@pwang347 Paul (pwang347) commented Oct 22, 2025 •

Copy link
Copy Markdown
Contributor

Description

Add support for JSON policy generation and loading for Linux OS. The file must be loaded from /etc/vscode/policy.json.

@pwang347
Paul (pwang347) marked this pull request as ready for review October 22, 2025 18:38
Copilot AI review requested due to automatic review settings October 22, 2025 18:38
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Benjamin Pasero (@bpasero)

Matched files:

  • src/vs/code/electron-main/main.ts
  • src/vs/code/node/cliProcessMain.ts

Robo (@deepak1556)

Matched files:

  • src/vs/code/electron-main/main.ts
  • src/vs/code/node/cliProcessMain.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds Linux policy support by enabling JSON-based policy generation and loading from /etc/vscode/policy.json. The changes extend the existing policy infrastructure to support Linux alongside the existing Windows (registry-based) and macOS (plist-based) implementations.

Key Changes:

  • Added Linux-specific policy initialization in CLI and Electron main processes
  • Implemented JSON policy rendering for all policy types
  • Created build infrastructure to generate Linux policy files

Reviewed Changes

Copilot reviewed 34 out of 34 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/vs/code/node/cliProcessMain.ts Added Linux policy service initialization using FilePolicyService with system path
src/vs/code/electron-main/main.ts Added Linux policy service initialization in main Electron process
src/vs/base/common/policy.ts Defined constant for Linux system policy file path
build/lib/policies/types.ts Added renderJsonValue method to Policy interface
build/lib/policies/booleanPolicy.ts Implemented renderJsonValue returning false for boolean policies
build/lib/policies/numberPolicy.ts Implemented renderJsonValue returning default numeric value
build/lib/policies/stringPolicy.ts Implemented renderJsonValue returning empty string
build/lib/policies/stringEnumPolicy.ts Implemented renderJsonValue returning first enum value
build/lib/policies/objectPolicy.ts Implemented renderJsonValue returning empty string for object policies
build/lib/policies/basePolicy.ts Added abstract renderJsonValue method declaration
build/lib/policies/render.ts Added renderJsonPolicies function to generate JSON policy object
build/lib/policies/policyGenerator.ts Added linuxMain function and linux platform support to CLI
build/lib/test/*.test.ts Added tests for JSON value rendering across all policy types
build/lib/test/fixtures/policies/linux/policy.json Added fixture file for Linux policy JSON validation

Comment thread src/vs/code/node/cliProcessMain.ts Resolved
Comment thread src/vs/code/electron-main/main.ts Resolved
@vs-code-engineering vs-code-engineering Bot added this to the October 2025 milestone Oct 22, 2025
@pwang347
Paul (pwang347) merged commit e81696f into main Oct 22, 2025
@pwang347
Paul (pwang347) deleted the pawang/policiesLinux branch October 22, 2025 23:02
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Dec 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants