From 0f582b9192896fa68855fa53b4990b2feae7bdf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Kie=C5=82kowicz?= Date: Tue, 22 Oct 2024 16:33:23 +0200 Subject: [PATCH] NuGet Audit fix - WCF .NET Client testing application (#3719) * NuGet Audit fix - WCF .NET Client testing application * Fix WCF Client bytecode integration --- build/LibraryVersions.g.cs | 1 + .../InstrumentationDefinitions.g.cs | 6 +++--- .../Wcf/Client/WcfClientIntegration.cs | 6 +++--- .../Instrumentations/Wcf/WcfCommonConstants.cs | 2 +- test/Directory.Packages.props | 6 ++++-- test/IntegrationTests/LibraryVersions.g.cs | 3 +++ .../TestApplication.Wcf.Client.DotNet.csproj | 11 ++++++++++- .../PackageVersionDefinitions.cs | 3 ++- 8 files changed, 27 insertions(+), 11 deletions(-) diff --git a/build/LibraryVersions.g.cs b/build/LibraryVersions.g.cs index 37f0664910..8a37eaad77 100644 --- a/build/LibraryVersions.g.cs +++ b/build/LibraryVersions.g.cs @@ -165,6 +165,7 @@ public static partial class LibraryVersion { new("4.10.2"), new("6.2.0"), + new("8.0.0", supportedFrameworks: new string[] {"net8.0"}), } }, { diff --git a/src/OpenTelemetry.AutoInstrumentation/Generated/net6.0/SourceGenerators/SourceGenerators.InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs b/src/OpenTelemetry.AutoInstrumentation/Generated/net6.0/SourceGenerators/SourceGenerators.InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs index e02b27cd27..3589715890 100644 --- a/src/OpenTelemetry.AutoInstrumentation/Generated/net6.0/SourceGenerators/SourceGenerators.InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs +++ b/src/OpenTelemetry.AutoInstrumentation/Generated/net6.0/SourceGenerators/SourceGenerators.InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs @@ -66,9 +66,9 @@ private static NativeCallTargetDefinition[] GetDefinitionsArray() nativeCallTargetDefinitions.Add(new("System.Private.ServiceModel", "System.ServiceModel.ChannelFactory", "InitializeEndpoint", new[] {"System.Void", "System.String", "System.ServiceModel.EndpointAddress"}, 4, 0, 0, 4, 65535, 65535, AssemblyFullName, "OpenTelemetry.AutoInstrumentation.Instrumentations.Wcf.Client.WcfClientIntegration")); nativeCallTargetDefinitions.Add(new("System.Private.ServiceModel", "System.ServiceModel.ChannelFactory", "InitializeEndpoint", new[] {"System.Void", "System.ServiceModel.Description.ServiceEndpoint"}, 4, 0, 0, 4, 65535, 65535, AssemblyFullName, "OpenTelemetry.AutoInstrumentation.Instrumentations.Wcf.Client.WcfClientIntegration")); nativeCallTargetDefinitions.Add(new("System.Private.ServiceModel", "System.ServiceModel.ChannelFactory", "InitializeEndpoint", new[] {"System.Void", "System.ServiceModel.Channels.Binding", "System.ServiceModel.EndpointAddress"}, 4, 0, 0, 4, 65535, 65535, AssemblyFullName, "OpenTelemetry.AutoInstrumentation.Instrumentations.Wcf.Client.WcfClientIntegration")); - nativeCallTargetDefinitions.Add(new("System.ServiceModel.Primitives", "System.ServiceModel.ChannelFactory", "InitializeEndpoint", new[] {"System.Void", "System.String", "System.ServiceModel.EndpointAddress"}, 6, 0, 0, 6, 65535, 65535, AssemblyFullName, "OpenTelemetry.AutoInstrumentation.Instrumentations.Wcf.Client.WcfClientIntegration")); - nativeCallTargetDefinitions.Add(new("System.ServiceModel.Primitives", "System.ServiceModel.ChannelFactory", "InitializeEndpoint", new[] {"System.Void", "System.ServiceModel.Description.ServiceEndpoint"}, 6, 0, 0, 6, 65535, 65535, AssemblyFullName, "OpenTelemetry.AutoInstrumentation.Instrumentations.Wcf.Client.WcfClientIntegration")); - nativeCallTargetDefinitions.Add(new("System.ServiceModel.Primitives", "System.ServiceModel.ChannelFactory", "InitializeEndpoint", new[] {"System.Void", "System.ServiceModel.Channels.Binding", "System.ServiceModel.EndpointAddress"}, 6, 0, 0, 6, 65535, 65535, AssemblyFullName, "OpenTelemetry.AutoInstrumentation.Instrumentations.Wcf.Client.WcfClientIntegration")); + nativeCallTargetDefinitions.Add(new("System.ServiceModel.Primitives", "System.ServiceModel.ChannelFactory", "InitializeEndpoint", new[] {"System.Void", "System.String", "System.ServiceModel.EndpointAddress"}, 6, 0, 0, 8, 65535, 65535, AssemblyFullName, "OpenTelemetry.AutoInstrumentation.Instrumentations.Wcf.Client.WcfClientIntegration")); + nativeCallTargetDefinitions.Add(new("System.ServiceModel.Primitives", "System.ServiceModel.ChannelFactory", "InitializeEndpoint", new[] {"System.Void", "System.ServiceModel.Description.ServiceEndpoint"}, 6, 0, 0, 8, 65535, 65535, AssemblyFullName, "OpenTelemetry.AutoInstrumentation.Instrumentations.Wcf.Client.WcfClientIntegration")); + nativeCallTargetDefinitions.Add(new("System.ServiceModel.Primitives", "System.ServiceModel.ChannelFactory", "InitializeEndpoint", new[] {"System.Void", "System.ServiceModel.Channels.Binding", "System.ServiceModel.EndpointAddress"}, 6, 0, 0, 8, 65535, 65535, AssemblyFullName, "OpenTelemetry.AutoInstrumentation.Instrumentations.Wcf.Client.WcfClientIntegration")); } } diff --git a/src/OpenTelemetry.AutoInstrumentation/Instrumentations/Wcf/Client/WcfClientIntegration.cs b/src/OpenTelemetry.AutoInstrumentation/Instrumentations/Wcf/Client/WcfClientIntegration.cs index 1ec2e98897..64d67629ba 100644 --- a/src/OpenTelemetry.AutoInstrumentation/Instrumentations/Wcf/Client/WcfClientIntegration.cs +++ b/src/OpenTelemetry.AutoInstrumentation/Instrumentations/Wcf/Client/WcfClientIntegration.cs @@ -46,7 +46,7 @@ namespace OpenTelemetry.AutoInstrumentation.Instrumentations.Wcf.Client; returnTypeName: ClrNames.Void, parameterTypeNames: new[] { ClrNames.String, WcfClientConstants.EndpointAddressTypeName }, minimumVersion: WcfCommonConstants.Min6Version, - maximumVersion: WcfCommonConstants.Max6Version, + maximumVersion: WcfCommonConstants.Max8Version, integrationName: WcfClientConstants.IntegrationName, type: InstrumentationType.Trace)] [InstrumentMethod( @@ -56,7 +56,7 @@ namespace OpenTelemetry.AutoInstrumentation.Instrumentations.Wcf.Client; returnTypeName: ClrNames.Void, parameterTypeNames: new[] { WcfClientConstants.ServiceEndpointTypeName }, minimumVersion: WcfCommonConstants.Min6Version, - maximumVersion: WcfCommonConstants.Max6Version, + maximumVersion: WcfCommonConstants.Max8Version, integrationName: WcfClientConstants.IntegrationName, type: InstrumentationType.Trace)] [InstrumentMethod( @@ -66,7 +66,7 @@ namespace OpenTelemetry.AutoInstrumentation.Instrumentations.Wcf.Client; returnTypeName: ClrNames.Void, parameterTypeNames: new[] { WcfClientConstants.BindingTypeName, WcfClientConstants.EndpointAddressTypeName }, minimumVersion: WcfCommonConstants.Min6Version, - maximumVersion: WcfCommonConstants.Max6Version, + maximumVersion: WcfCommonConstants.Max8Version, integrationName: WcfClientConstants.IntegrationName, type: InstrumentationType.Trace)] #endif diff --git a/src/OpenTelemetry.AutoInstrumentation/Instrumentations/Wcf/WcfCommonConstants.cs b/src/OpenTelemetry.AutoInstrumentation/Instrumentations/Wcf/WcfCommonConstants.cs index e87441c35e..0a1193cc4a 100644 --- a/src/OpenTelemetry.AutoInstrumentation/Instrumentations/Wcf/WcfCommonConstants.cs +++ b/src/OpenTelemetry.AutoInstrumentation/Instrumentations/Wcf/WcfCommonConstants.cs @@ -11,7 +11,7 @@ internal static class WcfCommonConstants public const string ServiceModelPrimitivesAssemblyName = "System.ServiceModel.Primitives"; public const string Min6Version = "6.0.0"; - public const string Max6Version = "6.*.*"; + public const string Max8Version = "8.*.*"; #endif public const string Min4Version = "4.0.0"; public const string Max4Version = "4.*.*"; diff --git a/test/Directory.Packages.props b/test/Directory.Packages.props index 67517a8b93..095f1d63dc 100644 --- a/test/Directory.Packages.props +++ b/test/Directory.Packages.props @@ -47,11 +47,13 @@ + - - + + + diff --git a/test/IntegrationTests/LibraryVersions.g.cs b/test/IntegrationTests/LibraryVersions.g.cs index 373bcaa0b5..deb78407d9 100644 --- a/test/IntegrationTests/LibraryVersions.g.cs +++ b/test/IntegrationTests/LibraryVersions.g.cs @@ -291,6 +291,9 @@ public static TheoryData WCFCoreClient #else theoryData.Add("4.10.2"); theoryData.Add("6.2.0"); +#if NET8_0 + theoryData.Add("8.0.0"); +#endif #endif return theoryData; } diff --git a/test/test-applications/integrations/TestApplication.Wcf.Client.DotNet/TestApplication.Wcf.Client.DotNet.csproj b/test/test-applications/integrations/TestApplication.Wcf.Client.DotNet/TestApplication.Wcf.Client.DotNet.csproj index 807de1ce7f..8e86e318d6 100644 --- a/test/test-applications/integrations/TestApplication.Wcf.Client.DotNet/TestApplication.Wcf.Client.DotNet.csproj +++ b/test/test-applications/integrations/TestApplication.Wcf.Client.DotNet/TestApplication.Wcf.Client.DotNet.csproj @@ -5,9 +5,18 @@ net8.0;$(TargetFrameworks) - + + + + + + + + + + diff --git a/tools/LibraryVersionsGenerator/PackageVersionDefinitions.cs b/tools/LibraryVersionsGenerator/PackageVersionDefinitions.cs index 01b0c12f1b..c5d57f9837 100644 --- a/tools/LibraryVersionsGenerator/PackageVersionDefinitions.cs +++ b/tools/LibraryVersionsGenerator/PackageVersionDefinitions.cs @@ -235,7 +235,8 @@ all lower versions than 8.15.10 contains references impacted by Versions = new List { new("4.10.2"), - new("*") + new("6.2.0"), + new("*", supportedTargetFrameworks: new[] { "net8.0" }, supportedExecutionFrameworks: new[] { "net8.0" }) } }, new()