Skip to content

Commit aa5dff2

Browse files
Merge branch 'main' into sburckha/dts-entities
# Conflicts: # eng/proto # src/Worker/Grpc/GrpcDurableTaskWorker.Processor.cs
2 parents 45f07a7 + 8f19c6f commit aa5dff2

38 files changed

+1865
-159
lines changed

.github/workflows/validate-build.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,14 @@ on:
1414

1515
env:
1616
solution: Microsoft.DurableTask.sln
17-
config: Release
17+
config: release
1818

1919
jobs:
2020
build:
21-
runs-on: ubuntu-latest
21+
runs-on: windows-latest
2222

2323
steps:
2424
- uses: actions/checkout@v3
25-
with:
26-
submodules: true
2725

2826
- name: Setup .NET 6.0
2927
uses: actions/setup-dotnet@v3
@@ -36,19 +34,19 @@ jobs:
3634
global-json-file: global.json
3735

3836
- name: Restore dependencies
39-
run: dotnet restore $solution
37+
run: dotnet restore $env:solution
4038

4139
- name: Build
42-
run: dotnet build $solution --configuration $config --no-restore -p:FileVersionRevision=$GITHUB_RUN_NUMBER -p:ContinuousIntegrationBuild=true
40+
run: dotnet build $env:solution --configuration $env:config --no-restore -p:FileVersionRevision=$env:GITHUB_RUN_NUMBER
4341

4442
- name: Test
45-
run: dotnet test $solution --configuration $config --no-build --verbosity normal
43+
run: dotnet test $env:solution --configuration $env:config --no-build --verbosity normal
4644

4745
- name: Pack
48-
run: dotnet pack $solution --configuration $config --no-build
46+
run: dotnet pack $env:solution --configuration $env:config --no-build
4947

5048
- name: Upload
51-
uses: actions/upload-artifact@v3
49+
uses: actions/upload-artifact@v4
5250
with:
5351
name: pkg
5452
path: out/pkg

.gitmodules

Lines changed: 0 additions & 3 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
### Microsoft.DurableTask.Worker
1010

1111
- Add new `IDurableTaskWorkerBuilder AddDurableTaskWorker(IServiceCollection, string?)` API
12+
- Add support for work item history streaming
13+
14+
### Microsoft.DurableTask.Grpc
15+
16+
- Replace submodule for proto files with download script for easier maintenance
17+
- Update to latest proto files
1218

1319
## v1.5.0
1420

Directory.Build.props

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,9 @@
3636
<StrongNamePublicKey>00240000048000009400000006020000002400005253413100040000010001000505410141442095e0b0466df68ac32d158abdf0bd9cf26407d7a9d20b93656530556f23979f20b067628b9baee75fc6bba5c349519585a2852c1843bc61d74c4cbf9d80429cbdcbf609ea70fd62061eb65f40a6c9d505dd71cb119ef51f589a014d3b56159abbc38825fafbd119b6e97ebd9a5f3862a5c06220c680a6ac9eec</StrongNamePublicKey>
3737
</PropertyGroup>
3838

39+
<PropertyGroup Condition="'$(ContinuousIntegrationBuild)' == ''">
40+
<ContinuousIntegrationBuild Condition="'$(CI)' == 'true'">true</ContinuousIntegrationBuild> <!-- GitHub actions -->
41+
<ContinuousIntegrationBuild Condition="'$(TF_BUILD)' == 'true'">true</ContinuousIntegrationBuild> <!-- Azure Devops -->
42+
</PropertyGroup>
43+
3944
</Project>

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,7 @@ There are also several features that aren't yet available:
167167

168168
## Obtaining the Protobuf definitions
169169

170-
This project utilizes git submodules to obtain Protobuf definitions from [durabletask-protobuf](https://github.com/microsoft/durabletask-protobuf). You will need to obtain these to build the project.
171-
172-
To get the definitions, run `git submodule update --init --recursive`
170+
This project utilizes protobuf definitions from [durabletask-protobuf](https://github.com/microsoft/durabletask-protobuf), which are copied (vendored) into this repository under the `src/Grpc` directory. See the corresponding [README.md](./src/Grpc/README.md) for more information about how to update the protobuf definitions.
173171

174172
## Contributing
175173

azure-pipelines-release.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ variables:
2828

2929
steps:
3030
- checkout: self
31-
submodules: true
3231

3332
- task: UseDotNet@2
3433
displayName: 'Install .NET 6 SDK (ESRP)' # This is needed for ESRP.

eng/templates/build.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ jobs:
2424

2525
steps:
2626
- checkout: self
27-
submodules: true
2827

2928
- task: UseDotNet@2
3029
displayName: 'Install .NET 6 SDK (ESRP)' # This is needed for ESRP.

src/Client/Core/DependencyInjection/DefaultDurableTaskClientBuilder.cs

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,20 @@ namespace Microsoft.DurableTask.Client;
99
/// <summary>
1010
/// Default builder for <see cref="IDurableTaskClientBuilder" />.
1111
/// </summary>
12-
public class DefaultDurableTaskClientBuilder : IDurableTaskClientBuilder
12+
/// <remarks>
13+
/// Initializes a new instance of the <see cref="DefaultDurableTaskClientBuilder"/> class.
14+
/// </remarks>
15+
/// <param name="name">The name of the builder.</param>
16+
/// <param name="services">The service collection.</param>
17+
public class DefaultDurableTaskClientBuilder(string? name, IServiceCollection services) : IDurableTaskClientBuilder
1318
{
1419
Type? buildTarget;
1520

16-
/// <summary>
17-
/// Initializes a new instance of the <see cref="DefaultDurableTaskClientBuilder"/> class.
18-
/// </summary>
19-
/// <param name="name">The name of the builder.</param>
20-
/// <param name="services">The service collection.</param>
21-
public DefaultDurableTaskClientBuilder(string? name, IServiceCollection services)
22-
{
23-
this.Name = name ?? Options.DefaultName;
24-
this.Services = services;
25-
}
26-
2721
/// <inheritdoc/>
28-
public string Name { get; }
22+
public string Name { get; } = name ?? Options.DefaultName;
2923

3024
/// <inheritdoc/>
31-
public IServiceCollection Services { get; }
25+
public IServiceCollection Services { get; } = services;
3226

3327
/// <inheritdoc/>
3428
public Type? BuildTarget

src/Client/Core/DurableTaskClientOptions.cs

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ namespace Microsoft.DurableTask.Client;
1111
public class DurableTaskClientOptions
1212
{
1313
DataConverter dataConverter = JsonDataConverter.Default;
14+
bool enableEntitySupport;
1415

1516
/// <summary>
1617
/// Gets or sets the data converter. Default value is <see cref="JsonDataConverter.Default" />.
@@ -50,7 +51,15 @@ public DataConverter DataConverter
5051
/// Gets or sets a value indicating whether this client should support entities. If true, all instance ids starting with '@' are reserved for entities,
5152
/// and validation checks are performed where appropriate.
5253
/// </summary>
53-
public bool EnableEntitySupport { get; set; }
54+
public bool EnableEntitySupport
55+
{
56+
get => this.enableEntitySupport;
57+
set
58+
{
59+
this.enableEntitySupport = value;
60+
this.EntitySupportExplicitlySet = true;
61+
}
62+
}
5463

5564
/// <summary>
5665
/// Gets a value indicating whether <see cref="DataConverter" /> was explicitly set or not.
@@ -63,6 +72,11 @@ public DataConverter DataConverter
6372
/// </remarks>
6473
internal bool DataConverterExplicitlySet { get; private set; }
6574

75+
/// <summary>
76+
/// Gets a value indicating whether <see cref="EnableEntitySupport" /> was explicitly set or not.
77+
/// </summary>
78+
internal bool EntitySupportExplicitlySet { get; private set; }
79+
6680
/// <summary>
6781
/// Applies these option values to another.
6882
/// </summary>
@@ -72,8 +86,15 @@ internal void ApplyTo(DurableTaskClientOptions other)
7286
if (other is not null)
7387
{
7488
// Make sure to keep this up to date as values are added.
75-
other.DataConverter = this.DataConverter;
76-
other.EnableEntitySupport = this.EnableEntitySupport;
89+
if (!other.DataConverterExplicitlySet)
90+
{
91+
other.DataConverter = this.DataConverter;
92+
}
93+
94+
if (!other.EntitySupportExplicitlySet)
95+
{
96+
other.EnableEntitySupport = this.EnableEntitySupport;
97+
}
7798
}
7899
}
79100
}

src/Client/Core/Entities/EntityMetadata.cs

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,15 @@ namespace Microsoft.DurableTask.Client.Entities;
1111
/// Represents entity metadata.
1212
/// </summary>
1313
/// <typeparam name="TState">The type of state held by the metadata.</typeparam>
14+
/// <remarks>
15+
/// Initializes a new instance of the <see cref="EntityMetadata{TState}"/> class.
16+
/// </remarks>
17+
/// <param name="id">The ID of the entity.</param>
1418
[JsonConverter(typeof(EntityMetadataConverter))]
15-
public class EntityMetadata<TState>
19+
public class EntityMetadata<TState>(EntityInstanceId id)
1620
{
1721
readonly TState? state;
1822

19-
/// <summary>
20-
/// Initializes a new instance of the <see cref="EntityMetadata{TState}"/> class.
21-
/// </summary>
22-
/// <param name="id">The ID of the entity.</param>
23-
public EntityMetadata(EntityInstanceId id)
24-
{
25-
this.Id = Check.NotDefault(id);
26-
this.IncludesState = false;
27-
}
28-
2923
/// <summary>
3024
/// Initializes a new instance of the <see cref="EntityMetadata{TState}"/> class.
3125
/// </summary>
@@ -41,7 +35,7 @@ public EntityMetadata(EntityInstanceId id, TState? state)
4135
/// <summary>
4236
/// Gets the ID for this entity.
4337
/// </summary>
44-
public EntityInstanceId Id { get; }
38+
public EntityInstanceId Id { get; } = Check.NotDefault(id);
4539

4640
/// <summary>
4741
/// Gets the time the entity was last modified.
@@ -64,9 +58,9 @@ public EntityMetadata(EntityInstanceId id, TState? state)
6458
/// <remarks>
6559
/// Queries can exclude the state of the entity from the metadata that is retrieved.
6660
/// </remarks>
67-
[MemberNotNullWhen(true, "State")]
68-
[MemberNotNullWhen(true, "state")]
69-
public bool IncludesState { get; }
61+
[MemberNotNullWhen(true, nameof(State))]
62+
[MemberNotNullWhen(true, nameof(state))]
63+
public bool IncludesState { get; } = false;
7064

7165
/// <summary>
7266
/// Gets the state for this entity.
@@ -96,16 +90,13 @@ public TState State
9690
/// <summary>
9791
/// Represents the metadata for a durable entity instance.
9892
/// </summary>
93+
/// <remarks>
94+
/// Initializes a new instance of the <see cref="EntityMetadata"/> class.
95+
/// </remarks>
96+
/// <param name="id">The ID of the entity.</param>
97+
/// <param name="state">The state of this entity.</param>
9998
[JsonConverter(typeof(EntityMetadataConverter))]
100-
public sealed class EntityMetadata : EntityMetadata<SerializedData>
99+
public sealed class EntityMetadata(EntityInstanceId id, SerializedData? state = null)
100+
: EntityMetadata<SerializedData>(id, state)
101101
{
102-
/// <summary>
103-
/// Initializes a new instance of the <see cref="EntityMetadata"/> class.
104-
/// </summary>
105-
/// <param name="id">The ID of the entity.</param>
106-
/// <param name="state">The state of this entity.</param>
107-
public EntityMetadata(EntityInstanceId id, SerializedData? state = null)
108-
: base(id, state)
109-
{
110-
}
111102
}

0 commit comments

Comments
 (0)