Skip to content

copilot: apply the CopilotCliCommand policy to Linux packages and the… - #342660

Merged
Don Jayamanne (DonJayamanne) merged 1 commit into
release/1.143from
don/merge-linux-changes
Oct 19, 2026
Merged

Don Jayamanne (DonJayamanne) merged 1 commit into
release/1.143from
don/merge-linux-changes

Conversation

@DonJayamanne

Copy link
Copy Markdown
Contributor

… macOS shim (#342101)

  • linux: expose the Copilot shim in DEB/RPM packages

Honor Linux installation policy and preserve the official installer PATH. Manage Stable and Insiders command ownership through guarded package lifecycle hooks.

Add native runtime regressions and a focused package lifecycle harness while leaving deferred packaging formats and non-Linux behavior unchanged.

  • test: fix Copilot package launcher and rendering checks

Use a scenario-local profile for root launcher validation and ignore disabled shell comments when checking unresolved package placeholders. Preserve strict helper validation and add focused regressions.

  • copilot: apply the CopilotCliCommand policy to Linux packages and the macOS shim

The Linux DEB/RPM scripts now ask the shim for the CopilotCliCommand policy before managing /usr/bin/copilot, matching Windows setup: a disabled policy removes a link to either edition's shim instead of creating one, and an unreadable policy leaves the entry unchanged. DEB packages add a preseedable /add-copilot-command debconf question (medium priority, default true) that lets an edition opt out; hand-over on removal respects the other edition's answer and the policy.

The shim gains --vscode-shim policy, which exits 0 when the policy allows the command and 10 when it turns it off, and reads the policy on macOS from the configuration-profile domains of every quality (ported from #341916).

  • test: drop rendering tests that only exercised the harness validator

Keep the checks of the real link helper source and the DEB/RPM templates; the removed cases tested the package-lifecycle harness's own validator rather than product code.

  • copilot: bump the shim to 0.1.2

main's #342224 and this branch both changed the shim and bumped it from 0.1.0 to 0.1.1. Windows setup keeps a published shim whose file version matches, so the merged shim needs its own version to replace main's 0.1.1.


… macOS shim (#342101)

* linux: expose the Copilot shim in DEB/RPM packages

Honor Linux installation policy and preserve the official installer PATH. Manage Stable and Insiders command ownership through guarded package lifecycle hooks.

Add native runtime regressions and a focused package lifecycle harness while leaving deferred packaging formats and non-Linux behavior unchanged.

Co-authored-by: Copilot <[email protected]>

* test: fix Copilot package launcher and rendering checks

Use a scenario-local profile for root launcher validation and ignore disabled shell comments when checking unresolved package placeholders. Preserve strict helper validation and add focused regressions.

Co-authored-by: Copilot <[email protected]>

* copilot: apply the CopilotCliCommand policy to Linux packages and the macOS shim

The Linux DEB/RPM scripts now ask the shim for the CopilotCliCommand policy
before managing /usr/bin/copilot, matching Windows setup: a disabled policy
removes a link to either edition's shim instead of creating one, and an
unreadable policy leaves the entry unchanged. DEB packages add a preseedable
<package>/add-copilot-command debconf question (medium priority, default true)
that lets an edition opt out; hand-over on removal respects the other
edition's answer and the policy.

The shim gains `--vscode-shim policy`, which exits 0 when the policy allows
the command and 10 when it turns it off, and reads the policy on macOS from
the configuration-profile domains of every quality (ported from #341916).

Co-authored-by: Don Jayamanne <[email protected]>
Co-authored-by: Copilot <[email protected]>

* test: drop rendering tests that only exercised the harness validator

Keep the checks of the real link helper source and the DEB/RPM templates;
the removed cases tested the package-lifecycle harness's own validator
rather than product code.

Co-authored-by: Copilot <[email protected]>

* copilot: bump the shim to 0.1.2

main's #342224 and this branch both changed the shim and bumped it from 0.1.0
to 0.1.1. Windows setup keeps a published shim whose file version matches, so
the merged shim needs its own version to replace main's 0.1.1.

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Don Jayamanne <[email protected]>
Co-authored-by: Copilot <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 19, 2026 19:37
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

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

Raymond Zhao (@rzhao271)

Matched files:

  • resources/linux/debian/postinst.template
  • resources/linux/debian/postrm.template
  • resources/linux/debian/templates.template
  • resources/linux/rpm/code.spec.template

Dmitriy Vasyura (@dmitrivMS)

Matched files:

  • test/sanity/README.md
  • test/sanity/fixtures/copilot-shim-fixture-plan.example.json
  • test/sanity/fixtures/copilot-shim-fixtures.schema.json
  • test/sanity/package.json
  • test/sanity/scripts/provision-copilot-shim-runner.sh
  • test/sanity/scripts/run-copilot-shim-container.sh
  • test/sanity/src/copilotShim.test.ts
  • test/sanity/src/copilotShimFixtures.ts
  • test/sanity/src/copilotShimHarness.ts
  • test/sanity/src/copilotShimHelper.test.ts
  • test/sanity/src/copilotShimHelperIndex.ts
  • test/sanity/src/copilotShimIndex.ts
  • test/sanity/src/copilotShimRendering.test.ts
  • test/sanity/src/copilotShimRendering.ts
  • test/sanity/src/copilotShimRenderingIndex.ts
  • test/sanity/src/copilotShimRuntime.ts
  • test/sanity/src/generateCopilotShimFixtures.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.

🔵 Needs a closer look

Privileged package lifecycles and native macOS policy integration warrant human validation, and two test-infrastructure defects remain unresolved.

2 open issues
What changed in this PR

Extends CopilotCliCommand enforcement to Linux packages and the macOS shim, with focused package-lifecycle regression coverage.

Changes:

  • Adds policy-aware DEB/RPM command ownership and a Debian opt-out.
  • Adds native policy readers and a policy-query command while preserving Linux installer PATH.
  • Adds fixture generation, isolated lifecycle tests, documentation, and shim version 0.1.2.
File Description
test/​sanity/​src/​generateCopilotShimFixtures.ts Generates package fixtures and provenance.
test/​sanity/​src/​copilotShimRuntime.ts Stores lifecycle runner configuration.
test/​sanity/​src/​copilotShimRenderingIndex.ts Runs rendering checks.
test/​sanity/​src/​copilotShimRendering.ts Validates embedded helpers and lifecycle calls.
test/​sanity/​src/​copilotShimRendering.test.ts Checks production templates and escaping.
test/​sanity/​src/​copilotShimIndex.ts Configures the focused lifecycle runner.
test/​sanity/​src/​copilotShimHelperIndex.ts Runs helper tests.
test/​sanity/​src/​copilotShimHelper.test.ts Covers policy, opt-out, and hand-over.
test/​sanity/​src/​copilotShimFixtures.ts Defines and validates fixture manifests.
test/​sanity/​src/​copilotShim.test.ts Covers package ownership and lifecycle behavior.
test/​sanity/​scripts/​run-copilot-shim-container.sh Launches isolated container tests.
test/​sanity/​scripts/​provision-copilot-shim-runner.sh Provisions disposable-runner markers.
test/​sanity/​README.md Documents fixtures and test execution.
test/​sanity/​package.json Adds focused test and generation commands.
test/​sanity/​fixtures/​copilot-shim-fixtures.schema.json Defines the fixture manifest schema.
test/​sanity/​fixtures/​copilot-shim-fixture-plan.example.json Provides an example fixture plan.
src/​vs/​workbench/​contrib/​chat/​browser/​chat.shared.contribution.ts Updates the policy description.
src/​vs/​platform/​agentHost/​common/​agentHostPolicySupport.ts Updates the policy-support comment.
resources/​linux/​rpm/​code.spec.template Adds RPM lifecycle hooks.
resources/​linux/​debian/​templates.template Adds the Debian opt-out question.
resources/​linux/​debian/​postrm.template Handles removal and hand-over.
resources/​linux/​debian/​postinst.template Applies policy and installation preference.
resources/​linux/​copilot-link.sh Manages guarded shared-command ownership.
copilot_shim/​tests/​pty.rs Tests inherited Linux installer PATH.
copilot_shim/​tests/​native_policy.rs Adds isolated native-policy regression coverage.
copilot_shim/​src/​runtime.rs Delegates to platform policy readers.
copilot_shim/​src/​policy.rs Implements Linux and macOS policy readers.
copilot_shim/​src/​lib.rs Registers the policy module.
copilot_shim/​src/​invocation.rs Parses the policy command.
copilot_shim/​src/​install.rs Preserves Linux installer PATH.
copilot_shim/​src/​candidate.rs Restricts production PATH filtering to non-Linux Unix.
copilot_shim/​src/​app.rs Reports policy status and adds regressions.
copilot_shim/​SHIM_POST_INSTALL.md Explains platform-specific installer behavior.
copilot_shim/​REQUIREMENTS.md Documents policy and lifecycle contracts.
copilot_shim/​Cargo.toml Adds dependencies and bumps the shim version.
copilot_shim/​Cargo.lock Locks dependencies and version changes.
build/​lib/​policies/​policyData.jsonc Updates exported policy wording.
build/​gulpfile.vscode.linux.ts Embeds the helper in package templates.

Review effort: Balanced

@DonJayamanne
Don Jayamanne (DonJayamanne) merged commit fb521ad into release/1.143 Oct 19, 2026
51 checks passed
@DonJayamanne
Don Jayamanne (DonJayamanne) deleted the don/merge-linux-changes branch October 19, 2026 20:45
@vs-code-engineering vs-code-engineering Bot added this to the 1.143.0 milestone Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants