Skip to content

Commit cf5c52b

Browse files
author
Martin Taillefer
committed
Add experimental diagnostics ids
1 parent 5546e37 commit cf5c52b

82 files changed

Lines changed: 205 additions & 335 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Directory.Build.targets

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@
3535
<!-- Prevent analyzer crashes from stopping things -->
3636
<NoWarn>$(NoWarn);AD0001</NoWarn>
3737

38-
<!-- R9A029 is for customers, not for this repo -->
39-
<NoWarn>$(NoWarn);R9A029</NoWarn>
40-
38+
<!-- Experimental warnings are for customers, not for this repo -->
39+
<NoWarn>$(NoWarn);EXTEXP0001;EXTEXP0002;EXTEXP0003;EXTEXP0004;EXTEXP0005;;EXTEXP0006;EXTEXP0007;EXTEXP0008;EXTEXP0009;EXTEXP00010;EXTEXP00011;EXTEXP0001;EXTEXP0001;EXTEXP0001;EXTEXP0001</NoWarn>
4140

4241
<!-- NU5104: A stable release of a package should not have a prerelease dependency -->
4342
<NoWarn>$(NoWarn);NU5104</NoWarn>

eng/MSBuild/Shared.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<ItemGroup>
3-
<Compile Include="$(MSBuildThisFileDirectory)\..\..\src\Shared\WarningDefinitions.cs" LinkBase="Shared" />
3+
<Compile Include="$(MSBuildThisFileDirectory)\..\..\src\Shared\DiagnosticIds\*.cs" LinkBase="Shared\DiagnosticIds" />
44
</ItemGroup>
55

66
<ItemGroup Condition="'$(InjectSharedThrow)' == 'true'">

src/Analyzers/Microsoft.Extensions.ExtraAnalyzers/Common/DiagDescriptors.cs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,7 @@ internal static class DiagDescriptors
101101
helpLinkUri: "https://TODO/r9a022",
102102
isEnabledByDefault: true);
103103

104-
// R9A023..R9A028 retired
105-
106-
public static DiagnosticDescriptor UsingExperimentalApi { get; } = new(
107-
id: "R9A029",
108-
messageFormat: Resources.UsingExperimentalApiMessage,
109-
title: Resources.UsingExperimentalApiTitle,
110-
category: Reliability,
111-
description: Resources.UsingExperimentalApiDescription,
112-
defaultSeverity: DiagnosticSeverity.Warning,
113-
helpLinkUri: "https://TODO/r9a029",
114-
isEnabledByDefault: true);
104+
// R9A023..R9A029 retired
115105

