From 43ab140a7ce27e957d743c94dcf3230c7b926f85 Mon Sep 17 00:00:00 2001 From: Jacob Viau Date: Tue, 11 Feb 2025 09:00:43 -0800 Subject: [PATCH 1/3] Update build props and targets --- Directory.Build.props | 21 +++++------ Directory.Build.targets | 36 +----------------- eng/targets/Release.props | 15 ++++++++ eng/targets/Release.targets | 12 +++++- eng/targets/RepositoryInfo.targets | 37 +++++++++++++++++++ global.json | 2 +- samples/AzureFunctionsApp/Program.cs | 2 +- src/Directory.Build.props | 9 ----- src/Directory.Build.targets | 15 -------- .../Client.AzureManaged.Tests.csproj | 7 +--- test/Directory.Build.props | 1 + .../Shared.AzureManaged.Tests.csproj | 16 +++++--- .../Worker.AzureManaged.Tests.csproj | 6 +-- 13 files changed, 89 insertions(+), 90 deletions(-) create mode 100644 eng/targets/RepositoryInfo.targets diff --git a/Directory.Build.props b/Directory.Build.props index 644af0ec..7a9bbd31 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -18,15 +18,17 @@ Debug AnyCPU $(MSBuildThisFileDirectory) - $(RepoRoot)$([MSBuild]::EnsureTrailingSlash(out/$(SubOutRoot))) + $(RepoRoot)$([MSBuild]::EnsureTrailingSlash(out/$(SubOutRoot))) + pub + pkg $(RepoRoot)eng/ $(RepoRoot)src/ - $(OutRoot)bin/ - $(OutRoot)obj/$(MSBuildProjectName)/ - $(BaseIntermediateOutputPath)$(Configuration)/ - $(MSBuildProjectName)/ - $(BaseOutputPath)$(Configuration)/$([MSBuild]::EnsureTrailingSlash($(SubOutputPath))) - $(OutRoot)pkg/ + $(SrcRoot)Shared/ + + + + true + true @@ -36,9 +38,4 @@ 00240000048000009400000006020000002400005253413100040000010001000505410141442095e0b0466df68ac32d158abdf0bd9cf26407d7a9d20b93656530556f23979f20b067628b9baee75fc6bba5c349519585a2852c1843bc61d74c4cbf9d80429cbdcbf609ea70fd62061eb65f40a6c9d505dd71cb119ef51f589a014d3b56159abbc38825fafbd119b6e97ebd9a5f3862a5c06220c680a6ac9eec - - true - true - - diff --git a/Directory.Build.targets b/Directory.Build.targets index 89ae2eea..701926a6 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -15,39 +15,7 @@ + + - - - - - - - - false - <_TranslateUrlPattern>(https://azfunc%40dev\.azure\.com/azfunc/internal/_git|https://dev\.azure\.com/azfunc/internal/_git|https://azfunc\.visualstudio\.com/internal/_git|azfunc%40vs-ssh\.visualstudio\.com:v3/azfunc/internal|git%40ssh\.dev\.azure\.com:v3/azfunc/internal)/([^/\.]+)\.(.+) - <_TranslateUrlReplacement>https://github.com/$2/$3 - - - - - - $([System.Text.RegularExpressions.Regex]::Replace($(ScmRepositoryUrl), $(_TranslateUrlPattern), $(_TranslateUrlReplacement))) - - - - $([System.Text.RegularExpressions.Regex]::Replace(%(SourceRoot.ScmRepositoryUrl), $(_TranslateUrlPattern), $(_TranslateUrlReplacement))) - - - diff --git a/eng/targets/Release.props b/eng/targets/Release.props index 080917d8..03c56ed6 100644 --- a/eng/targets/Release.props +++ b/eng/targets/Release.props @@ -8,6 +8,7 @@ + Microsoft Corporation Microsoft © Microsoft Corporation. All rights reserved. https://github.com/microsoft/durabletask-dotnet @@ -16,6 +17,20 @@ Microsoft Durable Task Orchestration Workflow Activity Reliable DTFx + + + true + true + true + + + portable + + 1.5.0 diff --git a/eng/targets/Release.targets b/eng/targets/Release.targets index a9116354..c7078be4 100644 --- a/eng/targets/Release.targets +++ b/eng/targets/Release.targets @@ -12,8 +12,18 @@ README.md + + snupkg + true + + + + + $(VersionPrefix).$(FileVersionRevision) + + - + true content/SBOM diff --git a/eng/targets/RepositoryInfo.targets b/eng/targets/RepositoryInfo.targets new file mode 100644 index 00000000..027b7f3e --- /dev/null +++ b/eng/targets/RepositoryInfo.targets @@ -0,0 +1,37 @@ + + + + + + + + + false + <_TranslateUrlPattern>(https://azfunc%40dev\.azure\.com/azfunc/internal/_git|https://dev\.azure\.com/azfunc/internal/_git|https://azfunc\.visualstudio\.com/internal/_git|azfunc%40vs-ssh\.visualstudio\.com:v3/azfunc/internal|git%40ssh\.dev\.azure\.com:v3/azfunc/internal)/([^/\.]+)\.(.+) + <_TranslateUrlReplacement>https://github.com/$2/$3 + + + + + + $([System.Text.RegularExpressions.Regex]::Replace($(ScmRepositoryUrl), $(_TranslateUrlPattern), $(_TranslateUrlReplacement))) + + + + $([System.Text.RegularExpressions.Regex]::Replace(%(SourceRoot.ScmRepositoryUrl), $(_TranslateUrlPattern), $(_TranslateUrlReplacement))) + + + + + \ No newline at end of file diff --git a/global.json b/global.json index 4ac08fda..beb8a446 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.100", + "version": "9.0.102", "rollForward": "latestFeature" }, "msbuild-sdks": { diff --git a/samples/AzureFunctionsApp/Program.cs b/samples/AzureFunctionsApp/Program.cs index 3ec7a407..095b10b6 100644 --- a/samples/AzureFunctionsApp/Program.cs +++ b/samples/AzureFunctionsApp/Program.cs @@ -14,4 +14,4 @@ public static void Main() host.Run(); } -} \ No newline at end of file +} diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 84e04bc1..fb6dcdba 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -5,18 +5,9 @@ - Microsoft Corporation - true - true - true true latest recommended - $(SrcRoot)Shared/ - - portable diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets index 13d3e148..4cc6865e 100644 --- a/src/Directory.Build.targets +++ b/src/Directory.Build.targets @@ -3,20 +3,6 @@ - - snupkg - true - - - - - $(VersionPrefix).$(FileVersionRevision) - - - - - - @@ -26,7 +12,6 @@ - diff --git a/test/Client/AzureManaged.Tests/Client.AzureManaged.Tests.csproj b/test/Client/AzureManaged.Tests/Client.AzureManaged.Tests.csproj index d7f4726c..8f1942be 100644 --- a/test/Client/AzureManaged.Tests/Client.AzureManaged.Tests.csproj +++ b/test/Client/AzureManaged.Tests/Client.AzureManaged.Tests.csproj @@ -4,17 +4,12 @@ net6.0 - - - - - - + diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 29d5d606..f7f28faf 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -9,6 +9,7 @@ false + false false diff --git a/test/Shared/AzureManaged.Tests/Shared.AzureManaged.Tests.csproj b/test/Shared/AzureManaged.Tests/Shared.AzureManaged.Tests.csproj index a30522af..10b2aa80 100644 --- a/test/Shared/AzureManaged.Tests/Shared.AzureManaged.Tests.csproj +++ b/test/Shared/AzureManaged.Tests/Shared.AzureManaged.Tests.csproj @@ -2,19 +2,23 @@ net6.0 + true - - - - - + - + + + + + + + + diff --git a/test/Worker/AzureManaged.Tests/Worker.AzureManaged.Tests.csproj b/test/Worker/AzureManaged.Tests/Worker.AzureManaged.Tests.csproj index c22ad3f9..e708ad62 100644 --- a/test/Worker/AzureManaged.Tests/Worker.AzureManaged.Tests.csproj +++ b/test/Worker/AzureManaged.Tests/Worker.AzureManaged.Tests.csproj @@ -9,11 +9,7 @@ - - + - - - From b9cd53f300cb719f1a7490b78255e2a7286471cc Mon Sep 17 00:00:00 2001 From: Jacob Viau Date: Tue, 11 Feb 2025 09:05:37 -0800 Subject: [PATCH 2/3] Address new analyzer warnings --- .../DurableTaskClientBuilderExtensions.cs | 2 +- src/Generators/DurableTaskSourceGenerator.cs | 16 ++++++---------- .../DurableTaskWorkerBuilderExtensions.cs | 2 +- .../Grpc/GrpcDurableTaskWorker.Processor.cs | 3 ++- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/Client/Core/DependencyInjection/DurableTaskClientBuilderExtensions.cs b/src/Client/Core/DependencyInjection/DurableTaskClientBuilderExtensions.cs index bb274ad0..d3cf15ab 100644 --- a/src/Client/Core/DependencyInjection/DurableTaskClientBuilderExtensions.cs +++ b/src/Client/Core/DependencyInjection/DurableTaskClientBuilderExtensions.cs @@ -80,7 +80,7 @@ public static IDurableTaskClientBuilder UseBuildTarget(this I where TTarget : DurableTaskClient where TOptions : DurableTaskClientOptions { - builder.UseBuildTarget(typeof(TTarget)); + builder.UseBuildTarget(); builder.Services.AddOptions(builder.Name) .PostConfigure>((options, baseOptions) => { diff --git a/src/Generators/DurableTaskSourceGenerator.cs b/src/Generators/DurableTaskSourceGenerator.cs index 4ad0eb2d..9ff9df73 100644 --- a/src/Generators/DurableTaskSourceGenerator.cs +++ b/src/Generators/DurableTaskSourceGenerator.cs @@ -275,13 +275,9 @@ internal static DurableTaskRegistry AddAllGeneratedTasks(this DurableTaskRegistr class DurableTaskSyntaxReceiver : ISyntaxContextReceiver { - readonly List orchestrators = new(); - readonly List activities = new(); - readonly List durableFunctions = new(); - - public IReadOnlyList Orchestrators => this.orchestrators; - public IReadOnlyList Activities => this.activities; - public IReadOnlyList DurableFunctions => this.durableFunctions; + public List Orchestrators { get; } = []; + public List Activities { get; } = []; + public List DurableFunctions { get; } = []; public void OnVisitSyntaxNode(GeneratorSyntaxContext context) { @@ -291,7 +287,7 @@ public void OnVisitSyntaxNode(GeneratorSyntaxContext context) function != null) { Debug.WriteLine($"Adding {function.Kind} function '{function.Name}'"); - this.durableFunctions.Add(function); + this.DurableFunctions.Add(function); return; } @@ -338,13 +334,13 @@ public void OnVisitSyntaxNode(GeneratorSyntaxContext context) { if (baseType.Name == "TaskActivity") { - taskList = this.activities; + taskList = this.Activities; taskType = baseType; break; } else if (baseType.Name == "TaskOrchestrator") { - taskList = this.orchestrators; + taskList = this.Orchestrators; taskType = baseType; break; } diff --git a/src/Worker/Core/DependencyInjection/DurableTaskWorkerBuilderExtensions.cs b/src/Worker/Core/DependencyInjection/DurableTaskWorkerBuilderExtensions.cs index b2911842..f914db2a 100644 --- a/src/Worker/Core/DependencyInjection/DurableTaskWorkerBuilderExtensions.cs +++ b/src/Worker/Core/DependencyInjection/DurableTaskWorkerBuilderExtensions.cs @@ -77,7 +77,7 @@ public static IDurableTaskWorkerBuilder UseBuildTarget(this I where TTarget : DurableTaskWorker where TOptions : DurableTaskWorkerOptions { - builder.UseBuildTarget(typeof(TTarget)); + builder.UseBuildTarget(); builder.Services.AddOptions(builder.Name) .PostConfigure>((options, baseOptions) => { diff --git a/src/Worker/Grpc/GrpcDurableTaskWorker.Processor.cs b/src/Worker/Grpc/GrpcDurableTaskWorker.Processor.cs index 059d592d..9275ad4e 100644 --- a/src/Worker/Grpc/GrpcDurableTaskWorker.Processor.cs +++ b/src/Worker/Grpc/GrpcDurableTaskWorker.Processor.cs @@ -6,6 +6,7 @@ using DurableTask.Core.Entities; using DurableTask.Core.Entities.OperationFormat; using DurableTask.Core.History; +using Google.Protobuf.Collections; using Microsoft.DurableTask.Entities; using Microsoft.DurableTask.Worker.Shims; using Microsoft.Extensions.DependencyInjection; @@ -86,7 +87,7 @@ public async Task ExecuteAsync(CancellationToken cancellation) } } - static string GetActionsListForLogging(IReadOnlyList actions) + static string GetActionsListForLogging(RepeatedField actions) { if (actions.Count == 0) { From bac2dcad60c862eeb213ae3236ccf281a925d7e4 Mon Sep 17 00:00:00 2001 From: Jacob Viau Date: Tue, 11 Feb 2025 09:12:46 -0800 Subject: [PATCH 3/3] Update pack dir in CI --- .github/workflows/validate-build.yml | 2 +- eng/templates/build.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/validate-build.yml b/.github/workflows/validate-build.yml index 497ceac7..439f5ce6 100644 --- a/.github/workflows/validate-build.yml +++ b/.github/workflows/validate-build.yml @@ -49,4 +49,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: pkg - path: out/pkg + path: out/pkg/$env:config diff --git a/eng/templates/build.yml b/eng/templates/build.yml index a94d3aff..f8ed7222 100644 --- a/eng/templates/build.yml +++ b/eng/templates/build.yml @@ -69,7 +69,7 @@ jobs: inputs: command: custom custom: pack - arguments: --no-build $(build_args) $(pack_binlog) + arguments: --no-build $(build_args) $(pack_binlog) -o $(pkg_dir) projects: $(project) - template: ci/sign-files.yml@eng