Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
13 changes: 1 addition & 12 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ jobs:
echo "##vso[task.setvariable variable=DOTNET_GENERATE_ASPNET_CERTIFICATE]false"
- checkout: self
fetchDepth: 0
- task: UseDotNet@2
displayName: Install .NET 6
inputs:
version: 6.0.x
- task: UseDotNet@2
displayName: Install .NET 8
inputs:
Expand Down Expand Up @@ -105,14 +101,7 @@ jobs:
condition: eq(variables['integrationTests'], 'true')
displayName: Start Docker services
- task: DotNetCoreCLI@2
displayName: dotnet test 6.0
inputs:
command: test
projects: '**/*.csproj'
arguments: '--blame-hang-timeout 3m -f net6.0 --no-build -c $(buildConfiguration) -maxcpucount:1 $(skipFilter) --collect "XPlat Code Coverage" --settings coverlet.runsettings --logger trx --results-directory $(Build.SourcesDirectory)'
publishTestResults: false
- task: DotNetCoreCLI@2
displayName: dotnet test 8.0
displayName: dotnet test net8.0
inputs:
command: test
projects: '**/*.csproj'
Expand Down
4 changes: 0 additions & 4 deletions build/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ jobs:
steps:
- checkout: self
fetchDepth: 0
- task: UseDotNet@2
displayName: Install .NET 6
inputs:
version: 6.0.x
- task: UseDotNet@2
displayName: Install .NET 8
inputs:
Expand Down
1 change: 1 addition & 0 deletions build/pr-code-cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
throw 'This pipeline can only be run from pull requests. Use "/azp run cleanup-code" in a GitHub PR comment.'
}
- task: UseDotNet@2
# Workaround for https://github.com/sethreno/ReGitLint/issues/46.
displayName: Install .NET 6
inputs:
version: 6.0.x
Expand Down
2 changes: 0 additions & 2 deletions build/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ jobs:
parameters:
component: Security
skipFilter: --filter "Category!=SkipOnLinux"
skipNET6: true
- template: templates/component-build.yaml
parameters:
component: Security
OS: windows
skipNET6: true
13 changes: 1 addition & 12 deletions build/sonar-analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ jobs:
steps:
- checkout: self
fetchDepth: 0
- task: UseDotNet@2
displayName: Install .NET 6
inputs:
version: 6.0.x
- task: UseDotNet@2
displayName: Install .NET 8
inputs:
Expand Down Expand Up @@ -59,14 +55,7 @@ jobs:
docker run -d --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3-management
displayName: Start Docker services
- task: DotNetCoreCLI@2
displayName: dotnet test 6.0
inputs:
command: test
projects: '**/*.csproj'
arguments: '--blame-hang-timeout 3m -f net6.0 --no-build -c $(buildConfiguration) -maxcpucount:1 --filter "Category!=SkipOnLinux" --collect "XPlat Code Coverage" --settings coverlet.runsettings --logger trx --results-directory $(Build.SourcesDirectory)'
publishTestResults: false
- task: DotNetCoreCLI@2
displayName: dotnet test 8.0
displayName: dotnet test net8.0
inputs:
command: test
projects: '**/*.csproj'
Expand Down
16 changes: 1 addition & 15 deletions build/templates/component-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ parameters:
component: ''
runConfigServer: false
runRabbitMQ: false
skipNET6: false
skipFilter: ''
OS: ubuntu

Expand All @@ -27,11 +26,6 @@ jobs:
steps:
- checkout: self
fetchDepth: 0
- task: UseDotNet@2
condition: ne(${{parameters.skipNET6}}, 'true')
displayName: Install .NET 6
inputs:
version: 6.0.x
- task: UseDotNet@2
displayName: Install .NET 8
inputs:
Expand Down Expand Up @@ -70,15 +64,7 @@ jobs:
condition: eq(${{parameters.runConfigServer}}, 'true')
displayName: Start Config Server
- task: DotNetCoreCLI@2
condition: ne(${{parameters.skipNET6}}, 'true')
displayName: dotnet test 6.0
inputs:
command: test
projects: $(SolutionFile)
arguments: -f net6.0 ${{parameters.skipFilter}} $(CommonTestArgs)
publishTestResults: false
- task: DotNetCoreCLI@2
displayName: dotnet test 8.0
displayName: dotnet test net8.0
inputs:
command: test
projects: $(SolutionFile)
Expand Down
1 change: 1 addition & 0 deletions build/verify-code-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
pool:
vmImage: ubuntu-latest
steps:
# Workaround for https://github.com/sethreno/ReGitLint/issues/46.
- task: UseDotNet@2
displayName: Install .NET 6
inputs:
Expand Down
20 changes: 8 additions & 12 deletions shared-package.props
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,17 @@
<Error Text="The 'PackageTags' property must be set for packable project '$(MSBuildProjectName)'." Condition="'$(PackageTags)' == ''" />
</Target>

