Skip to content

Commit cbf37be

Browse files
authored
Update .NET SDK to 1.1.2 (#488)
1 parent da4604c commit cbf37be

File tree

7 files changed

+26
-16
lines changed

7 files changed

+26
-16
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
typescript_latest: '1.9.3'
1919
java_latest: '1.23.0'
2020
python_latest: '1.6.0'
21-
csharp_latest: '0.1.1'
21+
csharp_latest: '1.1.2'
2222
steps:
2323
- run: 'echo noop'
2424

dotnet.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
2424
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
2525
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
26-
<PackageReference Include="Temporalio" Version="1.1.1">
26+
<PackageReference Include="Temporalio" Version="1.1.2">
2727
<!--
2828
We have to make sure this isn't included transitively so it can be
2929
overridden.

features/update/async_accepted/feature.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ public void ConfigureWorker(Runner runner, TemporalWorkerOptions options) =>
6161
runner.NewWorkflowOptions());
6262

6363
// Start update
64-
var updateHandle1 = await handle.StartUpdateAsync(wf => wf.SuccessfulUpdateAsync());
64+
var updateHandle1 = await handle.StartUpdateAsync(
65+
wf => wf.SuccessfulUpdateAsync(), new(WorkflowUpdateStage.Accepted));
6566
// Send signal to finish the update
6667
await handle.SignalAsync(wf => wf.FinishUpdateAsync());
6768
// Confirm result
@@ -70,7 +71,8 @@ public void ConfigureWorker(Runner runner, TemporalWorkerOptions options) =>
7071
Assert.Equal(123, await handle.GetUpdateHandle<int>(updateHandle1.Id).GetResultAsync());
7172

7273
// Start a failed update
73-
var updateHandle2 = await handle.StartUpdateAsync(wf => wf.FailureUpdateAsync());
74+
var updateHandle2 = await handle.StartUpdateAsync(
75+
wf => wf.FailureUpdateAsync(), new(WorkflowUpdateStage.Accepted));
7476
// Send signal to finish the update
7577
await handle.SignalAsync(wf => wf.FinishUpdateAsync());
7678
// Confirm failure
@@ -79,7 +81,8 @@ public void ConfigureWorker(Runner runner, TemporalWorkerOptions options) =>
7981
Assert.Equal("Intentional failure", exc.InnerException?.Message);
8082

8183
// Start an update but cancel/timeout waiting on its result
82-
var updateHandle3 = await handle.StartUpdateAsync(wf => wf.SuccessfulUpdateAsync());
84+
var updateHandle3 = await handle.StartUpdateAsync(
85+
wf => wf.SuccessfulUpdateAsync(), new(WorkflowUpdateStage.Accepted));
8386
// Wait for result only for 100ms
8487
using var tokenSource = new CancellationTokenSource();
8588
tokenSource.CancelAfter(TimeSpan.FromMilliseconds(100));

features/update/basic_async/feature.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ public void ConfigureWorker(Runner runner, TemporalWorkerOptions options) =>
4444
(MyWorkflow wf) => wf.RunAsync(),
4545
runner.NewWorkflowOptions());
4646

47-
var badUpdateHandle = await handle.StartUpdateAsync(wf => wf.MyUpdate("invalid"));
47+
var badUpdateHandle = await handle.StartUpdateAsync(
48+
wf => wf.MyUpdate("invalid"),
49+
new(WorkflowUpdateStage.Accepted));
4850

4951
try
5052
{
@@ -56,7 +58,9 @@ public void ConfigureWorker(Runner runner, TemporalWorkerOptions options) =>
5658
// Expected
5759
}
5860

59-
var goodUpdateHandle = await handle.StartUpdateAsync(wf => wf.MyUpdate("valid"));
61+
var goodUpdateHandle = await handle.StartUpdateAsync(
62+
wf => wf.MyUpdate("valid"),
63+
new(WorkflowUpdateStage.Accepted));
6064
Assert.Equal("hi", await goodUpdateHandle.GetResultAsync());
6165

6266
return handle;

features/update/deduplication/feature.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ public void ConfigureWorker(Runner runner, TemporalWorkerOptions options)
4141
runner.NewWorkflowOptions());
4242

4343
var updateId = "myid";
44-
await handle.ExecuteUpdateAsync(wf => wf.MyUpdate(false), new() {UpdateID = updateId});
44+
await handle.ExecuteUpdateAsync(wf => wf.MyUpdate(false), new() { Id = updateId });
4545
Assert.Equal(1, await handle.QueryAsync(wf => wf.Count));
46-
await handle.ExecuteUpdateAsync(wf => wf.MyUpdate(false), new() {UpdateID = updateId});
46+
await handle.ExecuteUpdateAsync(wf => wf.MyUpdate(false), new() { Id = updateId });
4747
Assert.Equal(1, await handle.QueryAsync(wf => wf.Count));
4848
await handle.ExecuteUpdateAsync(wf => wf.MyUpdate(true));
4949

harness/dotnet/Temporalio.Features.Harness/App.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ private static async Task RunCommandAsync(InvocationContext ctx)
9090
};
9191

9292
// Go over each feature, calling the runner for it
93-
var failureCount = 0;
93+
var failures = new List<string>();
9494
foreach (var (dir, taskQueue) in ctx.ParseResult.GetValueForArgument(featuresArgument))
9595
{
9696
var feature =
@@ -109,13 +109,14 @@ private static async Task RunCommandAsync(InvocationContext ctx)
109109
catch (Exception e)
110110
{
111111
logger.LogError(e, "Feature {Feature} failed", feature.Dir);
112-
failureCount++;
112+
failures.Add(feature.Dir);
113113
}
114114
}
115115

116-
if (failureCount > 0)
116+
if (failures.Count > 0)
117117
{
118-
throw new InvalidOperationException($"{failureCount} feature(s) failed");
118+
throw new InvalidOperationException(
119+
$"{failures.Count} feature(s) failed: {string.Join(", ", failures)}");
119120
}
120121

121122
logger.LogInformation("All features passed");

harness/dotnet/Temporalio.Features.Harness/Runner.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ internal Runner(
5454
Logger = loggerFactory.CreateLogger(PreparedFeature.FeatureType);
5555
Feature = (IFeature)Activator.CreateInstance(PreparedFeature.FeatureType, true)!;
5656

57-
ClientOptions = clientConnectOptions;
58-
Feature.ConfigureClient(this, clientConnectOptions);
57+
ClientOptions = (TemporalClientConnectOptions)clientConnectOptions.Clone();
58+
Feature.ConfigureClient(this, ClientOptions);
5959
WorkerOptions = new(taskQueue) { LoggerFactory = loggerFactory };
6060
}
6161

@@ -196,7 +196,9 @@ public async Task SkipIfAsyncUpdateNotSupportedAsync()
196196
public Task<bool> CheckAsyncUpdateSupportedAsync() =>
197197
CheckUpdateSupportCallAsync(() =>
198198
Client.GetWorkflowHandle("does-not-exist").StartUpdateAsync(
199-
"does-not-exist", Array.Empty<object?>()));
199+
"does-not-exist",
200+
Array.Empty<object?>(),
201+
new(WorkflowUpdateStage.Accepted)));
200202

201203
/// <summary>
202204
/// Start the worker.

0 commit comments

Comments
 (0)