Skip to content

Commit 387ce19

Browse files
sophiatevSophia Tevosyan
andauthored
Removing breaking change for TaskOptions (#446)
* removed optional parameter for first TaskOptions constructor, now it is non-optional * updating package version * added changelog updates * added updated reference to dt.core package 3.3.0 * fixing changelog * adding tests that are not complete for now * added tests --------- Co-authored-by: Sophia Tevosyan <[email protected]>
1 parent 54929ba commit 387ce19

File tree

5 files changed

+61
-8
lines changed

5 files changed

+61
-8
lines changed

CHANGELOG.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,25 @@
22

33
## (Unreleased)
44

5-
- Add New Property Properties to TaskOrchestrationContext by @nytian in [#415](https://github.com/microsoft/durabletask-dotnet/pull/415)
6-
- Add automatic retry on gateway timeout in `GrpcDurableTaskClient.WaitForInstanceCompletionAsync` in [#412](https://github.com/microsoft/durabletask-dotnet/pull/412))
7-
- Add specific logging for NotFound error on worker connection by @halspang in ([#413](https://github.com/microsoft/durabletask-dotnet/pull/413))
8-
- Add user agent header to gRPC called in ([#417](https://github.com/microsoft/durabletask-dotnet/pull/417))
5+
## v1.12.0
6+
7+
- Activity tag support ([#426](https://github.com/microsoft/durabletask-dotnet/pull/426))
8+
- Adding Analyzer to build and release ([#444](https://github.com/microsoft/durabletask-dotnet/pull/444))
9+
- Add ability to filter orchestrations at worker ([#443](https://github.com/microsoft/durabletask-dotnet/pull/443))
10+
- Removing breaking change for TaskOptions ([#446](https://github.com/microsoft/durabletask-dotnet/pull/446))
11+
12+
## v1.11.0
13+
14+
- Add New Property Properties to TaskOrchestrationContext ([#415](https://github.com/microsoft/durabletask-dotnet/pull/415))
15+
- Add automatic retry on gateway timeout in `GrpcDurableTaskClient.WaitForInstanceCompletionAsync` ([#412](https://github.com/microsoft/durabletask-dotnet/pull/412))
16+
- Add specific logging for NotFound error on worker connection ([#413](https://github.com/microsoft/durabletask-dotnet/pull/413))
17+
- Add user agent header to gRPC called ([#417](https://github.com/microsoft/durabletask-dotnet/pull/417))
918
- Enrich User-Agent Header in gRPC Metadata to indicate Client or Worker as caller ([#421](https://github.com/microsoft/durabletask-dotnet/pull/421))
19+
- Change DTS user agent metadata to avoid overlap with gRPC user agent ([#423](https://github.com/microsoft/durabletask-dotnet/pull/423))
1020
- Add extension methods for registering entities by type ([#427](https://github.com/microsoft/durabletask-dotnet/pull/427))
1121
- Add TaskVersion and utilize it for version overrides when starting orchestrations ([#416](https://github.com/microsoft/durabletask-dotnet/pull/416))
22+
- Update sub-orchestration default versioning ([#437](https://github.com/microsoft/durabletask-dotnet/pull/437))
23+
- Distributed Tracing for Entities (Isolated) ([#404](https://github.com/microsoft/durabletask-dotnet/pull/404))
1224

1325
## v1.10.0
1426

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
<!-- DurableTask Packages -->
3030
<ItemGroup>
31-
<PackageVersion Include="Microsoft.Azure.DurableTask.Core" Version="3.2.0" />
31+
<PackageVersion Include="Microsoft.Azure.DurableTask.Core" Version="3.3.0" />
3232
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Extensions.DurableTask" Version="1.2.2" />
3333
</ItemGroup>
3434

eng/targets/Release.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
</PropertyGroup>
1818

1919
<PropertyGroup>
20-
<VersionPrefix>1.11.0</VersionPrefix>
20+
<VersionPrefix>1.12.0</VersionPrefix>
2121
<VersionSuffix></VersionSuffix>
2222
</PropertyGroup>
2323

src/Abstractions/TaskOptions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ public record TaskOptions
1414
/// Initializes a new instance of the <see cref="TaskOptions"/> class.
1515
/// </summary>
1616
/// <param name="retry">The task retry options.</param>
17-
public TaskOptions(TaskRetryOptions? retry = null)
17+
public TaskOptions(TaskRetryOptions? retry)
18+
: this(retry, null)
1819
{
19-
this.Retry = retry;
2020
}
2121

2222
/// <summary>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT License.
3+
4+
namespace Microsoft.DurableTask.Tests;
5+
6+
public class TaskOptionsTests
7+
{
8+
[Fact]
9+
public void Empty_Ctors_Okay()
10+
{
11+
TaskOptions options = new();
12+
options.Retry.Should().BeNull();
13+
options.Tags.Should().BeNull();
14+
15+
SubOrchestrationOptions subOptions = new();
16+
subOptions.Retry.Should().BeNull();
17+
subOptions.Tags.Should().BeNull();
18+
subOptions.InstanceId.Should().BeNull();
19+
20+
StartOrchestrationOptions startOptions = new();
21+
startOptions.Version.Should().BeNull();
22+
startOptions.InstanceId.Should().BeNull();
23+
startOptions.StartAt.Should().BeNull();
24+
startOptions.Tags.Should().BeEmpty();
25+
}
26+
27+
[Fact]
28+
public void SubOrchestrationOptions_InstanceId_Correct()
29+
{
30+
string instanceId = Guid.NewGuid().ToString();
31+
SubOrchestrationOptions subOptions = new(new TaskOptions(), instanceId);
32+
instanceId.Equals(subOptions.InstanceId).Should().BeTrue();
33+
34+
string subInstanceId = Guid.NewGuid().ToString();
35+
subOptions = new(new SubOrchestrationOptions(instanceId: subInstanceId));
36+
subInstanceId.Equals(subOptions.InstanceId).Should().BeTrue();
37+
38+
subOptions = new(new SubOrchestrationOptions(instanceId: subInstanceId), instanceId);
39+
instanceId.Equals(subOptions.InstanceId).Should().BeTrue();
40+
}
41+
}

0 commit comments

Comments
 (0)