<ItemGroup
Condition="$(MSBuildProjectName.StartsWith('Steeltoe.Bootstrap')) Or $(MSBuildProjectName.StartsWith('Steeltoe.Common.Certificates')) Or $(MSBuildProjectName.StartsWith('Steeltoe.Configuration')) Or
$(MSBuildProjectName.StartsWith('Steeltoe.Connectors')) Or $(MSBuildProjectName.StartsWith('Steeltoe.Discovery')) Or $(MSBuildProjectName.StartsWith('Steeltoe.Logging')) Or
$(MSBuildProjectName.StartsWith('Steeltoe.Management')) Or $(MSBuildProjectName.StartsWith('Steeltoe.Security'))">

<!-- Widen the condition above as we're completing more public API reviews -->
<ItemGroup Condition="!$(MSBuildProjectName.StartsWith('Steeltoe.Common'))">
<!--
Remove the condition above after public API review of Steeltoe.Common.
-->
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="$(PublicApiAnalyzersVersion)" PrivateAssets="All" />
</ItemGroup>

<PropertyGroup
Condition="!$(MSBuildProjectName.StartsWith('Steeltoe.Bootstrap')) And !$(MSBuildProjectName.StartsWith('Steeltoe.Common.Certificates')) And !$(MSBuildProjectName.StartsWith('Steeltoe.Configuration')) And
!$(MSBuildProjectName.StartsWith('Steeltoe.Connectors')) And !$(MSBuildProjectName.StartsWith('Steeltoe.Discovery')) And !$(MSBuildProjectName.StartsWith('Steeltoe.Logging')) And
!$(MSBuildProjectName.StartsWith('Steeltoe.Management')) And !$(MSBuildProjectName.StartsWith('Steeltoe.Security'))">

<!-- Narrow the condition above as we're completing more public API reviews -->
<PropertyGroup Condition="$(MSBuildProjectName.StartsWith('Steeltoe.Common'))">
<!--
Remove the condition above after public API review of Steeltoe.Common.
-->
<NoWarn>$(NoWarn);SA1401;S1168;S2360;S3900;S3956;S4004;S4023</NoWarn>
</PropertyGroup>
</Project>
7 changes: 6 additions & 1 deletion shared-test.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(TestSdkVersion)" />
<PackageReference Include="Moq" Version="$(MoqVersion)" />
<PackageReference Include="xunit" Version="$(XunitVersion)" />
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVisualStudioVersion)" />
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />
</ItemGroup>

<ItemGroup>
<Using Include="FluentAssertions" />
<Using Include="Xunit" />
</ItemGroup>

<ItemGroup Condition="Exists('xunit.runner.json')">
Expand Down
9 changes: 0 additions & 9 deletions shared.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,6 @@
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)\Steeltoe.Release.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' != 'net6.0'">
<!--
https://github.com/SonarSource/sonar-dotnet/issues/6752#issuecomment-1768257155
As long as we're multi-targeting against .NET 6, its warnings are more useful.
This suppression should be reverted when the .NET 6 target is dropped.
-->
<NoWarn>$(NoWarn);S4056</NoWarn>
</PropertyGroup>

<ItemGroup>
<AdditionalFiles Include="$(MSBuildThisFileDirectory)\stylecop.json" Visible="false" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// See the LICENSE file in the project root for more information.

using System.Collections.Immutable;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Steeltoe.Common;
Expand All @@ -12,20 +12,20 @@

namespace Steeltoe.Bootstrap.AutoConfiguration;

