Skip to content

Commit

Permalink
Update Microsoft.Extensions.Hosting and other CI failure fixes (#370)
Browse files Browse the repository at this point in the history
  • Loading branch information
cretz authored Nov 22, 2024
1 parent 46410a6 commit c30a2db
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Temporalio/Client/ITemporalClientExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public static async IAsyncEnumerable<WorkflowHistory> ListWorkflowHistoriesAsync
WorkflowListOptions? listOptions = null,
WorkflowHistoryEventFetchOptions? historyFetchOptions = null)
{
await foreach (var exec in client.ListWorkflowsAsync(query, listOptions))
await foreach (var exec in client.ListWorkflowsAsync(query, listOptions).ConfigureAwait(false))
{
yield return await client.GetWorkflowHandle(
exec.Id, exec.RunId).FetchHistoryAsync(historyFetchOptions).ConfigureAwait(false);
Expand Down
2 changes: 1 addition & 1 deletion src/Temporalio/Client/WorkflowHandle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ public async Task<WorkflowHistory> FetchHistoryAsync(
};
}
var events = new List<HistoryEvent>();
await foreach (var evt in FetchHistoryEventsAsync(eventFetchOptions))
await foreach (var evt in FetchHistoryEventsAsync(eventFetchOptions).ConfigureAwait(false))
{
events.Add(evt);
}
Expand Down
3 changes: 2 additions & 1 deletion src/Temporalio/Worker/WorkflowInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
using Google.Protobuf.Collections;
using Microsoft.Extensions.Logging;
using Temporalio.Api.Common.V1;
using Temporalio.Bridge.Api.ActivityResult;
Expand Down Expand Up @@ -1360,7 +1361,7 @@ private void OnUpdateDefinitionAdded(string name, WorkflowUpdateDefinition defn)

private object?[] DecodeArgs(
MethodInfo method,
IReadOnlyCollection<Payload> payloads,
RepeatedField<Payload> payloads,
string itemName,
bool dynamic,
string? dynamicArgPrepend = null)
Expand Down
2 changes: 1 addition & 1 deletion src/Temporalio/Worker/WorkflowReplayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public async IAsyncEnumerable<WorkflowReplayResult> ReplayWorkflowsAsync(
try
{
var results = new List<WorkflowReplayResult>();
await foreach (var history in histories)
await foreach (var history in histories.ConfigureAwait(false))
{
// Run until complete or cancelled, throw if cancelled, yield if complete
var runTask = runner.RunWorkflowAsync(history);
Expand Down
3 changes: 3 additions & 0 deletions tests/Temporalio.SimpleBench/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

# Please keep in alphabetical order by field.

# Don't care about item visibility
dotnet_diagnostic.CA1515.severity = none

# Some versions can't tell implicit Program shouldn't need to be instantiated
dotnet_diagnostic.CA1812.severity = none

Expand Down
2 changes: 1 addition & 1 deletion tests/Temporalio.SimpleBench/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
MaxConcurrentActivities = maxConcurrent,
}.
AddActivity(BenchActivities.BenchActivity).
AddWorkflow(typeof(BenchWorkflow)));
AddWorkflow<BenchWorkflow>());
using var cancelSource = CancellationTokenSource.CreateLinkedTokenSource(ctx.GetCancellationToken());
var workerTask = Task.Run(() => worker.ExecuteAsync(cancelSource.Token));
Expand Down
4 changes: 2 additions & 2 deletions tests/Temporalio.SimpleBench/Temporalio.SimpleBench.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<ItemGroup>
<ProjectReference Include="..\..\src\Temporalio\Temporalio.csproj" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.1" />
</ItemGroup>

</Project>
6 changes: 6 additions & 0 deletions tests/Temporalio.Tests/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ dotnet_diagnostic.CA1024.severity = none
# We use empty interfaces in some tests
dotnet_diagnostic.CA1040.severity = none

# Don't care about test item visibility
dotnet_diagnostic.CA1515.severity = none

# Tests can have underscores in method names
dotnet_diagnostic.CA1707.severity = none

Expand All @@ -31,6 +34,9 @@ dotnet_diagnostic.CA2007.severity = none
# Do not need task scheduler for workflows
dotnet_diagnostic.CA2008.severity = none

# Testing specific overloads is ok
dotnet_diagnostic.CA2263.severity = none

# Workflow randomness is intentionally deterministic
dotnet_diagnostic.CA5394.severity = none

Expand Down
12 changes: 9 additions & 3 deletions tests/Temporalio.Tests/Temporalio.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,21 @@
<ItemGroup>
<PackageReference Include="coverlet.collector" Version="3.1.2" />
<PackageReference Include="MartinCostello.Logging.XUnit" Version="0.3.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="OpenTelemetry.Exporter.InMemory" Version="1.4.0" />
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="7.0.0" />
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="8.0.1" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.console" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
<PackageReference Include="Xunit.SkippableFact" Version="1.4.13" />

<!-- Resolve https://github.com/advisories/GHSA-7jgj-8wvc-jh57 -->
<PackageReference Include="System.Net.Http" Version="4.3.4" />

<!-- Resolve https://github.com/advisories/GHSA-cmhx-cq75-c4mj -->
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit c30a2db

Please sign in to comment.