You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This document provides guidelines for introducing new diagnostics or breaking changes to the .NET SDK, which configuration knobs are available, and what criteria should guide the decision around severity, timeline for introduction, and deprecation of diagnostics.
3
+
This document provides guidelines for introducing new diagnostics or breaking changes to the .NET SDK, which configuration knobs are available, what criteria should guide the decision around severity, timeline for introduction, and deprecation of diagnostics, and what steps are required by the .NET release process.
4
4
5
-
## Overall procedure
5
+
## General guidance
6
6
7
7
In general, we want to make updating the .NET SDK as smooth as possible for developers. This means:
8
8
9
-
*introducing new changes in a staged/gradual way
10
-
*trying to tie opinionated analyzers/diagnostics to a mechanism that requires explicit user opt-in
11
-
*providing a way to opt out of a change entirely
9
+
*Introducing new changes in a staged/gradual way.
10
+
*Tying new analyzers/diagnostics to a mechanism that requires explicit opt-in.
11
+
*Providing a way to opt out of a change entirely.
12
12
13
-
## Kinds of changes
13
+
## Kinds of .NET SDK breaking changes
14
14
15
15
There are many kinds of breaking changes that can ship in the .NET SDK, such as:
16
16
17
-
* New MSBuild warnings and errors (props/targets)
17
+
* New MSBuild warnings and errors (props/targets).
18
18
* New NuGet warnings and errors.
19
19
* For example, NuGet Audit.
20
-
* Roslyn Analyzers and CodeFixes
21
-
* This includes trimming/ILLink analyzers and codefixes
22
-
* Behavioral/implementation changes
23
-
* MSBuild engine changes like MSBuild Server
24
-
* Implementation changes for MSBuild Tasks
25
-
* NuGet Restore algorithm enhancements
26
-
* Changes to DotNet CLI grammar
27
-
* Changes to defaults in CLI flags that impact behavior
28
-
* For example, `--configuration` flag defaulting to `Release` instead of `Debug`
20
+
* Roslyn Analyzers and CodeFixes.
21
+
* This includes trimming/ILLink analyzers and codefixes.
22
+
* Behavioral/implementation changes.
23
+
* MSBuild engine changes like MSBuild Server.
24
+
* Implementation changes for MSBuild Tasks.
25
+
* NuGet Restore algorithm enhancements.
26
+
* Changes to DotNet CLI behavior or output.
27
+
* Changes to DotNet CLI grammar.
28
+
* Changes to defaults in CLI flags that impact behavior.
29
+
* For example, `--configuration` flag defaulting to `Release` instead of `Debug`.
29
30
30
31
## Configuration Knobs
31
32
@@ -36,17 +37,23 @@ The following knobs are available to enable/disable these changes (some may not
### Support new and old commands in the first release
46
+
47
+
For changes in the CLI grammar, fully support both commands in one release, add a message to the old command in the subsequent release, and remove the old command in the release after that. This allows users to migrate to the new command at their own pace.
48
+
49
+
Specific example: When the `dotnet new --list` command was changed to `dotnet new list` to adhere to CLI design guidelines,
50
+
the old command was still the default supported and a warning was written to the console when the old form was used pointing users to the new form. This allowed users and scripts to continue using the old form and gradually migrate to the new.
51
+
42
52
### Implement changes in an informational/non-blocking way initially
43
53
44
54
What this means will vary change-to-change. For example, for a change expressed as an Analyzer or MSBuild diagnostic, consider
45
55
Informational level severities initially. For a behavioral change on a CLI, consider an informational message written to the
46
-
stderr channel on the console instead of making the stdout output un-parseable by tools.
47
-
48
-
Concrete example: When the `dotnet new --list` command was changed to `dotnet new list` to adhere to CLI design guidelines,
49
-
the old command was still the default supported and a warning was written to the console when the old form was used pointing users to the new form. This allowed users and scripts to continue using the old form and gradually migrate to the new.
56
+
stderr channel on the console instead of making the stdout output unparseable by tools.
50
57
51
58
### Gradually increase severity over each release
52
59
@@ -59,23 +66,23 @@ provide enough time for users to adapt - for example the `dotnet new --list` exa
59
66
60
67
### Always provide a way to opt out of the change
61
68
62
-
Have some kind of knob that allows users to opt out of the change entirely. This could be a flag, an environment variable, or a global.json setting. This allows users to continue using the old behavior if they need to in exceptional situations. It is
63
-
important to document this knob and its behavior in the SDK documentation. It is also important to define a timeline for when this knob will be removed entirely, forcing users to adopt the new behavior.
69
+
Have some kind of knob that allows users to opt out of the change entirely. Preferably, this would be a project property, but, for depending on the change, other mechanisms would be more appropriate. For example, an environment variable for MsBuild engine changes or a CLI argument to opt out of a new output format. This allows users to continue using the old behavior if they need to in exceptional situations.
64
70
65
-
For systems like Analyzers that time may be 'never', because the cost of detection is so low. This is a product-level decision that is hard to give universal guidance for.
71
+
It is important to document the opt out mechanism in the SDK documentation, as well as document the timeline for when this opt out mechanism will be removed entirely, forcing users to adopt the new behavior. For systems like Analyzers, that time may be _never_, because the cost of detection is so low. This is a product-level decision that is hard to give universal guidance for.
66
72
67
73
### Hook into the unified SdkAnalysisLevel knob to allow users to easily opt out of all changes
68
74
69
75
This knob exists so that users can safely and consistently say "for whatever reason, I just need you to act like SDK version X". This is the one-stop shop - users no longer need to know about all the individual knobs that are available to them.
70
76
71
-
### Tie potentially impactful changes to the TFM targeted by the application/library.
77
+
### Tie potentially impactful changes to the target TFM
72
78
73
-
Changes that are expected to cause significant disruption should only be introduced behind the Target Framework knob. This eliminates business continuity and allows developers to address changes needed as part of scheduled work to migrate a codebase to a new TFM.
79
+
Changes that are expected to cause significant disruption should only be introduced behind the Target Framework knob. This ensures business continuity and allows developers to address changes needed as part of scheduled work to migrate a codebase to a new TFM.
74
80
75
-
Concrete example: NuGet warnings for vulnerable transitive dependencies were introduced only for applications targeting .NET 10 and higher.
81
+
Specific example: NuGet warnings for vulnerable transitive dependencies were introduced in the .NET 10 SDK only for applications targeting .NET 10 and higher.
76
82
77
-
## Other recommendations
83
+
## Required process for all .NET SDK breaking changes
78
84
79
-
* If possible, introduce significant breaking changes in a non-LTS release.
80
-
* Publish blog posts and update public documentation as appropriate as early as possible.
81
-
* Consider creating and pinning an issue in the corresponding GitHub repository where customers can provide feedback.
85
+
* Create an issue in the appropriate GitHub repository to track the change, if one does not already exist.
86
+
* Add the breaking-change label to the issue. This label should be available in all .NET repositories that ship as part of the .NET SDK. If the label is not available, please file an issue in [dotnet/sdk](https://github.com/dotnet/sdk).
87
+
* The issue will trigger a message with instructions to add documentation. In addition, you are invited to work with the SDK team to publish a blog post for the change.
88
+
* Consider creating and pinning an issue in the appropriate GitHub repository where the community can provide feedback.
0 commit comments