Repository navigation
Honor warning promotion for BuildCheck infrastructure failures - #15616
Open
MattKotsenas wants to merge 2 commits into
Open
MattKotsenas wants to merge 2 commits into
MattKotsenas wants to merge 2 commits into
Conversation
MattKotsenas
temporarily deployed
to
copilot-pat-pool
November 19, 2026 16:37 — with
GitHub Actions
Inactive
MattKotsenas
temporarily deployed
to
copilot-pat-pool
November 19, 2026 16:38 — with
GitHub Actions
Inactive
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Deferred infrastructure warnings can bypass warning-as-error handling, leaving graph results, build-finished status, or out-of-process project results incorrectly successful.
2 open issues
What changed in this PR
Updates BuildCheck infrastructure failure reporting to use MSBuild’s native warning-promotion path while continuing to disable failed checks. It also coordinates deferred diagnostic delivery with build and replay completion.
Changes:
- Preserve originating project context and synchronize deferred warning batches.
- Flush pending diagnostics at coordinator, worker, and replay completion, with revised manager lifetime handling.
- Add regression coverage for promotion, concurrency, diagnostic ordering, and build-manager reuse.
| File | Description |
|---|---|
src/BuildCheck.UnitTests/EndToEndTests.cs |
Adds CLI promotion and worker-failure coverage. |
src/BuildCheck.UnitTests/BuildCheckReplayModeConnectorTests.cs |
Tests deferred diagnostic ordering during replay. |
src/BuildCheck.UnitTests/BuildCheckManagerProviderTests.cs |
Tests matching, reentrant, and concurrent warning drains. |
src/BuildCheck.UnitTests/BuildCheckLifecycleTests.cs |
Covers mixed graph/build sessions and manager reuse. |
src/BuildCheck.UnitTests/BuildCheckCentralContext_Tests.cs |
Removes the obsolete warning-dispatch test stub. |
src/Build/Evaluation/IntrinsicFunctions.cs |
Attaches originating context to check acquisition events. |
src/Build/BuildCheck/Infrastructure/NullBuildCheckManager.cs |
Updates the no-op completion signature. |
src/Build/BuildCheck/Infrastructure/IBuildCheckManager.cs |
Defines completion through a check context. |
src/Build/BuildCheck/Infrastructure/CheckWrapper.cs |
Routes infrastructure warnings through the result reporter. |
src/Build/BuildCheck/Infrastructure/CheckContext/ICheckContext.cs |
Removes direct text-warning dispatch. |
src/Build/BuildCheck/Infrastructure/CheckContext/CheckLoggingContext.cs |
Removes the obsolete logging warning helper. |
src/Build/BuildCheck/Infrastructure/CheckContext/CheckDispatchingContext.cs |
Removes the obsolete replay warning helper. |
src/Build/BuildCheck/Infrastructure/BuildCheckReplayModeConnector.cs |
Flushes pending diagnostics before replayed build completion. |
src/Build/BuildCheck/Infrastructure/BuildCheckManagerProvider.cs |
Defers infrastructure warnings and synchronizes batch ownership. |
src/Build/BuildCheck/Infrastructure/BuildCheckCentralContext.cs |
Routes callback failures through the result reporter. |
src/Build/BackEnd/Node/OutOfProcNode.cs |
Releases the provider through its component factory. |
src/Build/BackEnd/Components/RequestBuilder/RequestBuilder.cs |
Supplies originating request identity before evaluation. |
src/Build/BackEnd/Components/BuildRequestEngine/BuildRequestEngine.cs |
Flushes worker diagnostics even after deactivation failures. |
src/Build/BackEnd/BuildManager/BuildManager.cs |
Adds completion drains and retains the manager through logging shutdown. |
src/Build.UnitTests/BackEnd/MockHost.cs |
Allows tests to inject a BuildCheck provider. |
src/Build.UnitTests/BackEnd/BuildRequestEngine_Tests.cs |
Tests worker failure cleanup and shared-manager ownership. |
Review effort: Balanced
Route callback and configuration failures through result reporting so project warning policy is available before ordinary submission completion. Keep checker containment and warnings-by-default behavior. Preserve deferred diagnostics at coordinator, worker and replay completion, including failed worker deactivation, without changing telemetry finalization policy. Add real-checker promotion and diagnostic-preservation regressions.
MattKotsenas
force-pushed
the
bugfix/buildcheck-infrastructure-warning-promotion
branch
from
November 24, 2026 22:52
f62ac6c to
d3b252b
Compare
This branch was previously deployed
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.


Related issue(s): #15575
Context
This PR lets BuildCheck infrastructure warnings honor MSBuild's project-level warning settings, including treating warnings as errors. Failures during configuration, initialization, action registration, or callback execution remain contained warnings by default, and the affected check is disabled.
Changes Made
Project-aware warning handling
Infrastructure warnings retain their originating project context and location. When the project context is not yet available, BuildCheck can hold the warning until the corresponding project starts, allowing MSBuild logging to apply that project's warning settings.
Warnings already covered by
/warnaserrorare submitted at their original reporting point. Delaying them until project-start processing could allow the submission to finish successfully before logging receives the error. MSBuild logging continues to determine final severity using its existing warning-promotion, exclusion, and message-demotion rules.Deferred delivery and manager lifetime
The PR also completes deferred reporting before logging shuts down, so pending diagnostics from failed evaluations and graph construction are not lost. The existing
FinalizeProcessingoperation dispatches remaining diagnostics at coordinator, worker, and replay completion. The coordinator drains incoming events, completes deferred reporting, then drains the emitted diagnostics before calculating its final status. Worker completion preserves diagnostics even when request deactivation fails. Replay dispatches pending warnings before forwarding the recorded build-finished event.The shared in-process manager remains alive through logging shutdown. Releasing its provider through the component factory lets subsequent builds initialize a fresh manager.
Deferred-warning synchronization
A private
DeferredWarningscollection makes appending warnings and taking batches thread-safe. Taking a batch transfers ownership atomically, preventing a concurrent append from losing a warning. Dispatch runs outside the collection lock.This synchronization work overlaps draft #14686.
Compatibility and scope
Ordinary rule reporting, diagnostic ownership and location, and MSBuild's warning-policy precedence are preserved. Worker tracing remains success-only, and public build-finished callbacks keep their existing timing. No public APIs or binary-log event formats change.
The late-warning limitations discussed in #10670 remain: asynchronous project-only promotion can miss its policy window, and an ordinary finding promoted after submission completion can still leave a successful result. Graph-result reconciliation is tracked separately in #15572.