Obsolete legacy TraceConfiguration in favor of ITelemetryContext - #4090
Conversation
|
|
marcschier
left a comment
There was a problem hiding this comment.
@copilot please fix feedback
There was a problem hiding this comment.
Pull request overview
This PR clarifies the migration path away from the legacy ApplicationConfiguration.TraceConfiguration surface by marking it obsolete (with guidance toward ITelemetryContext/ILogger) while preserving existing behavior via narrowly-scoped CS0618 suppressions, and adding a regression test to keep the obsolete marker/message stable.
Changes:
- Mark
ApplicationConfiguration.TraceConfigurationas[Obsolete("Use ITelemetryContext and ILogger-based diagnostics instead.")]. - Add targeted
#pragma warning disable/restore CS0618at intentional internal/compat call sites that still useTraceConfiguration. - Add a reflection-based unit test verifying the property’s obsolete attribute and message.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/Opc.Ua.Gds.Tests/ServerConfigurationPushTestClient.cs | Suppress CS0618 where legacy trace output file path is still used by tests. |
| Tests/Opc.Ua.Gds.Tests/GlobalDiscoveryTestClient.cs | Suppress CS0618 where legacy trace output file path is still used by tests. |
| Tests/Opc.Ua.Core.Tests/Stack/Schema/ApplicationConfigurationObsoleteTests.cs | New test asserting TraceConfiguration is obsolete and message is stable. |
| Stack/Opc.Ua.Core/Stack/Configuration/ApplicationConfiguration.cs | Suppress CS0618 around legacy TraceConfiguration.ApplySettings() compatibility path during load. |
| Stack/Opc.Ua.Core/Schema/ApplicationConfiguration.cs | Add [Obsolete] to the TraceConfiguration property; suppress CS0618 in the copy ctor. |
| Libraries/Opc.Ua.Server/Server/StandardServer.cs | Suppress CS0618 around legacy trace configuration update/apply logic. |
| Libraries/Opc.Ua.Configuration/ApplicationInstance.cs | Suppress CS0618 where a default TraceConfiguration is created/applied for compatibility. |
| Libraries/Opc.Ua.Configuration/ApplicationConfigurationBuilder.cs | Suppress CS0618 in builder methods that still configure legacy trace settings. |
| Applications/ConsoleReferenceServer/Program.cs | Suppress CS0618 where trace output file path is used for shadow config behavior. |
| Applications/ConsoleReferenceServer/ConsoleUtils.cs | Suppress CS0618 where legacy trace masks/output file path inform logging configuration. |
| Applications/ConsoleReferenceClient/Program.cs | Suppress CS0618 where legacy trace output file path is overridden/applied. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master378 #4090 +/- ##
=============================================
- Coverage 60.17% 60.14% -0.03%
=============================================
Files 378 378
Lines 79070 79066 -4
Branches 13837 13837
=============================================
- Hits 47577 47558 -19
- Misses 27080 27094 +14
- Partials 4413 4414 +1
🚀 New features to boost your workflow:
|
Proposed changes
ApplicationConfiguration.TraceConfigurationstill existed as a live configuration surface afterITelemetryContextwas introduced, which made the migration path unclear. This change makes that legacy surface explicitly discoverable as transitional API and points consumers to the telemetry-based replacement.Public API guidance
ApplicationConfiguration.TraceConfigurationas obsolete with a message directing consumers toITelemetryContextandILogger-based diagnostics.Internal compatibility
CS0618suppressions at the remaining internal legacy call sites that intentionally preserveTraceConfigurationbehavior.Coverage
Related Issues
Types of changes
What types of changes does your code introduce?
Put an
xin the boxes that apply. You can also fill these out after creating the PR.Checklist
Put an
xin the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
This is intentionally narrow in scope: it clarifies the migration path without removing the legacy trace pipeline yet. The change is limited to surfacing the deprecation at the public configuration boundary and isolating the remaining intentional legacy usages.