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

[vs17.12] Consistently respect unprefixed Warning-as-error/message/warning properties #11007

Merged
merged 5 commits into from
Nov 21, 2024

Conversation

SimaTian
Copy link
Member

@SimaTian SimaTian commented Nov 20, 2024

Backport of #10942.

Fixes #10877 and #10873.

Work item (Internal use):

Summary

Respect WarningsAsMessages, WarningsAsErrors, WarningsNotAsErrors, and TreatWarningsAsErrors in addition to their MSBuild-prefixed versions in all projects, not just ones that import Microsoft.Common.CurrentVersion.targets.

Customer Impact

Reduced complexity in opting to keep warnings as warnings, making it easier to configure warnings how you expect.

Regression?

No, this behavior is longstanding. It's higher severity now due to the NuGet Audit warnings, which are often created in one project (where a package is referenced) but raised in another (where the restore actually happened), which may have the easy-to-type form of the property but not the respected-before-this-change one.

Testing

New and existing automated tests.

Risk

Medium-low. Users almost certainly intended this behavior and it works this way in most project types. To mitigate risk further, the behavior can be reverted to the prior behavior with an environment variable (changewave).

@SimaTian SimaTian requested a review from a team as a code owner November 20, 2024 14:37
@rainersigwald rainersigwald force-pushed the backport/pr-10942-to-vs17.12 branch from 8180d6d to 5e4c8a5 Compare November 20, 2024 22:07
@rainersigwald rainersigwald changed the title Backport/pr 10942 to vs17.12 [vs17.12] Consistently respect unprefixed Warning-as-error/message/warning properties Nov 20, 2024
SimaTian and others added 3 commits November 21, 2024 16:06
#10942)

* add WarningsAsMessages, WarningsAsErrors, WarningsNotAsErrors and TreatWarningsAsErrors to the engine (e.g. variant without prefix). test those so that nothing breaks

* Optional output in BuildProjectExpectFailure

Optionally capture output in BuildProjectExpectFailure for better test
diagnosability.

* Capture output logging in new tests

* working through the review. Some test improvements. Changewave used. Comments.

* addressing review comments

* final review round, minor test update

---------

Co-authored-by: Rainer Sigwald <raines@microsoft.com>
Normally we wouldn't have this changewave in this release, but because
we want to have a consistent changewave for behavior changed after
release, we're backporting it.
@rainersigwald rainersigwald force-pushed the backport/pr-10942-to-vs17.12 branch from 14f47e6 to 04b036d Compare November 21, 2024 22:07
@rainersigwald rainersigwald merged commit 56cc2a0 into vs17.12 Nov 21, 2024
10 checks passed
@rainersigwald rainersigwald deleted the backport/pr-10942-to-vs17.12 branch November 21, 2024 22:59
SimaTian added a commit that referenced this pull request Dec 5, 2024
SimaTian added a commit that referenced this pull request Dec 5, 2024
* Revert "[vs17.12] Consistently respect unprefixed Warning-as-error/message/warning properties (#11007)"

This reverts commit 56cc2a0.

* Revert "Always respect warning-as-error properties"

This reverts commit ae660b7.

* Update Versions.props

* remove newline

* Update Versions.props
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants