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

Generate packages props and targets in buildTransitive directory #6325

Merged
merged 1 commit into from
Jan 10, 2023

Conversation

Youssef1313
Copy link
Member

@Youssef1313 Youssef1313 commented Dec 10, 2022

Closes #6229

@jmarolf Can you please take a look?

@Youssef1313 Youssef1313 requested a review from a team as a code owner December 10, 2022 14:11
@codecov
Copy link

codecov bot commented Dec 10, 2022

Codecov Report

Merging #6325 (356240b) into main (7e5162c) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6325      +/-   ##
==========================================
- Coverage   96.07%   96.07%   -0.01%     
==========================================
  Files        1367     1367              
  Lines      315348   315415      +67     
  Branches    10187    10187              
==========================================
+ Hits       302985   303047      +62     
- Misses       9930     9938       +8     
+ Partials     2433     2430       -3     

@@ -164,7 +164,7 @@
foreach (string file in fileList)
{
var fileWithPath = Path.IsPathRooted(file) ? file : Path.Combine(projectDir, file);
result.AppendLine(FileElement(fileWithPath, "build"));
result.AppendLine(FileElement(fileWithPath, "buildTransitive"));
Copy link
Contributor

Choose a reason for hiding this comment

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

I am afraid this might break our insertion pipeline of the analyzers into the .NET SDK. @jmarolf definitely needs to review this change.

Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to have broken mapping AnalysisLevel/AnalysisMode properties to the corresponding globalconfig files in the build\config folder. I am preparing a fix as part of another change.

Copy link
Contributor

@mavasani mavasani left a comment

Choose a reason for hiding this comment

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

Shall not be merged before Jon's blessing.

@jmarolf
Copy link
Contributor

jmarolf commented Jan 9, 2023

Sorry for the delay @Youssef1313. I am going to get a binlog with/without these changes and verify that they are what I expect. I will complete this tomorrow.

Copy link
Contributor

@jmarolf jmarolf left a comment

Choose a reason for hiding this comment

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

Confirmed this behavior is correct.

@jmarolf jmarolf dismissed mavasani’s stale review January 10, 2023 00:07

manually verified change

@jmarolf jmarolf merged commit 7b6ad7e into dotnet:main Jan 10, 2023
@github-actions github-actions bot added this to the vNext milestone Jan 10, 2023
@Youssef1313 Youssef1313 deleted the transitive branch January 12, 2023 08:32
mavasani added a commit to mavasani/roslyn-analyzers that referenced this pull request Jan 12, 2023
Fixes dotnet#6281

Prior implementation for `CodeAnalysisTreatWarningsAsErrors` passed `/warnaserror+:CAxxxx` to the command line for each CA rule ID. This led to couple of issues:
1. All disabled by default CA warnings seem to get enabled as errors
2. Editorconfig/globalconfig based configuration of the enabled CA rules stops working.

The new implementation updates our globalconfig tooling to generate parallel globalconfigs with `_warnaserror` suffix, such that rules which would have had effective warning severity are set to error severity in the new globalconfig files. The targets/props that picks the appropriate globalconfig based on the `AnalysisLevel` property now chooses the file with `_warnaserror` suffix if user has enabled code analysis warnings to be treated as errors.

Another couple of notes:
1. Given that the buggy implementation of `CodeAnalysisTreatWarningsAsErrors` has already shipped in .NET7 and prior SDKs, we use a separate property `EffectiveCodeAnalysisTreatWarningsAsErrors`, so users using the newer NuGet package, but older .NET SDK can still get this functionality. Users that move to the newer .NET8 preview SDK with this fix can use `CodeAnalysisTreatWarningsAsErrors` itself.
2. I have adjusted the tooling to generate the config files into buildtransitive folder instead of build folder. This is needed as a follow-up to dotnet#6325 for globalconfig files to be correctly mapped.
3. I have also renamed all the tooling generated globalconfig files to have .globalconfig extension instead of .editorconfig extension, as that was misleading.

I have verified that `CodeAnalysisTreatWarningsAsErrors` works fine with the locally built package when `EffectiveCodeAnalysisTreatWarningsAsErrors` is set to true. If I manually edit the targets/props shipped inside .NET7 SDK to delete all the prior shipped `CodeAnalysisTreatWarningsAsErrors` logic, then setting `CodeAnalysisTreatWarningsAsErrors` also works fine.
mavasani added a commit to mavasani/roslyn-analyzers that referenced this pull request Jan 12, 2023
Fixes dotnet#6281

Prior implementation for `CodeAnalysisTreatWarningsAsErrors` passed `/warnaserror+:CAxxxx` to the command line for each CA rule ID. This led to couple of issues:
1. All disabled by default CA warnings seem to get enabled as errors
2. Editorconfig/globalconfig based configuration of the enabled CA rules stops working.

The new implementation updates our globalconfig tooling to generate parallel globalconfigs with `_warnaserror` suffix, such that rules which would have had effective warning severity are set to error severity in the new globalconfig files. The targets/props that picks the appropriate globalconfig based on the `AnalysisLevel` property now chooses the file with `_warnaserror` suffix if user has enabled code analysis warnings to be treated as errors.

Another couple of notes:
1. Given that the buggy implementation of `CodeAnalysisTreatWarningsAsErrors` has already shipped in .NET7 and prior SDKs, we use a separate property `EffectiveCodeAnalysisTreatWarningsAsErrors`, so users using the newer NuGet package, but older .NET SDK can still get this functionality. Users that move to the newer .NET8 preview SDK with this fix can use `CodeAnalysisTreatWarningsAsErrors` itself.
2. I have adjusted the tooling to generate the config files into buildtransitive folder instead of build folder. This is needed as a follow-up to dotnet#6325 for globalconfig files to be correctly mapped.
3. I have also renamed all the tooling generated globalconfig files to have .globalconfig extension instead of .editorconfig extension, as that was misleading.

I have verified that `CodeAnalysisTreatWarningsAsErrors` works fine with the locally built package when `EffectiveCodeAnalysisTreatWarningsAsErrors` is set to true. If I manually edit the targets/props shipped inside .NET7 SDK to delete all the prior shipped `CodeAnalysisTreatWarningsAsErrors` logic, then setting `CodeAnalysisTreatWarningsAsErrors` also works fine.
mavasani added a commit to dotnet/sdk that referenced this pull request Jan 12, 2023
React to package structure updates in dotnet/roslyn-analyzers#6325 and dotnet/roslyn-analyzers#6427 to generate props/targets/config files in `buildtransitive` folder
mavasani added a commit to dotnet/sdk that referenced this pull request Jan 16, 2023
React to package structure updates in dotnet/roslyn-analyzers#6325 and dotnet/roslyn-analyzers#6427 to generate props/targets/config files in `buildtransitive` folder
dotnet-maestro bot added a commit to dotnet/sdk that referenced this pull request Jan 17, 2023
[main] Update dependencies from dotnet/roslyn-analyzers


 - Update GenerateLayout.targets

React to package structure updates in dotnet/roslyn-analyzers#6325 and dotnet/roslyn-analyzers#6427 to generate props/targets/config files in `buildtransitive` folder

 - Update GenerateLayout.targets
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.

EnforceExtendedAnalyzerRules warning even though I specified it
3 participants