Conversation
- Created PolicyTelemetryReporter to track policy usage - Added PolicyTelemetryContribution as workbench contribution - Wired up telemetry for policy value changes and initial state Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
- Remove DI decorators from PolicyTelemetryReporter constructor - Simplify PolicyTelemetryContribution to directly instantiate reporter - Files now compile without errors Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
- Added comprehensive unit tests for PolicyTelemetryReporter - Fixed contribution ID to use 'workbench.contributions' plural form - Tests verify initial snapshot, policy changes, and data type reporting Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
The TestPolicyService now adds policy definitions when setting values, which allows serialize() to work correctly. This fixes the test failure where 0 policies were being reported instead of 3. Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
Fixed in ad682f3. The issue was that |
|
@copilot still broken!
Error: There are 2 undisposed disposables! |
Two issues fixed: 1. Register _testOnDidChange Emitter via this._register() so it is properly disposed when TestPolicyService is disposed. 2. Use ensureNoDisposablesAreLeakedInTestSuite() return value as the disposable store (matching policyConfiguration.test.ts pattern) instead of creating a separate DisposableStore with manual teardown. Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
... Fixed in 5b59c6f. Two issues:
|
|
warning was created) |
The test was extending AbstractPolicyService, which forced implementing the protected abstract _updatePolicyDefinitions method. The mangler detected that this made the protected field public and rejected the build. Replaced with a lightweight StubPolicyService that implements IPolicyService directly (like NullPolicyService), avoiding any reference to protected members. Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
Fixed in 612e98b. The test was extending |
|
@copilot you got this, just a couple more fixes! Error: [define-class-fields-check] src/vs/platform/policy/test/common/policyTelemetry.test.ts(69,58): error TS2739: Type '{ _serviceBrand: undefined; telemetryLevel: TelemetryLevel.NONE; sessionId: "someValue.sessionId"; machineId: "someValue.machineId"; sqmId: "someValue.sqmId"; devDeviceId: "someValue.devDeviceId"; firstSessionDate: "someValue.firstSessionDate"; sendErrorTelemetry: false; publicLog2(ev: string, data: any): void; }' is missing the following properties from type 'ITelemetryService': publicLog, publicLogError, publicLogError2, setExperimentProperty |
- Create createCapturingTelemetryService() helper that explicitly provides all ITelemetryService methods (publicLog, publicLogError, publicLogError2, setExperimentProperty) instead of relying on spread which loses class prototype methods. - Import ITelemetryService for proper typing. - Remove unused 'reporter' variable in 'reports policy changes' test. Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
Fixed in d9dab14. Three issues addressed:
|
Policy Usage Telemetry Implementation
Adds telemetry instrumentation to track which policies are active and when they change. Enables data-driven analysis of policy adoption across the user base.
Implementation
PolicyTelemetryReporter listens to
IPolicyService.onDidChangeand reports:policyValueSet- per-policy events with name, hasValue flag, and dataTypepolicyConfigurationSnapshot- startup snapshot with count and comma-delimited policy namesPolicyTelemetryContribution initializes the reporter as a workbench contribution after restore phase.
Technical Details
SystemMetaData/FeatureInsight(GDPR compliant)Files
Added:
src/vs/platform/policy/common/policyTelemetry.tssrc/vs/platform/policy/test/common/policyTelemetry.test.tssrc/vs/workbench/contrib/policyTelemetry/browser/Modified:
src/vs/workbench/workbench.common.main.tsOriginal prompt
wire in telemetry so we have data for which policies have the most users, etc.
[Chronological Review: The conversation began with the user asking about the location of a specific `configuration.ts` file that contains all the policy services responsible for resolving policies. The user is currently working within the `configurations.ts` file located in the VSCode repository.][Intent Mapping: The user explicitly requested information about which
configuration.tsfile contains policy services that resolve policies, indicating a need for clarity on the structure and content of configuration files related to policy management.][Technical Inventory: The conversation involves the
vscoderepository owned by Microsoft, specifically focusing on theconfigurations.tsfile located at/Users/jospicer/dev/vscode/src/vs/platform/configuration/common/configurations.ts. The user is interested in understanding the policy services defined within this file.][Code Archaeology: The specific file in question is
configurations.ts, which is part of the VSCode platform configuration. The user is looking for details on policy services, which suggests that the file may contain various configuration settings and service definitions.][Progress Assessment: The user has not yet received a response regarding the specific contents of the
configurations.tsfile related to policy services. The conversation is still in the inquiry phase.][Context Validation: The user is actively seeking information about policy services in the
configurations.tsfile, which is crucial for their understanding of the configuration structure in the VSCode project.][Recent Commands Analysis: The last agent command was the user request for information about the
configuration.tsfile containing policy services. There were no tool results returned yet, as the conversation is ongoing. The immediate pre-summarization state involved the user actively working in theconfigurations.tsfile and seeking specific information about its contents.]1. Conversation Overview: - Primary Objectives: The user requested, "which configuration.ts file has all the policyservices which resolve policy," indicating a need for specific information about policy services in the configuration files. - Session Context: The conversation has focused on identifying the correct `configuration.ts` file that contains policy services, with the user currently engaged in the file located at `/Users/jospicer/dev/vscode/src/vs/platform/configuration/common/configurations.ts`. - User Intent Evolution: The user's intent has remained consistent, seeking clarity on the structure and content of configuration files related to policy management.- Technical Foundation:
- Core Technology: VSCode repository (microsoft/vscode), focusing on the configuration management aspect.
- Environment Detail: The user is working within the
- Codebase Status:
- File Name: configurations.ts
- Purpose: This file is important for defining various configuration settings and services within the VSCode platform.
- Current State: The user is currently examining this file to find specific policy services.
- Key Code Segments: Not specified yet, as the user is still inquiring about the contents.
- Dependencies: The file likely interacts with other configuration files and services within the VSCode architecture.
- Problem Resolution:
- Issues Encountered: The user has not yet received the information they are seeking regarding policy services.
- Solutions Implemented: No solutions have been implemented yet, as the inquiry is still open.
- Debugging Context: No ongoing troubleshooting efforts have been mentioned.
- Lessons Learned: No insights have been shared yet.
- Progress Tracking:
- Completed Tasks: The user has identified the file they are working on but has not yet received the necessary information.
- Partially Complete Work: The inquiry about policy services is still in progress.
- Validated Outcomes: No features or code have been confirmed working through testing yet.
- Active Work State:
- Current Focus: The user is focused on identifying policy services within the
- Recent Context: The last few exchanges involved the user asking about the specific configuration file related to policy services.
- Working Code: The user is examining the
- Immediate Context: The user is seeking specific information about policy services in the configuration file.
- Recent Operations:
- Last Agent Commands: The last command was the user request for information about the
- Tool Results Summary: No tool results have been returned yet, as the conversation is ongoing.
- Pre-Summary State: The agent was actively engaged in responding to the user's inquiry about the
- Ope...
josh/planebranch of the repository, with the default branch beingmain.configurations.tsfile.configurations.tsfile.configuration.tsfile containing policy services.configurations.tsfile.Created from VS Code.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.