-
Notifications
You must be signed in to change notification settings - Fork 183
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 an analyzer to prevent use of some internal shared source types #6642
Merged
Conversation
This file contains 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
annelo-msft
changed the title
Add an analyzer to block use of internal shared source types we want to lock down
Add an analyzer to prevent use of some internal shared source types
Aug 9, 2023
annelo-msft
commented
Aug 9, 2023
src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/Descriptors.cs
Show resolved
Hide resolved
annelo-msft
requested review from
jsquire,
pallavit,
JoshLove-msft,
christothes,
KrzysztofCwalina,
tg-msft,
heaths and
m-nash
as code owners
August 9, 2023 20:43
heaths
approved these changes
Aug 9, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few nits/tips, but otherwise LGTM.
src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/BannedTypesAnalyzer.cs
Outdated
Show resolved
Hide resolved
src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/BannedTypesAnalyzer.cs
Outdated
Show resolved
Hide resolved
src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/BannedTypesAnalyzer.cs
Outdated
Show resolved
Hide resolved
src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/BannedTypesAnalyzer.cs
Outdated
Show resolved
Hide resolved
heaths
approved these changes
Aug 9, 2023
pshao25
reviewed
Aug 10, 2023
src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/BannedTypesAnalyzer.cs
Outdated
Show resolved
Hide resolved
pshao25
reviewed
Aug 10, 2023
src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/BannedTypesAnalyzer.cs
Outdated
Show resolved
Hide resolved
pshao25
reviewed
Aug 10, 2023
src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers.Tests/AZC0020Tests.cs
Outdated
Show resolved
Hide resolved
src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers.Tests/AZC0020Tests.cs
Outdated
Show resolved
Hide resolved
jsquire
approved these changes
Aug 11, 2023
src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/BannedTypesAnalyzer.cs
Outdated
Show resolved
Hide resolved
5 tasks
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.
For the JSON Merge Patch work, we want to use MutableJsonDocument and related types in Azure SDK Patch models.
The proposal to do this involves moving MutableJsonDocument and related types into internal shared source temporarily to accelerate the generator work on models for PATCH operations. However, we do not want libraries we don't know about taking dependencies on MutableJsonDocument, so that we have the freedom to change its API when we later make it a public type.
This analyzer will prevent projects in the azure-sdk-for-net repo from using MutableJsonDocument and related types. Anyone who uses the type will have to knowingly suppress this warning and therefore opt-into the risk of breaking changes we might make in the future before it becomes a public type. The analyzer is sufficiently general to be used with any other internal shared source types we want to limit use of outside Azure.Core.