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
Repurpose PublicApiAnalyzer as InternalForTestingAnalyzer (#7788)
## Summary of changes
Repurposes the now-defunct `PublicApiAnalyzer` to an
`InternalForTestingAnalyzer`
## Reason for change
We have various methods in `Datadog.Trace` that should never be called
by production code, and are only exposed to make testing functionality
easier. Currently we rely on method names and comments to avoid this.
With this change, we can add an attribute instead, and using the method
from Datadog.Trace etc becomes a build error.
## Implementation details
- Basically just renamed `PublicApi*` -> `InternalForTesting*`
- Decorated methods that were currently relying on comments/naming to
avoid being called
## Test coverage
Refactored the analyzer tests, so should still be covered the same
## Other details
Note that there are a bunch of comments for methods `// internal for
testing` which are a bit different. In those cases, we _do_ call it in
Datadog.Trace, the comment is just explaining why the method isn't
`private`. Those remain as-is, this attribute is purely if you have a
"don't call this method in production code, use that other one instead"
method 😄
Part of a stack
- #7786
- #7787
- #7788 👈
Copy file name to clipboardExpand all lines: tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/Logging/ILogger/DirectSubmission/LoggerFactoryIntegrationCommon.cs
Copy file name to clipboardExpand all lines: tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/Logging/Log4Net/DirectSubmission/DirectSubmissionLog4NetAppender.cs
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@
8
8
usingDatadog.Trace.DuckTyping;
9
9
usingDatadog.Trace.Logging.DirectSubmission;
10
10
usingDatadog.Trace.Logging.DirectSubmission.Sink;
11
+
usingDatadog.Trace.SourceGenerators;
11
12
usingDatadog.Trace.Telemetry;
12
13
usingDatadog.Trace.Telemetry.Metrics;
13
14
@@ -23,7 +24,7 @@ internal class DirectSubmissionLog4NetAppender
Copy file name to clipboardExpand all lines: tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/Logging/Log4Net/DirectSubmission/DirectSubmissionLog4NetLegacyAppender.cs
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@
8
8
usingDatadog.Trace.DuckTyping;
9
9
usingDatadog.Trace.Logging.DirectSubmission;
10
10
usingDatadog.Trace.Logging.DirectSubmission.Sink;
11
+
usingDatadog.Trace.SourceGenerators;
11
12
usingDatadog.Trace.Telemetry;
12
13
usingDatadog.Trace.Telemetry.Metrics;
13
14
@@ -23,7 +24,7 @@ internal class DirectSubmissionLog4NetLegacyAppender
Copy file name to clipboardExpand all lines: tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/Logging/NLog/DirectSubmission/DirectSubmissionNLogLegacyTarget.cs
Copy file name to clipboardExpand all lines: tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/Logging/NLog/DirectSubmission/DirectSubmissionNLogTarget.cs
0 commit comments