Add incrementality tracking support and more detailed analysis of the build errors reported#13057
Merged
YuliiaKovalova merged 9 commits intomainfrom Jan 20, 2026
Merged
Conversation
… build errors reported
Contributor
There was a problem hiding this comment.
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
TargetExecutionStatsstruct to track target execution status and skip reasons (OutputsUpToDate, ConditionWasFalse, PreviouslyBuilt) - Implemented
BuildIncrementalityInfowith 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 |
MichalPavlik
approved these changes
Jan 20, 2026
This was referenced Mar 11, 2026
This was referenced Mar 11, 2026
Closed
Open
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.
Extend VS telemetry to include build incrementality and more detailed build errors analysis.