Skip to content

Add bounded project context telemetry - #785

Merged
Nikola Metulev (nmetulev) merged 10 commits into
mainfrom
nmetulev-project-telemetry-proposal
Sep 3, 2026
Merged

Nikola Metulev (nmetulev) merged 10 commits into
mainfrom
nmetulev-project-telemetry-proposal

Conversation

@nmetulev

Copy link
Copy Markdown
Member

Summary

  • add a bounded project-context classifier for init, run, restore, update, and package
  • emit a correlated, low-cardinality ProjectContext_Event with project family, app framework, target kind, detection source, confidence, packaging, and run execution mode
  • keep NuGet-driven dotnet run classified as a source project while preserving its actual folder execution mode
  • pass an allow-listed framework hint from evaluated NuGet/MSBuild properties (UseWinUI, UseWPF, UseWindowsForms, and UseMaui)

Privacy boundaries

  • never emit project names, paths, repository identities, authors, versions, dependency lists, or source contents
  • inspect only recognized metadata files, capped at 512 KB, in the selected directory and at most eight ancestors
  • stop ancestor lookup at a Git repository boundary
  • normalize every transmitted value through a fixed allow-list
  • skip project classification entirely when telemetry is opted out

Validation

  • affected CLI tests: 262 passed, 1 environment-dependent test skipped
  • project-context unit and command-wiring tests: 28 passed
  • NuGet target and package-layout Pester tests: 33 passed
  • NativeAOT x64/ARM64 build and generated documentation completed successfully

The broader manifest/identity-command coverage from the proposal is intentionally deferred; this draft contains the agreed first phase.

Classify bounded project metadata for project-aware commands and correlate the normalized context with command telemetry. Pass evaluated framework hints from the NuGet run bridge without sending project identity.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 923fbfbb-b851-45be-b9f5-f07200840410
Use Path.Join for fixed child metadata paths and express JSON dependency and WinUI binding checks with LINQ.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 923fbfbb-b851-45be-b9f5-f07200840410
@github-actions

github-actions Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Build Metrics Report

Binary Sizes

Artifact Baseline Current Delta
CLI (ARM64) 39.16 MB 39.26 MB 📈 +110.5 KB (+0.28%)
CLI (x64) 39.27 MB 39.37 MB 📈 +104.5 KB (+0.26%)
MSIX (ARM64) 16.23 MB 16.27 MB 📈 +40.4 KB (+0.24%)
MSIX (x64) 17.25 MB 17.28 MB 📈 +35.7 KB (+0.20%)
NPM Package 33.77 MB 33.85 MB 📈 +83.2 KB (+0.24%)
NuGet Package 33.88 MB 33.97 MB 📈 +87.1 KB (+0.25%)

Test Results

✅ 4695 passed, 5 skipped out of 4700 tests in 643.4s (+23 tests, +47.8s vs. baseline)

Test Coverage

✅ 89.3% line coverage, 82.4% branch coverage · ✅ no change vs. baseline

CLI Startup Time

49ms median (x64, winapp --version) · ✅ -5ms vs. baseline

Try This Build

Installs the MSIX for your architecture, replacing any previously installed build. Needs the GitHub CLI — the command offers to install it and sign you in if it is missing.

& ([scriptblock]::Create((irm https://raw.githubusercontent.com/microsoft/winappCli/main/scripts/winapp-pr.ps1))) 785
Switching between builds often?

Put the tool on your PATH once:

& ([scriptblock]::Create((irm https://raw.githubusercontent.com/microsoft/winappCli/main/scripts/winapp-pr.ps1))) -AddToPath

Then this build is just:

winapp-pr 785

Run winapp-pr with no arguments to pick from a list of open PRs.


Updated 2026-09-03 19:08:14 UTC · commit 8788eb9 · workflow run

Treat valid package.json values with unsupported root or nested shapes as unknown project context instead of failing project-aware commands.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 923fbfbb-b851-45be-b9f5-f07200840410
Use Path.Join consistently for fixed child paths throughout the new project context tests.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 923fbfbb-b851-45be-b9f5-f07200840410
@nmetulev
Nikola Metulev (nmetulev) marked this pull request as ready for review August 26, 2026 23:23
Copilot AI balanced review requested due to automatic review settings August 26, 2026 23:23

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

Adds privacy-bounded project-context telemetry across core CLI workflows.

Changes:

  • Classifies project family, framework, packaging, target, and execution mode.
  • Wires telemetry into five commands and NuGet-driven runs.
  • Adds tests and privacy documentation.

Reviewed changes

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

Show a summary per file
File Description
src/winapp-NuGet/tests/NuGet.Tests.ps1 Tests framework hint propagation.
src/winapp-NuGet/build/Microsoft.Windows.SDK.BuildTools.WinApp.targets Passes evaluated framework categories.
src/winapp-CLI/WinApp.Cli/Telemetry/Events/ProjectContextEvent.cs Defines the normalized telemetry event.
src/winapp-CLI/WinApp.Cli/Services/ProjectContextDetector.cs Implements bounded metadata classification.
src/winapp-CLI/WinApp.Cli/Services/ProjectContext.cs Defines classification models.
src/winapp-CLI/WinApp.Cli/Services/IProjectContextDetector.cs Defines the detector contract.
src/winapp-CLI/WinApp.Cli/Helpers/HostBuilderExtensions.cs Registers the detector service.
src/winapp-CLI/WinApp.Cli/Commands/WinAppRootCommand.cs Adds the hidden framework hint option.
src/winapp-CLI/WinApp.Cli/Commands/UpdateCommand.cs Emits update context.
src/winapp-CLI/WinApp.Cli/Commands/RunCommand.cs Emits run and NuGet context.
src/winapp-CLI/WinApp.Cli/Commands/RestoreCommand.cs Emits restore context.
src/winapp-CLI/WinApp.Cli/Commands/PackageCommand.cs Emits packaging context.
src/winapp-CLI/WinApp.Cli/Commands/InitCommand.cs Emits initialization context.
src/winapp-CLI/WinApp.Cli.Tests/TelemetryEventsTests.cs Tests event normalization and emission.
src/winapp-CLI/WinApp.Cli.Tests/RunCommandTests.cs Updates dependencies and stabilizes cancellation testing.
src/winapp-CLI/WinApp.Cli.Tests/ProjectContextDetectorTests.cs Tests classification behavior.
src/winapp-CLI/WinApp.Cli.Tests/ProjectContextCommandTelemetryTests.cs Tests command wiring and opt-out behavior.
docs/telemetry.md Documents collected categories and privacy boundaries.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Preserve project detector evidence for direct init paths and make project context logging tests independent of the user's telemetry opt-out setting.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 923fbfbb-b851-45be-b9f5-f07200840410
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.

4 participants