Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add build check result errors into the list of build submission IDs that have logged error #10227

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

JaynieBai
Copy link
Member

@JaynieBai JaynieBai commented Jun 12, 2024

Fixes #10071

Context

While building with buildcheck enabled and MSBUILDNOINPROCNODE=1
Severity of the rule set to Error, does not reported to the all build:
image
This is since buildcheck error is not added into the _warningsAsErrorsByProject, WarningsAsErrors == null && _warningsAsErrorsByProject == null is true all the time. so HasBuildSubmissionLoggedErrors always return false.

{
// Warnings as errors are not tracked if the user did not specify to do so
if (WarningsAsErrors == null && _warningsAsErrorsByProject == null)
{
return false;
}
// Determine if any of the event sinks have logged an error with this submission ID
return _buildSubmissionIdsThatHaveLoggedErrors?.Contains(submissionId) == true;

Changes Made

when buildEventArgs is BuildErrorEventArgs, treat BuildErrorEventArgs' related warnings as errors

Testing

Notes

@JaynieBai JaynieBai marked this pull request as ready for review June 12, 2024 08:41
@JaynieBai
Copy link
Member Author

JaynieBai commented Jun 12, 2024

Will add a test after figured out the reason of flaky test SampleAnalyzerIntegrationTest #10036

@@ -1592,6 +1593,12 @@ private void RouteBuildEvent(object loggingEvent)
_buildSubmissionIdsThatHaveLoggedErrors.Add(errorEvent.BuildEventContext?.SubmissionId ?? BuildEventContext.InvalidSubmissionId);
}

if (buildEventArgs is BuildCheckResultError checkResultError)
Copy link
Member

Choose a reason for hiding this comment

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

We should probably handle the warning + ShouldTreatWarningAsError as well

Copy link
Member Author

Choose a reason for hiding this comment

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

So there is one condition build with -err:BC0101

@JaynieBai JaynieBai marked this pull request as draft June 26, 2024 08:06
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.

[Bug][BuildCheck]: Build succeedes with MSBUILDNOINPROCNODE enabled
3 participants