Commit Graph

12 Commits

Author SHA1 Message Date
Josh Spicer
fcbabe4c73 Merge extension-provided policy (#306874)
* Add merge script for extension configuration policies from distro

Adds build/lib/policies/mergeExtensionPolicies.ts which fetches the
distro's product.json (at the commit pinned in package.json) and merges
extensionConfigurationPolicy entries into policyData.jsonc.

The --export-policy-data step only captures policies from the OSS
configuration registry. Extension policies (e.g., Copilot settings)
are defined in vscode-distro's product.json and are not available in
the OSS dev build. This merge script bridges that gap.

Workflow: ./scripts/code.sh --export-policy-data && node build/lib/policies/mergeExtensionPolicies.ts

Also updates:
- policyExport integration test to run the merge step
- add-policy skill documentation with extension policy lifecycle

* Simplify extension policy format: drop localization block from distro

- mergeExtensionPolicies.ts now reads only description/category from
  the distro and synthesizes localization key/value pairs internally
- Integration test gracefully skips merge step when distro is unavailable
- Updated SKILL.md to document the simplified distro format

* docs: use gh auth token in policy export command

* Handle old distro format missing description/category fields

* docs: add troubleshooting section for merge step in policy skill

* Require description and category fields in extension policy entries

* Add extension configuration policies to policyData.jsonc

* Address PR feedback: fix disclaimer, log targetPath, strip GITHUB_TOKEN from test

* fix: revert extension policies from policyData.jsonc, remove console.log from test

Extension policies should only be added after the distro PR merges.
Test runner disallows console output in tests.

* Add mock distro test for mergeExtensionPolicies, remove merge from export test

- mergeExtensionPolicies.ts: add DISTRO_PRODUCT_JSON env var to
  override the distro path (for testing without private repo access)
- New test: creates a mock product.json, runs the merge script,
  verifies policies are added correctly and idempotently
- Export test: no longer runs the merge step (avoids needing
  distro access or GITHUB_TOKEN in CI)

* Update distro and regenerate policyData.jsonc with extension policies

* Fix CI: add extension policy fixture for export test

The export test now runs mergeExtensionPolicies using a checked-in
fixture file instead of requiring distro access or GITHUB_TOKEN.
When extension policies change in the distro, regenerate both
policyData.jsonc and the fixture file.

* Integrate extension policy merge into --export-policy-data

- Removed mergeExtensionPolicies.ts — no separate CLI tool needed
- --export-policy-data now reads build/lib/policies/extensionPolicies.json
  and merges extension policies into the output automatically
- Single command workflow: ./scripts/code.sh --export-policy-data
- Simplified test — no merge step, no GITHUB_TOKEN, no distro access
- Updated SKILL.md to document the simplified workflow

* Dynamic distro reading: --export-policy-data fetches from distro directly

- policyExport.contribution.ts reads distro product.json dynamically:
  1. DISTRO_PRODUCT_JSON env var (for testing)
  2. .build/distro/mixin/stable/product.json (local checkout)
  3. GitHub API with GITHUB_TOKEN (remote fetch)
- New scripts/export-policy-data.sh wrapper: sets up GITHUB_TOKEN
  via gh CLI and runs the export
- Deleted build/lib/policies/extensionPolicies.json (no static copy)
- Test uses DISTRO_PRODUCT_JSON with a fixture file
- Uses sandbox process.env and VSBuffer (renderer-safe)

* Replace bash wrapper with cross-platform TS script

- New build/lib/policies/exportPolicyData.ts: handles transpilation,
  GITHUB_TOKEN setup via gh CLI, and runs --export-policy-data
- Added 'npm run export-policy-data' script to package.json
- Removed scripts/export-policy-data.sh
- Updated SKILL.md and test error message

* Use OAuth device flow for GitHub token acquisition

exportPolicyData.ts now acquires tokens via:
1. GITHUB_TOKEN env var (if set)
2. gh CLI (fast, non-interactive)
3. GitHub OAuth device flow (interactive, no dependencies)

Based on vscode-copilot-chat's getToken.mts pattern.

* Fix error messages to reference npm run export-policy-data

* Fix disclaimer to reference npm run export-policy-data, clean up stale refs

* Clarify test fixture is static and not expected to track distro changes

* Add inline comment in test clarifying fixture is static

* SKILL.md: add step to update distro commit hash in package.json

* Remove inline comment per PR feedback

* Remove local .build/distro/ fallback path per PR feedback
2026-04-01 00:07:47 +00:00
Josh Spicer
975cdcf8fe policy: DeprecatedEditModeHidden (#300290)
* Add 'DeprecatedEditModeHidden' policy

* Add 'add-policy' skill
2026-03-10 00:38:04 +00:00
Kyle Cutler
bc3b68862d Apply policy to browser tools setting (#297591)
* Apply policy to browser tools setting

* update policy jsonc
2026-02-25 09:34:50 -08:00
Megan Rogge
345315625d update yolo mode description to include autoReply link (#296097) 2026-02-19 18:26:57 +00:00
Paul
252f81c0f1 Update hook settings (#294732) 2026-02-11 16:51:35 -08:00
Sandeep Somavarapu
3fb76cabd4 fix #290501 (#291876)
* fix #290501

* Revert "fix #290501"

This reverts commit 3f0ce7842e.
2026-01-30 14:31:13 +00:00
Josh Spicer
37b74ec64d tweaks to #282623 (#282889)
* update chat.agent.enabled description

* code suggestions

* includeDisabled bug
2025-12-11 23:02:42 +00:00
Copilot
0dd53ee568 Add policy configuration for chat.tools.eligibleForAutoApproval (#277238)
* Initial plan

* Add policy configuration for chat.tools.eligibleForAutoApproval setting

Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>

* Update policy generation tests for chat.tools.eligibleForAutoApproval

Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>

* restore fixtures

* restore test

* fix minimumVersion

* do not add chat prompt files

* rerun --export-policy-data

* polish

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
2025-11-14 02:21:17 +00:00
Copilot
8fd821a0c7 Remove experimental badge from prompt file support (#272541)
* Initial plan

* Remove chat.promptFiles setting and experimental tags from prompt file settings

Co-authored-by: digitarald <8599+digitarald@users.noreply.github.com>

* Fix compilation errors - remove unused imports and fix variable references

Co-authored-by: digitarald <8599+digitarald@users.noreply.github.com>

* Update policy data file to remove chat.promptFiles entry

Co-authored-by: digitarald <8599+digitarald@users.noreply.github.com>

* remove unused collectAgentInstructionsOnly

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: digitarald <8599+digitarald@users.noreply.github.com>
Co-authored-by: Harald Kirschner <hkirschner@microsoft.com>
Co-authored-by: Martin Aeschlimann <martinae@microsoft.com>
2025-10-23 10:22:25 +02:00
Paul
d72d6a2424 Generate policy data as JSON (#272368) 2025-10-21 12:48:33 -07:00
Paul
6025703c6a Revert "Generate policy data as JSON" (#272362) 2025-10-20 16:12:10 -07:00
Paul
99c299e880 Generate policy data as JSON (#272018) 2025-10-20 14:38:48 -07:00