public static class WebApplicationBuilderExtensions
public static class HostApplicationBuilderExtensions
{
private static readonly IReadOnlySet<string> EmptySet = ImmutableHashSet<string>.Empty;

/// <summary>
/// Automatically configures Steeltoe packages that have been added to your project as NuGet references.
/// </summary>
/// <param name="builder">
/// The <see cref="WebApplicationBuilder" /> to configure.
/// The <see cref="IHostApplicationBuilder" /> to configure.
/// </param>
/// <returns>
/// The incoming <see cref="WebApplicationBuilder" />, so that additional calls can be chained.
/// The incoming <see cref="IHostApplicationBuilder" /> so that additional calls can be chained.
/// </returns>
public static WebApplicationBuilder AddSteeltoe(this WebApplicationBuilder builder)
public static IHostApplicationBuilder AddSteeltoe(this IHostApplicationBuilder builder)
{
return AddSteeltoe(builder, EmptySet, BootstrapLoggerFactory.Default);
}
Expand All @@ -34,15 +34,15 @@ public static WebApplicationBuilder AddSteeltoe(this WebApplicationBuilder build
/// Automatically configures Steeltoe packages that have been added to your project as NuGet references.
/// </summary>
/// <param name="builder">
/// The <see cref="WebApplicationBuilder" /> to configure.
/// The <see cref="IHostApplicationBuilder" /> to configure.
/// </param>
/// <param name="assemblyNamesToExclude">
/// The set of assembly names to exclude from auto-configuration. For ease of use, select from the constants in <see cref="SteeltoeAssemblyNames" />.
/// </param>
/// <returns>
/// The incoming <see cref="WebApplicationBuilder" />, so that additional calls can be chained.
/// The incoming <see cref="IHostApplicationBuilder" /> so that additional calls can be chained.
/// </returns>
public static WebApplicationBuilder AddSteeltoe(this WebApplicationBuilder builder, IReadOnlySet<string> assemblyNamesToExclude)
public static IHostApplicationBuilder AddSteeltoe(this IHostApplicationBuilder builder, IReadOnlySet<string> assemblyNamesToExclude)
{
return AddSteeltoe(builder, assemblyNamesToExclude, BootstrapLoggerFactory.Default);
}
Expand All @@ -51,16 +51,16 @@ public static WebApplicationBuilder AddSteeltoe(this WebApplicationBuilder build
/// Automatically configures Steeltoe packages that have been added to your project as NuGet references.
/// </summary>
/// <param name="builder">
/// The <see cref="WebApplicationBuilder" /> to configure.
/// The <see cref="IHostApplicationBuilder" /> to configure.
/// </param>
/// <param name="loggerFactory">
/// Used for internal logging. Pass <see cref="NullLoggerFactory.Instance" /> to disable logging, or <see cref="BootstrapLoggerFactory.Default" /> to
/// write only to the console until logging is fully initialized.
/// </param>
/// <returns>
/// The incoming <see cref="WebApplicationBuilder" />, so that additional calls can be chained.
/// The incoming <see cref="IHostApplicationBuilder" /> so that additional calls can be chained.
/// </returns>
public static WebApplicationBuilder AddSteeltoe(this WebApplicationBuilder builder, ILoggerFactory loggerFactory)
public static IHostApplicationBuilder AddSteeltoe(this IHostApplicationBuilder builder, ILoggerFactory loggerFactory)
{
return AddSteeltoe(builder, EmptySet, loggerFactory);
}
Expand All @@ -69,7 +69,7 @@ public static WebApplicationBuilder AddSteeltoe(this WebApplicationBuilder build
/// Automatically configures Steeltoe packages that have been added to your project as NuGet references.
/// </summary>
/// <param name="builder">
/// The <see cref="WebApplicationBuilder" /> to configure.
/// The <see cref="IHostApplicationBuilder" /> to configure.
/// </param>
/// <param name="assemblyNamesToExclude">
/// The set of assembly names to exclude from auto-configuration. For ease of use, select from the constants in <see cref="SteeltoeAssemblyNames" />.
Expand All @@ -79,9 +79,9 @@ public static WebApplicationBuilder AddSteeltoe(this WebApplicationBuilder build
/// write only to the console until logging is fully initialized.
/// </param>
/// <returns>
/// The incoming <see cref="WebApplicationBuilder" />, so that additional calls can be chained.
/// The incoming <see cref="IHostApplicationBuilder" /> so that additional calls can be chained.
/// </returns>
public static WebApplicationBuilder AddSteeltoe(this WebApplicationBuilder builder, IReadOnlySet<string> assemblyNamesToExclude,
public static IHostApplicationBuilder AddSteeltoe(this IHostApplicationBuilder builder, IReadOnlySet<string> assemblyNamesToExclude,
ILoggerFactory loggerFactory)
{
ArgumentGuard.NotNull(builder);
Expand Down
8 changes: 4 additions & 4 deletions src/Bootstrap/src/AutoConfiguration/HostBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static class HostBuilderExtensions
/// The <see cref="IHostBuilder" /> to configure.
/// </param>
/// <returns>
/// The incoming <see cref="IHostBuilder" />, so that additional calls can be chained.
/// The incoming <see cref="IHostBuilder" /> so that additional calls can be chained.
/// </returns>
public static IHostBuilder AddSteeltoe(this IHostBuilder builder)
{
Expand All @@ -40,7 +40,7 @@ public static IHostBuilder AddSteeltoe(this IHostBuilder builder)
/// The set of assembly names to exclude from auto-configuration. For ease of use, select from the constants in <see cref="SteeltoeAssemblyNames" />.
/// </param>
/// <returns>
/// The incoming <see cref="IHostBuilder" />, so that additional calls can be chained.
/// The incoming <see cref="IHostBuilder" /> so that additional calls can be chained.
/// </returns>
public static IHostBuilder AddSteeltoe(this IHostBuilder builder, IReadOnlySet<string> assemblyNamesToExclude)
{
Expand All @@ -58,7 +58,7 @@ public static IHostBuilder AddSteeltoe(this IHostBuilder builder, IReadOnlySet<s
/// write only to the console until logging is fully initialized.
/// </param>
/// <returns>
/// The incoming <see cref="IHostBuilder" />, so that additional calls can be chained.
/// The incoming <see cref="IHostBuilder" /> so that additional calls can be chained.
/// </returns>
public static IHostBuilder AddSteeltoe(this IHostBuilder builder, ILoggerFactory loggerFactory)
{
Expand All @@ -79,7 +79,7 @@ public static IHostBuilder AddSteeltoe(this IHostBuilder builder, ILoggerFactory
/// write only to the console until logging is fully initialized.
/// </param>
/// <returns>
/// The incoming <see cref="IHostBuilder" />, so that additional calls can be chained.
/// The incoming <see cref="IHostBuilder" /> so that additional calls can be chained.
/// </returns>
public static IHostBuilder AddSteeltoe(this IHostBuilder builder, IReadOnlySet<string> assemblyNamesToExclude, ILoggerFactory loggerFactory)
{
Expand Down
10 changes: 5 additions & 5 deletions src/Bootstrap/src/AutoConfiguration/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ const Steeltoe.Bootstrap.AutoConfiguration.SteeltoeAssemblyNames.ManagementEndpo
const Steeltoe.Bootstrap.AutoConfiguration.SteeltoeAssemblyNames.ManagementPrometheus = "Steeltoe.Management.Prometheus" -> string!
const Steeltoe.Bootstrap.AutoConfiguration.SteeltoeAssemblyNames.ManagementTracing = "Steeltoe.Management.Tracing" -> string!
const Steeltoe.Bootstrap.AutoConfiguration.SteeltoeAssemblyNames.ManagementWavefront = "Steeltoe.Management.Wavefront" -> string!
static Steeltoe.Bootstrap.AutoConfiguration.HostApplicationBuilderExtensions.AddSteeltoe(this Microsoft.Extensions.Hosting.IHostApplicationBuilder! builder) -> Microsoft.Extensions.Hosting.IHostApplicationBuilder!
static Steeltoe.Bootstrap.AutoConfiguration.HostApplicationBuilderExtensions.AddSteeltoe(this Microsoft.Extensions.Hosting.IHostApplicationBuilder! builder, Microsoft.Extensions.Logging.ILoggerFactory! loggerFactory) -> Microsoft.Extensions.Hosting.IHostApplicationBuilder!
static Steeltoe.Bootstrap.AutoConfiguration.HostApplicationBuilderExtensions.AddSteeltoe(this Microsoft.Extensions.Hosting.IHostApplicationBuilder! builder, System.Collections.Generic.IReadOnlySet<string!>! assemblyNamesToExclude) -> Microsoft.Extensions.Hosting.IHostApplicationBuilder!
static Steeltoe.Bootstrap.AutoConfiguration.HostApplicationBuilderExtensions.AddSteeltoe(this Microsoft.Extensions.Hosting.IHostApplicationBuilder! builder, System.Collections.Generic.IReadOnlySet<string!>! assemblyNamesToExclude, Microsoft.Extensions.Logging.ILoggerFactory! loggerFactory) -> Microsoft.Extensions.Hosting.IHostApplicationBuilder!
static Steeltoe.Bootstrap.AutoConfiguration.HostBuilderExtensions.AddSteeltoe(this Microsoft.Extensions.Hosting.IHostBuilder! builder) -> Microsoft.Extensions.Hosting.IHostBuilder!
static Steeltoe.Bootstrap.AutoConfiguration.HostBuilderExtensions.AddSteeltoe(this Microsoft.Extensions.Hosting.IHostBuilder! builder, Microsoft.Extensions.Logging.ILoggerFactory! loggerFactory) -> Microsoft.Extensions.Hosting.IHostBuilder!
static Steeltoe.Bootstrap.AutoConfiguration.HostBuilderExtensions.AddSteeltoe(this Microsoft.Extensions.Hosting.IHostBuilder! builder, System.Collections.Generic.IReadOnlySet<string!>! assemblyNamesToExclude) -> Microsoft.Extensions.Hosting.IHostBuilder!
static Steeltoe.Bootstrap.AutoConfiguration.HostBuilderExtensions.AddSteeltoe(this Microsoft.Extensions.Hosting.IHostBuilder! builder, System.Collections.Generic.IReadOnlySet<string!>! assemblyNamesToExclude, Microsoft.Extensions.Logging.ILoggerFactory! loggerFactory) -> Microsoft.Extensions.Hosting.IHostBuilder!
static Steeltoe.Bootstrap.AutoConfiguration.WebApplicationBuilderExtensions.AddSteeltoe(this Microsoft.AspNetCore.Builder.WebApplicationBuilder! builder) -> Microsoft.AspNetCore.Builder.WebApplicationBuilder!
static Steeltoe.Bootstrap.AutoConfiguration.WebApplicationBuilderExtensions.AddSteeltoe(this Microsoft.AspNetCore.Builder.WebApplicationBuilder! builder, Microsoft.Extensions.Logging.ILoggerFactory! loggerFactory) -> Microsoft.AspNetCore.Builder.WebApplicationBuilder!
static Steeltoe.Bootstrap.AutoConfiguration.WebApplicationBuilderExtensions.AddSteeltoe(this Microsoft.AspNetCore.Builder.WebApplicationBuilder! builder, System.Collections.Generic.IReadOnlySet<string!>! assemblyNamesToExclude) -> Microsoft.AspNetCore.Builder.WebApplicationBuilder!
static Steeltoe.Bootstrap.AutoConfiguration.WebApplicationBuilderExtensions.AddSteeltoe(this Microsoft.AspNetCore.Builder.WebApplicationBuilder! builder, System.Collections.Generic.IReadOnlySet<string!>! assemblyNamesToExclude, Microsoft.Extensions.Logging.ILoggerFactory! loggerFactory) -> Microsoft.AspNetCore.Builder.WebApplicationBuilder!
static Steeltoe.Bootstrap.AutoConfiguration.WebHostBuilderExtensions.AddSteeltoe(this Microsoft.AspNetCore.Hosting.IWebHostBuilder! builder) -> Microsoft.AspNetCore.Hosting.IWebHostBuilder!
static Steeltoe.Bootstrap.AutoConfiguration.WebHostBuilderExtensions.AddSteeltoe(this Microsoft.AspNetCore.Hosting.IWebHostBuilder! builder, Microsoft.Extensions.Logging.ILoggerFactory! loggerFactory) -> Microsoft.AspNetCore.Hosting.IWebHostBuilder!
static Steeltoe.Bootstrap.AutoConfiguration.WebHostBuilderExtensions.AddSteeltoe(this Microsoft.AspNetCore.Hosting.IWebHostBuilder! builder, System.Collections.Generic.IReadOnlySet<string!>! assemblyNamesToExclude) -> Microsoft.AspNetCore.Hosting.IWebHostBuilder!
static Steeltoe.Bootstrap.AutoConfiguration.WebHostBuilderExtensions.AddSteeltoe(this Microsoft.AspNetCore.Hosting.IWebHostBuilder! builder, System.Collections.Generic.IReadOnlySet<string!>! assemblyNamesToExclude, Microsoft.Extensions.Logging.ILoggerFactory! loggerFactory) -> Microsoft.AspNetCore.Hosting.IWebHostBuilder!
Steeltoe.Bootstrap.AutoConfiguration.HostApplicationBuilderExtensions
Steeltoe.Bootstrap.AutoConfiguration.HostBuilderExtensions
Steeltoe.Bootstrap.AutoConfiguration.SteeltoeAssemblyNames
Steeltoe.Bootstrap.AutoConfiguration.WebApplicationBuilderExtensions
Steeltoe.Bootstrap.AutoConfiguration.WebHostBuilderExtensions
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
<Description>Package for automatically configuring Steeltoe packages that have separately been added to a project.</Description>
<PackageTags>Autoconfiguration;automatic configuration;application bootstrapping</PackageTags>
<IsPackable>true</IsPackable>
Expand Down
Loading