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
Teams may want to add new diagnostics or breaking changes to the SDK. This document provides guidelines for how to introduce a new diagnostic or breaking change, which configuration knobs are available to teams, 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, and what criteria should guide the decision around severity, timeline for introduction, and deprecation of diagnostics.
4
4
5
5
## Overall procedure
6
6
7
-
In general, we want to make updating the SDK as smooth as possible for users. This means as much as possible
8
-
not rocking the boat unnecessarily. This means
7
+
In general, we want to make updating the .NET SDK as smooth as possible for developers. This means:
9
8
10
9
* introducing new changes in a staged/gradual way
11
-
* trying to tie opinionated analyzers/changes to a mechanism that requires explicit user input
10
+
* trying to tie opinionated analyzers/diagnostics to a mechanism that requires explicit user opt-in
12
11
* providing a way to opt out of a change entirely
13
12
14
13
## Kinds of changes
15
14
16
-
There are a bunch of kinds of changes that can ship in the SDK, and they have different implications for users. Here are some examples:
15
+
There are many kinds of breaking changes that can ship in the .NET SDK, such as:
17
16
18
-
* MSBuild warnings and errors
19
-
* Directly triggered in MSBuild logic (props/targets)
20
-
* directly in the SDK props/targets
21
-
* indirectly via codeflow, just shipped in the SDK
22
-
* Directly written by MSBuild Task implementations
23
-
* Including those surfaced by key partners like NuGet (e.g. NuGet Audit, Package Source Mapping)
17
+
** New MSBuild warnings and errors (props/targets)
18
+
* New NuGet warnings and errors.
19
+
* For example, NuGet Audit.
24
20
* Roslyn Analyzers and CodeFixes
25
21
* This includes trimming/ILLink analyzers and codefixes
26
22
* Behavioral/implementation changes
27
23
* MSBuild engine changes like MSBuild Server
28
24
* Implementation changes for MSBuild Tasks
29
25
* NuGet Restore algorithm enhancements
30
-
* Changes to CLI grammar
26
+
* Changes to DotNet CLI grammar
31
27
* Changes to defaults in CLI flags that impact behavior
32
-
*`--configuration` flag defaulting to `Release` instead of `Debug`
28
+
*For example, `--configuration` flag defaulting to `Release` instead of `Debug`
33
29
34
30
## Configuration Knobs
35
31
36
-
The following knobs are available to teams to configure various changes (some may not apply to all kinds of changes):
32
+
The following knobs are available to enable/disable these changes (some may not apply to all kinds of changes):
@@ -45,7 +41,7 @@ The following knobs are available to teams to configure various changes (some ma
45
41
46
42
* Implement changes in an informational/non-blocking way initially
47
43
48
-
What this means will vary change-to-change. For a change expressed as an Analyzer or MSBuild diagnostic, consider
44
+
What this means will vary change-to-change. For example, for a change expressed as an Analyzer or MSBuild diagnostic, consider
49
45
Informational level severities initially. For a behavioral change on a CLI, consider an informational message written to the
50
46
stderr channel on the console instead of making the stdout output un-parseable by tools.
51
47
@@ -54,9 +50,7 @@ the old command was still the default supported and a warning was written to the
54
50
55
51
* Gradually increase severity over each release
56
52
57
-
If a change in introduced in an informational/non-blocking way, determine the time frame where it is safe to increase the severity. For Analyzers, this may mean tying it to the next value of AnalysisLevel (which is downstream of TFM). For
58
-
MSBuild diagnostics, this may mean tying it to the next Warning Level or SdkAnalysisLevel. For CLI changes, this may mean tying it to the next LTS major version of the SDK. Ideally the way you would structure this increase would be automated and
59
-
documented so that users know what's coming down the pipe.
53
+
If a change in introduced in an informational/non-blocking way, determine the time frame where it is safe to increase the severity. For Analyzers, this may mean tying it to the next value of AnalysisLevel (which is downstream of TFM). For small MSBuild and NuGet diagnostics, this may mean tying it to the next Warning Level or SdkAnalysisLevel. For CLI changes, this may mean tying it to the next LTS major version of the SDK. Ideally the way you would structure this increase would be automated and documented so that users know what's coming down the pipe.
60
54
61
55
* Cut-over to new behavior after a long introduction period
62
56
@@ -68,11 +62,20 @@ provide enough time for users to adapt - for example the `dotnet new --list` exa
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
69
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.
70
64
71
-
For systems like Analyzers that time may be 'never', because the cost of detection is so low. This is a product-level decision
72
-
that is hard to give universal guidance for.
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.
73
66
74
67
* Hook into the unified SdkAnalysisLevel knob to allow users to easily opt out of all changes
75
68
76
69
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.
77
70
78
-
## Worked examples of changes
71
+
* Tie potentially impactful changes to the TFM targeted by the application/library.
72
+
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.
74
+
75
+
Concrete example: NuGet warnings for vulnerable transitive dependencies were introduced only for applications targeting .NET 10 and higher.
76
+
77
+
## Other recommendations
78
+
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.
0 commit comments