Skip to content

Add incrementality tracking support and more detailed analysis of the build errors reported#13057

Merged
YuliiaKovalova merged 9 commits intomainfrom
dev/ykovalova/telemetry_build_incrementality
Jan 20, 2026
Merged

Add incrementality tracking support and more detailed analysis of the build errors reported#13057
YuliiaKovalova merged 9 commits intomainfrom
dev/ykovalova/telemetry_build_incrementality

Conversation

@YuliiaKovalova
Copy link
Member

Extend VS telemetry to include build incrementality and more detailed build errors analysis.

@YuliiaKovalova YuliiaKovalova requested a review from a team as a code owner January 19, 2026 11:23
Copilot AI review requested due to automatic review settings January 19, 2026 11:23
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends Visual Studio telemetry to include build incrementality tracking and more detailed build error categorization, enabling better insights into build patterns and failure sources.

Changes:

  • Added TargetExecutionStats struct to track target execution status and skip reasons (OutputsUpToDate, ConditionWasFalse, PreviouslyBuilt)
  • Implemented BuildIncrementalityInfo with classification logic (builds with >70% skipped targets are classified as Incremental)
  • Expanded error categorization from general "MSBuildEngine" to granular categories (MSBuildGeneral, MSBuildEvaluation, MSBuildExecution, MSBuildGraph)
  • Added new error categories for NativeToolchain, CodeAnalysis, Razor, WPF, and AspNet frameworks
  • Refactored error code pattern matching using efficient two-level switch expressions
  • Added comprehensive documentation in VS-Telemetry-Data.md
  • Updated Copilot instructions with performance best practices for switch expressions and span-based parsing

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/Framework/Telemetry/IWorkerNodeTelemetryData.cs Added TargetExecutionStats struct to replace bool for target execution tracking
src/Framework/Telemetry/WorkerNodeTelemetryData.cs Updated AddTarget to handle SkipReason with priority logic (execution > specific skip reason > existing)
src/Framework/Telemetry/WorkerNodeTelemetryEventArgs.cs Updated serialization to include skip reason as int alongside wasExecuted bool
src/Framework/Telemetry/TelemetryDataUtils.cs Added ComputeIncrementalityInfo method with 70% threshold; changed TaskFactoryNames comparer to OrdinalIgnoreCase
src/Framework/Telemetry/BuildInsights.cs Added BuildIncrementalityInfo record, BuildType enum, and expanded ErrorCountsInfo with granular categories
src/Framework.UnitTests/WorkerNodeTelemetryEventArgs_Tests.cs Updated test to use TargetExecutionStats instead of bool values
src/Build/TelemetryInfra/ITelemetryForwarder.cs Added skipReason parameter with default value to AddTarget interface method
src/Build/TelemetryInfra/TelemetryForwarderProvider.cs Forwarded skipReason parameter through to telemetry data
src/Build/BackEnd/Components/Logging/BuildErrorTelemetryTracker.cs Refactored error categorization with two-level switch, added MSB4xxx range granularity, new framework categories
src/Build.UnitTests/Telemetry/Telemetry_Tests.cs Added three tests for incrementality classification: Full, Incremental, and Unknown scenarios
documentation/VS-Telemetry-Data.md New comprehensive documentation of all telemetry data collected by MSBuild
.github/copilot-instructions.md Added performance best practices section with switch expressions, span usage, and conditional compilation examples

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.

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.

3 participants