Split policy telemetry by delivery source - #328140
Open
Harald Kirschner (digitarald) wants to merge 7 commits into
Open
Split policy telemetry by delivery source#328140Harald Kirschner (digitarald) wants to merge 7 commits into
Harald Kirschner (digitarald) wants to merge 7 commits into
Conversation
Preserve policyCount as the legacy effective total while adding administrator, account, and account-gate family counts. Track the winning source through account and multiplex policy services, including source-only transitions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2773b969-fe4a-4671-a0a1-1fc69b1968f3
Copilot started reviewing on behalf of
Harald Kirschner (digitarald)
July 30, 2026 00:27
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Adds privacy-safe telemetry counts that distinguish administrator, account, and account-gate policy sources while preserving the existing total.
Changes:
- Introduces policy source tracking through account and multiplex services.
- Adds source-partitioned telemetry fields.
- Expands policy source tests.
Show a summary per file
| File | Description |
|---|---|
policy.ts |
Defines the policy source API. |
multiplexPolicyService.ts |
Propagates winning policy sources. |
accountPolicyService.ts |
Resolves and tracks account policy sources. |
policyTelemetry.contribution.ts |
Reports partitioned policy counts. |
accountPolicyService.test.ts |
Tests account, managed, and gate attribution. |
multiplexPolicyService.test.ts |
Tests multiplexed source selection. |
policyTelemetryContribution.test.ts |
Tests source-family telemetry counts. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 1
- Review effort level: Medium
Make administrator, account, and account-gate counts the canonical policy.applied schema. Values without explicit provenance are excluded instead of being attributed to administrators. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2773b969-fe4a-4671-a0a1-1fc69b1968f3
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2773b969-fe4a-4671-a0a1-1fc69b1968f3
Centralize policy value and source transitions in AbstractPolicyService and isolate account-specific source resolution. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1ced0d45-0ef0-4c69-843f-9951452d9b92
Josh Spicer (joshspicer)
previously approved these changes
Aug 5, 2026
Josh Spicer (joshspicer)
enabled auto-merge (squash)
August 5, 2026 21:58
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes microsoft/vscode-internalbacklog#8655
Summary
policyCountaggregate inpolicy.appliedwith seven mutually exclusive source counts:devicePolicyCount,nativeMdmPolicyCount,serverManagedSettingsPolicyCount,fileManagedSettingsPolicyCount,mixedManagedSettingsPolicyCount,accountPolicyCount, andaccountGatePolicyCount.AccountPolicyServiceandMultiplexPolicyService, including source-only transitions where the effective value does not change.AbstractPolicyService, while leaving account-gate and managed-settings attribution inAccountPolicyService.Rationale
The aggregate count conflated device policy, managed-settings delivery channels, GitHub account policy, and approved-account gate restrictions. The replacement fields make each effective source independently measurable without logging policy names, values, organizations, URLs, or other high-cardinality data.
devicePolicyCountrepresents direct VS Code policy. Native MDM, GitHub server-delivered managed settings, and file-based managed settings each have their own count; policies jointly caused by multiple managed-settings channels usemixedManagedSettingsPolicyCount.accountPolicyCountcovers GitHub account policy and entitlement data, whileaccountGatePolicyCountcovers effective values forced by an unsatisfied approved-account gate.Validation
npm run typecheck-clientnpm run transpile-client./scripts/test.sh --run src/vs/platform/policy/test/common/policy.test.ts --run src/vs/workbench/services/policies/test/browser/accountPolicyService.test.ts --run src/vs/workbench/services/policies/test/browser/multiplexPolicyService.test.ts --run src/vs/workbench/services/policies/test/browser/policyTelemetryContribution.test.ts(45 passing)git diff --check