116106
public static DiagnosticDescriptor StartsEndsWith { get; } = new(
117107
id: "R9A030",

src/Analyzers/Microsoft.Extensions.ExtraAnalyzers/Common/Resources.Designer.cs

Lines changed: 0 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Analyzers/Microsoft.Extensions.ExtraAnalyzers/Common/Resources.resx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -180,15 +180,6 @@
180180
<data name="SequentialFixAllInSolution" xml:space="preserve">
181181
<value>Apply code fix for all issues in current solution</value>
182182
</data>
183-
<data name="UsingExperimentalApiDescription" xml:space="preserve">
184-
<value>Indicates that code is depending on an experimental API</value>
185-
</data>
186-
<data name="UsingExperimentalApiTitle" xml:space="preserve">
187-
<value>Using experimental API</value>
188-
</data>
189-
<data name="UsingExperimentalApiMessage" xml:space="preserve">
190-
<value>'{0}' is experimental and is subject to change without notice</value>
191-
</data>
192183
<data name="StartsEndsWithDescription" xml:space="preserve">
193184
<value>When checking for a single character, prefer the character overloads of 'String.StartsWith' and 'String.EndsWith' for improved performance</value>
194185
</data>

src/Analyzers/Microsoft.Extensions.ExtraAnalyzers/Common/UsingExperimentalApiAnalyzer.cs

Lines changed: 0 additions & 50 deletions
This file was deleted.

src/Libraries/Microsoft.AspNetCore.Telemetry.Middleware/Logging/LoggingOptions.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using Microsoft.Extensions.Compliance.Classification;
99
using Microsoft.Extensions.Http.Telemetry;
1010
using Microsoft.Shared.Data.Validation;
11+
using Microsoft.Shared.DiagnosticIds;
1112

1213
namespace Microsoft.AspNetCore.Telemetry;
1314

@@ -67,7 +68,7 @@ public class LoggingOptions
6768
/// <value>
6869
/// The default value is <see cref="HttpRouteParameterRedactionMode.Strict"/>.
6970
/// </value>
70-
[Experimental(diagnosticId: "TBD", UrlFormat = WarningDefinitions.SharedUrlFormat)]
71+
[Experimental(diagnosticId: Experiments.Telemetry, UrlFormat = Experiments.UrlFormat)]
7172
public HttpRouteParameterRedactionMode RequestPathParameterRedactionMode { get; set; } = DefaultPathParameterRedactionMode;
7273

7374
/// <summary>
@@ -208,7 +209,7 @@ public class LoggingOptions
208209
/// };
209210
/// </code>
210211
/// </example>
211-
[Experimental(diagnosticId: "TBD", UrlFormat = WarningDefinitions.SharedUrlFormat)]
212+
[Experimental(diagnosticId: Experiments.Telemetry, UrlFormat = Experiments.UrlFormat)]
212213
[Required]
213214
[SuppressMessage("Usage", "CA2227:Collection properties should be read only",
214215
Justification = "Options pattern.")]

src/Libraries/Microsoft.AspNetCore.Telemetry/Enrichment.RequestHeaders/RequestHeadersLogEnricherOptions.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.ComponentModel.DataAnnotations;
66
using System.Diagnostics.CodeAnalysis;
77
using Microsoft.Extensions.Compliance.Classification;
8+
using Microsoft.Shared.DiagnosticIds;
89

910
namespace Microsoft.AspNetCore.Telemetry;
1011

@@ -20,7 +21,7 @@ public class RequestHeadersLogEnricherOptions
2021
/// Default value is an empty dictionary.
2122
/// </remarks>
2223
[Required]
23-
[Experimental(diagnosticId: "TBD", UrlFormat = WarningDefinitions.SharedUrlFormat)]
24+
[Experimental(diagnosticId: Experiments.Telemetry, UrlFormat = Experiments.UrlFormat)]
2425
#pragma warning disable CA2227 // Collection properties should be read only
2526
public IDictionary<string, DataClassification> HeadersDataClasses { get; set; } = new Dictionary<string, DataClassification>();
2627
#pragma warning restore CA2227 // Collection properties should be read only

src/Libraries/Microsoft.AspNetCore.Telemetry/Tracing/HttpTracingExtensions.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using Microsoft.Extensions.Options;
1010
using Microsoft.Extensions.Options.Validation;
1111
using Microsoft.Extensions.Telemetry.Internal;
12+
using Microsoft.Shared.DiagnosticIds;
1213
using Microsoft.Shared.Diagnostics;
1314
using OpenTelemetry.Instrumentation.AspNetCore;
1415
using OpenTelemetry.Trace;
@@ -116,7 +117,7 @@ public static TracerProviderBuilder AddHttpTraceEnricher(this TracerProviderBuil
116117
/// <param name="services">The <see cref="IServiceCollection"/> to add this enricher.</param>
117118
/// <returns><see cref="IServiceCollection"/> for chaining.</returns>
118119
/// <exception cref="ArgumentNullException">The argument <paramref name="services"/> is <see langword="null"/>.</exception>
119-
[Experimental(diagnosticId: "TBD", UrlFormat = WarningDefinitions.SharedUrlFormat)]
120+
[Experimental(diagnosticId: Experiments.Telemetry, UrlFormat = Experiments.UrlFormat)]
120121
public static IServiceCollection AddHttpTraceEnricher<T>(this IServiceCollection services)
121122
where T : class, IHttpTraceEnricher
122123
{
@@ -132,7 +133,7 @@ public static IServiceCollection AddHttpTraceEnricher<T>(this IServiceCollection
132133
/// <param name="enricher">Enricher to be added.</param>
133134
/// <returns><see cref="TracerProviderBuilder"/> for chaining.</returns>
134135
/// <exception cref="ArgumentNullException">The argument <paramref name="services"/> or <paramref name="enricher"/> is <see langword="null" />.</exception>
135-
[Experimental(diagnosticId: "TBD", UrlFormat = WarningDefinitions.SharedUrlFormat)]
136+
[Experimental(diagnosticId: Experiments.Telemetry, UrlFormat = Experiments.UrlFormat)]
136137
public static IServiceCollection AddHttpTraceEnricher(this IServiceCollection services, IHttpTraceEnricher enricher)
137138
{
138139
_ = Throw.IfNull(services);

src/Libraries/Microsoft.AspNetCore.Telemetry/Tracing/HttpTracingOptions.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using System.Diagnostics.CodeAnalysis;
88
using Microsoft.Extensions.Compliance.Classification;
99
using Microsoft.Extensions.Http.Telemetry;
10+
using Microsoft.Shared.DiagnosticIds;
1011

1112
namespace Microsoft.AspNetCore.Telemetry;
1213

@@ -51,7 +52,7 @@ public class HttpTracingOptions
5152
/// <remarks>
5253
/// This property is applicable when the <see cref="IncludePath"/> option is enabled.
5354
/// </remarks>
54-
[Experimental(diagnosticId: "TBD", UrlFormat = WarningDefinitions.SharedUrlFormat)]
55+
[Experimental(diagnosticId: Experiments.Telemetry, UrlFormat = Experiments.UrlFormat)]
5556
public HttpRouteParameterRedactionMode RequestPathParameterRedactionMode { get; set; } = DefaultPathParameterRedactionMode;
5657

5758
/// <summary>

0 commit comments

Comments
 (0)