-
Notifications
You must be signed in to change notification settings - Fork 352
Replace [Obsolete] with [Experimental] attributes #1487
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
base: release-1.16
Are you sure you want to change the base?
Conversation
…quiresPreviewFeatures] attribute where relevant Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
@philliphoff It looks like
I haven't been able to identify any other attributes that quite flag a warning like To that end, I propose we keep |
[Experimental] similarly requires an analyzer ID be provided as it does something with code analyzers. @WhitWaldo The guidance says I would still suggest a switch to |
I'll give it a shot and see what happens! |
…ntal] instead Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
using Dapr.Client; | ||
|
||
namespace LockService | ||
{ | ||
class Program | ||
{ | ||
[Obsolete("Distributed Lock API is in Alpha, this can be removed once it is stable.")] | ||
[RequiresPreviewFeatures("The API is currently not stable as it is in the Alpha stage. This attribute will be removed once it is stable.")] |
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.
[Experimental("...")]
?
src/Dapr.Client/DaprClientGrpc.cs
Outdated
@@ -1664,8 +1662,7 @@ public override async Task<UnsubscribeConfigurationResponse> UnsubscribeConfigur | |||
#region Cryptography | |||
|
|||
/// <inheritdoc /> | |||
[Obsolete( | |||
"The API is currently not stable as it is in the Alpha stage. This attribute will be removed once it is stable.")] | |||
[Experimental("DAPR10001")] |
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 couple of suggestions:
- Use a common constant for each ID to make changes simpler and allow for documentation
- Use a different ID for each "category" or "area" in which the experimental APIs reside (e.g. storage vs. encryption vs. jobs) so that developers can opt into (i.e. suppress warnings) certain APIs without having to opt into every API.
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.
@philliphoff Have you seen much guidance around this front? Following your suggestion, I've been thinking about it and I'm inclined towards "DAPR-WORKFLOW-001". We don't have much in the way of analyzers or other constants like this yet so definitely want consistency, so should I drop the hyphens altogether or keep them here for readability?
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.
Apparently hyphens are not allowed, so assume the same for underscores instead, e.g. "DAPR_WORKFLOW_001".
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.
Approved with a couple of suggestions.
…] with constants reflecting each package. Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Description
There are some places where it makes sense to mark things as
[Obsolete]
, but it'd be nice to reserve that attribute only for those places where something is truly obsolete and not recommended as a path going forward. It's all we've had to date to mark non-stable functionality, but with the shift to .NET 8 as the minimal version, this brings with it two new attributes:[Experimental]
and[RequiresPreviewFeatures]
.Unfortunately,
[Experimental]
seems to have something to do with code analyzers as it has a required string argument for the analyzer ID, so because I'm not entirely sure what this entails for the downstream user experience, I'm skipping over it.Rather, I've replaced the pre-stable functionality previously marked with
[Obsolete]
with[RequiresPreviewFeatures]
and retained the original message text, e.g.[RequiresPreviewFeatures("The API is currently not stable as it is in the Alpha stage. This attribute will be removed once it is stable.")]
Issue reference
We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.
Please reference the issue this PR will close: #1219
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: