Skip to content

Commit 71b7c1b

Browse files
committed
Merge remote-tracking branch 'origin/main' into copilot/update-package-validation-version
2 parents ed331bb + 01a9b32 commit 71b7c1b

File tree

19 files changed

+84
-18
lines changed

19 files changed

+84
-18
lines changed

eng/MSBuild/Packaging.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<!-- https://learn.microsoft.com/dotnet/fundamentals/package-validation/overview -->
3838
<EnablePackageValidation>true</EnablePackageValidation>
3939

40-
<PackageValidationBaselineVersion Condition=" '$(Stage)' == 'normal' ">9.10.0</PackageValidationBaselineVersion>
40+
<PackageValidationBaselineVersion Condition="'$(Stage)' == 'normal' and '$(PackageValidationBaselineVersion)' == ''">9.10.0</PackageValidationBaselineVersion>
4141
</PropertyGroup>
4242

4343
<!-- Verify that the minimum supported TFM is actually used. -->

src/Libraries/.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4533,7 +4533,7 @@ dotnet_diagnostic.S3994.severity = none
45334533
# Title : URI return values should not be strings
45344534
# Category : Major Code Smell
45354535
# Help Link: https://rules.sonarsource.com/csharp/RSPEC-3995
4536-
dotnet_diagnostic.S3995.severity = warning
4536+
dotnet_diagnostic.S3995.severity = suggestion
45374537

45384538
# Title : URI properties should not be strings
45394539
# Category : Major Code Smell

src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/UriContent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class UriContent : AIContent
3030
/// <exception cref="ArgumentNullException"><paramref name="uri"/> is <see langword="null"/>.</exception>
3131
/// <exception cref="ArgumentNullException"><paramref name="mediaType"/> is <see langword="null"/>.</exception>
3232
/// <exception cref="ArgumentException"><paramref name="mediaType"/> is an invalid media type.</exception>
33-
/// <exception cref="UriFormat"><paramref name="uri"/> is an invalid URL.</exception>
33+
/// <exception cref="UriFormatException"><paramref name="uri"/> is an invalid URL.</exception>
3434
/// <remarks>
3535
/// A media type must be specified, so that consumers know what to do with the content.
3636
/// If an exact media type is not known, but the category (e.g. image) is known, a wildcard

src/Libraries/Microsoft.Extensions.AI.Abstractions/Tools/HostedMcpServerTool.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,31 @@ public HostedMcpServerTool(string serverName, string serverAddress)
2727
ServerAddress = Throw.IfNullOrWhitespace(serverAddress);
2828
}
2929

30+
/// <summary>
31+
/// Initializes a new instance of the <see cref="HostedMcpServerTool"/> class.
32+
/// </summary>
33+
/// <param name="serverName">The name of the remote MCP server.</param>
34+
/// <param name="serverUrl">The URL of the remote MCP server.</param>
35+
/// <exception cref="ArgumentNullException"><paramref name="serverName"/> or <paramref name="serverUrl"/> is <see langword="null"/>.</exception>
36+
/// <exception cref="ArgumentException"><paramref name="serverName"/> is empty or composed entirely of whitespace.</exception>
37+
/// <exception cref="ArgumentException"><paramref name="serverUrl"/> is not an absolute URL.</exception>
38+
public HostedMcpServerTool(string serverName, Uri serverUrl)
39+
: this(serverName, ValidateUrl(serverUrl))
40+
{
41+
}
42+
43+
private static string ValidateUrl(Uri serverUrl)
44+
{
45+
_ = Throw.IfNull(serverUrl);
46+
47+
if (!serverUrl.IsAbsoluteUri)
48+
{
49+
Throw.ArgumentException(nameof(serverUrl), "The provided URL is not absolute.");
50+
}
51+
52+
return serverUrl.AbsoluteUri;
53+
}
54+
3055
/// <inheritdoc />
3156
public override string Name => "mcp";
3257

src/Libraries/Microsoft.Extensions.ServiceDiscovery.Abstractions/Microsoft.Extensions.ServiceDiscovery.Abstractions.csproj

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,21 @@
44
<TargetFrameworks>$(TargetFrameworks);netstandard2.0</TargetFrameworks>
55
<IsPackable>true</IsPackable>
66
<Description>Provides abstractions for service discovery. Interfaces defined in this package are implemented in Microsoft.Extensions.ServiceDiscovery and other service discovery packages.</Description>
7-
<PackageIconFullPath>$(DefaultDotnetIconFullPath)</PackageIconFullPath>
7+
<StrongNameKeyId>Open</StrongNameKeyId>
88
<RootNamespace>Microsoft.Extensions.ServiceDiscovery</RootNamespace>
99
<!-- https://github.com/dotnet/extensions/issues/6871 tracks enabling these -->
1010
<NoWarn>$(NoWarn);S1144;CA1002;S2365;SA1642;IDE0040;CA1307;EA0009;LA0003</NoWarn>
1111
<ImplicitUsings>enable</ImplicitUsings>
1212
</PropertyGroup>
1313

14+
<PropertyGroup>
15+
<Workstream>ServiceDiscovery</Workstream>
16+
<Stage>normal</Stage>
17+
<PackageValidationBaselineVersion>9.5.1</PackageValidationBaselineVersion>
18+
<MinCodeCoverage>75</MinCodeCoverage>
19+
<MinMutationScore>75</MinMutationScore>
20+
</PropertyGroup>
21+
1422
<ItemGroup>
1523
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" />
1624
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" />

src/Libraries/Microsoft.Extensions.ServiceDiscovery.Abstractions/Microsoft.Extensions.ServiceDiscovery.Abstractions.json

Whitespace-only changes.

src/Libraries/Microsoft.Extensions.ServiceDiscovery.Dns/Microsoft.Extensions.ServiceDiscovery.Dns.csproj

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,21 @@
44
<TargetFrameworks>$(NetCoreTargetFrameworks)</TargetFrameworks>
55
<IsPackable>true</IsPackable>
66
<Description>Provides extensions to HttpClient to resolve well-known hostnames to concrete endpoints based on DNS records. Useful for service resolution in orchestrators such as Kubernetes.</Description>
7-
<PackageIconFullPath>$(DefaultDotnetIconFullPath)</PackageIconFullPath>
7+
<StrongNameKeyId>Open</StrongNameKeyId>
88
<!-- https://github.com/dotnet/extensions/issues/6871 tracks enabling these -->
99
<NoWarn>$(NoWarn);IDE0018;IDE0025;IDE0032;IDE0040;IDE0058;IDE0250;IDE0251;IDE1006;CA1304;CA1307;CA1309;CA1310;CA1849;CA2000;CA2213;CA2217;S125;S1135;S1226;S2344;S3626;S4022;SA1108;SA1120;SA1128;SA1129;SA1204;SA1205;SA1214;SA1400;SA1405;SA1408;SA1515;SA1600;SA1629;SA1642;SA1649;EA0001;EA0009;EA0014;LA0001;LA0003;LA0008;VSTHRD200</NoWarn>
1010
<ImplicitUsings>enable</ImplicitUsings>
1111
<DisableMicrosoftExtensionsLoggingSourceGenerator>false</DisableMicrosoftExtensionsLoggingSourceGenerator>
1212
</PropertyGroup>
1313

14+
<PropertyGroup>
15+
<Workstream>ServiceDiscovery</Workstream>
16+
<Stage>normal</Stage>
17+
<PackageValidationBaselineVersion>9.5.1</PackageValidationBaselineVersion>
18+
<MinCodeCoverage>75</MinCodeCoverage>
19+
<MinMutationScore>75</MinMutationScore>
20+
</PropertyGroup>
21+
1422
<ItemGroup>
1523
<PackageReference Include="DnsClient" />
1624
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" />

src/Libraries/Microsoft.Extensions.ServiceDiscovery.Dns/Microsoft.Extensions.ServiceDiscovery.Dns.json

Whitespace-only changes.

src/Libraries/Microsoft.Extensions.ServiceDiscovery.Yarp/Microsoft.Extensions.ServiceDiscovery.Yarp.csproj

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,20 @@
66
<Nullable>enable</Nullable>
77
<IsPackable>true</IsPackable>
88
<Description>Provides extensions for service discovery for the YARP reverse proxy.</Description>
9-
<PackageIconFullPath>$(DefaultDotnetIconFullPath)</PackageIconFullPath>
9+
<StrongNameKeyId>Open</StrongNameKeyId>
1010
<!-- https://github.com/dotnet/extensions/issues/6871 tracks enabling these -->
1111
<NoWarn>$(NoWarn);IDE0018;IDE0025;IDE0032;IDE0040;IDE0058;IDE0250;IDE0251;IDE1006;CA1304;CA1307;CA1309;CA1310;CA1849;CA2000;CA2213;CA2217;S125;S1135;S1226;S2344;S2692;S3626;S4022;SA1108;SA1120;SA1128;SA1129;SA1204;SA1205;SA1214;SA1400;SA1405;SA1408;SA1414;SA1515;SA1600;SA1615;SA1629;SA1642;SA1649;EA0001;EA0009;EA0014;LA0001;LA0003;LA0008;VSTHRD200</NoWarn>
1212
<ImplicitUsings>enable</ImplicitUsings>
1313
</PropertyGroup>
1414

15+
<PropertyGroup>
16+
<Workstream>ServiceDiscovery</Workstream>
17+
<Stage>normal</Stage>
18+
<PackageValidationBaselineVersion>9.5.1</PackageValidationBaselineVersion>
19+
<MinCodeCoverage>75</MinCodeCoverage>
20+
<MinMutationScore>75</MinMutationScore>
21+
</PropertyGroup>
22+
1523
<ItemGroup>
1624
<PackageReference Include="Yarp.ReverseProxy" />
1725
</ItemGroup>

src/Libraries/Microsoft.Extensions.ServiceDiscovery.Yarp/Microsoft.Extensions.ServiceDiscovery.Yarp.json

Whitespace-only changes.

0 commit comments

Comments
 (0)