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

[release/7.0.1xx] SealInternalTypes (CA1852): Don't warn for top-level type (#6278) #6504

Merged
merged 1 commit into from
Mar 10, 2023

Conversation

jhartmann123
Copy link
Contributor

@jhartmann123 jhartmann123 commented Feb 23, 2023

Backport #6278 into the .NET7 release branch
Issue: #6141 - CA1852 warns on generated Program for top-level statements

Customer Impact

The CA1852 analyzer is hidden by default, but it is bulk configurable. Which means it is will be on if user choose to warn on all analyzers or on Performance category analyzers. Several customers asked about the porting in the issue #6141. For the customer who opened this PR they have all analyzers enabled with TreatWarningsAsErrors set to true in their project. So, they explicitly have to suppress this analyzer in order to compile. There is no workaround except suppressing the warning or upgrading to .NET 8 previews which is not desirable. Accounting that top level statements are getting more and more popular the fix better to be serviced in 7.0.

Regression

No, but if we account that the analyzer newly added in 7.0 with the bug it could cause an unexpected warning when the analyzers bulk configured to Warn

Testing

  • Unit test added with the fix
  • Manual testing done with the repro

Risk

Very low, the fix is quite simple and self-descriptive. It would not introduce a new warning nor would affect any other code/analyzer.

CC @jeffhandley @stephentoub

* SealInternalTypes (CA1852): Don't warn for top-level type

* Fix build errors
@jhartmann123 jhartmann123 requested a review from a team as a code owner February 23, 2023 20:14
@mavasani
Copy link
Contributor

@buyaa-n

@buyaa-n
Copy link
Contributor

buyaa-n commented Feb 24, 2023

@jhartmann123 personally I am supportive to port, but for porting fixes into SDK servicing releases we need to get approval from management. I will update the description with the info needed for servicing request, we need more info from you to fill the Customer impact part of the request. Why do you think the fix need to be ported and why the porting is necessary for you, are you blocked by this bug and how? Especially when the analyzer is hidden by default the customer scenario would be helpful

@jhartmann123
Copy link
Contributor Author

jhartmann123 commented Feb 25, 2023

I'm sorry, while not stated explicitly anywhere, some people, including me, were under the impression that this was planned to be fixed with SDK 7.0.1xx. As it still wasn't fixed with 7.0.200, I thought that this was just a missed cherry pick...

Thanks for updating the MR description, I've added our issue with this in the Customer impact part.

Copy link
Member

@jeffhandley jeffhandley left a comment

Choose a reason for hiding this comment

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

Backporting this to 7.0.x sounds good to me. It addresses a common scenario of top-level statements where a bug exists and cannot be satisfactorily worked around.

@buyaa-n Can you shepherd this through Tactics please?

@buyaa-n
Copy link
Contributor

buyaa-n commented Mar 10, 2023

Servicing approved, the code coverage failure is unrelated, merging. Assuming it would just flow from 7.0.1xx branch to next 7.0 release as usual.

CC @jmarolf @mavasani

@buyaa-n
Copy link
Contributor

buyaa-n commented Mar 10, 2023

Hm, could not merge, probably because of the failure? Rerunning did not work, closing and reopening the PR

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.

5 participants