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

Developers get warnings when they misuse [SupportedOSPlatform] or [UnsupportedOSPlatform] attributes #44914

Closed
2 tasks done
jeffhandley opened this issue Nov 19, 2020 · 5 comments
Assignees
Labels
area-Meta code-analyzer Marks an issue that suggests a Roslyn analyzer Cost:M Work that requires one engineer up to 2 weeks Priority:1 Work that is critical for the release, but we could probably ship without Team:Libraries User Story A single user-facing feature. Can be grouped under an epic.
Milestone

Comments

@jeffhandley
Copy link
Member

jeffhandley commented Nov 19, 2020

The Platform Compatibility Analyzer consumes [SupportedOSPlatform] and [UnsupportedOSPlatform] attributes to report diagnostics when APIs are referenced that are not supported on the targeted platforms. This analyzer and these attributes were introduced in .NET 5.0.

As our platforms expand in .NET 6.0, these attributes will need to be applied on many more APIs and in more complex scenarios. To ensure the attributes are applied correctly, we need to create new diagnostics for missing or invalid attributes.

Here are some examples of when diagnostics should get raised:

@jeffhandley jeffhandley added area-Meta code-analyzer Marks an issue that suggests a Roslyn analyzer labels Nov 19, 2020
@jeffhandley jeffhandley added this to the 6.0.0 milestone Nov 19, 2020
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Nov 19, 2020
@jeffhandley jeffhandley removed the untriaged New issue has not been triaged by the area owner label Nov 19, 2020
@jeffhandley jeffhandley added the Priority:0 Work that we can't release without label Nov 19, 2020
@marek-safar marek-safar changed the title Introduce diagnostics for missing or invalid [SupportedOSPlatform] and [UnsupportedOSPlatform] attributes Developers get warnings when they misuse [SupportedOSPlatform] or [UnsupportedOSPlatform] attributes Nov 27, 2020
@marek-safar marek-safar added the User Story A single user-facing feature. Can be grouped under an epic. label Nov 27, 2020
@jeffhandley jeffhandley self-assigned this Dec 17, 2020
@danmoseley danmoseley added Priority:1 Work that is critical for the release, but we could probably ship without and removed Priority:0 Work that we can't release without labels Jan 11, 2021
@danmoseley
Copy link
Member

This should not be P0 I think as we don't "control" that priority level.

@jeffhandley
Copy link
Member Author

Thanks, @danmosemsft. At the time of creating this, @terrajobst and I were using zero-based priorities within Priority:1 issues to indicate that the parent Priority:1 item is unsuccessful without its Priority:0 children. But making this Priority:1 will be cleaner for tracking.

@terrajobst
Copy link
Member

Works for me :-)

This should not be P0 I think as we don't "control" that priority level.

My understanding is that you can use that priority but you need to explain to our directors why the product can't ship without them.

@buyaa-n
Copy link
Contributor

buyaa-n commented May 6, 2021

Consider warning for misuse of newly added SupportedOSPlatformGuard and UnsupportedOSPlatformGuard attributes

@jeffhandley
Copy link
Member Author

I'm closing this based on the original scope. We can file new issues to further improve this experience if needed.

@ghost ghost locked as resolved and limited conversation to collaborators Aug 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Meta code-analyzer Marks an issue that suggests a Roslyn analyzer Cost:M Work that requires one engineer up to 2 weeks Priority:1 Work that is critical for the release, but we could probably ship without Team:Libraries User Story A single user-facing feature. Can be grouped under an epic.
Projects
No open projects
Development

No branches or pull requests

6 participants