Skip to content

Commit 1b7c9f4

Browse files
Merge 1.13 release branch back to master (#1247)
* Update protos and related use for Dapr 1.13. (#1236) * Update protos and related use. Signed-off-by: Phillip Hoff <[email protected]> * Update Dapr runtime version. Signed-off-by: Phillip Hoff <[email protected]> * Init properties. Signed-off-by: Phillip Hoff <[email protected]> --------- Signed-off-by: Phillip Hoff <[email protected]> * Update artifact action versions. (#1240) Signed-off-by: Phillip Hoff <[email protected]> * Make recursive true as default (#1243) Signed-off-by: Shivam Kumar <[email protected]> * Make final 1.13 changes. Signed-off-by: Phillip Hoff <[email protected]> --------- Signed-off-by: Phillip Hoff <[email protected]> Signed-off-by: Shivam Kumar <[email protected]> Co-authored-by: Shivam Kumar <[email protected]>
1 parent c07eb69 commit 1b7c9f4

File tree

8 files changed

+65
-35
lines changed

8 files changed

+65
-35
lines changed

.github/workflows/itests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ jobs:
4242
GOOS: linux
4343
GOARCH: amd64
4444
GOPROXY: https://proxy.golang.org
45-
DAPR_CLI_VER: 1.12.0
46-
DAPR_RUNTIME_VER: 1.12.0
47-
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/release-1.12/install/install.sh
45+
DAPR_CLI_VER: 1.13.0
46+
DAPR_RUNTIME_VER: 1.13.0
47+
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/release-1.13/install/install.sh
4848
DAPR_CLI_REF: ''
4949
steps:
5050
- name: Set up Dapr CLI

.github/workflows/sdk_build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Generate Packages
3333
run: dotnet pack --configuration release
3434
- name: Upload packages
35-
uses: actions/upload-artifact@master
35+
uses: actions/upload-artifact@v4
3636
with:
3737
name: packages
3838
path: ${{ env.NUPKG_OUTDIR }}
@@ -116,7 +116,7 @@ jobs:
116116
if: startswith(github.ref, 'refs/tags/v') && !(endsWith(github.ref, '-rc') || endsWith(github.ref, '-dev') || endsWith(github.ref, '-prerelease'))
117117
steps:
118118
- name: Download release artifacts
119-
uses: actions/download-artifact@v2
119+
uses: actions/download-artifact@v4
120120
with:
121121
name: packages
122122
path: packages

src/Dapr.Client/DaprClientGrpc.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2340,7 +2340,7 @@ public override async Task WaitForSidecarAsync(CancellationToken cancellationTok
23402340
/// <inheritdoc/>
23412341
public async override Task ShutdownSidecarAsync(CancellationToken cancellationToken = default)
23422342
{
2343-
await client.ShutdownAsync(new Empty(), CreateCallOptions(null, cancellationToken));
2343+
await client.ShutdownAsync(new Autogenerated.ShutdownRequest(), CreateCallOptions(null, cancellationToken));
23442344
}
23452345

23462346
/// <inheritdoc/>
@@ -2349,9 +2349,9 @@ public override async Task<DaprMetadata> GetMetadataAsync(CancellationToken canc
23492349
var options = CreateCallOptions(headers: null, cancellationToken);
23502350
try
23512351
{
2352-
var response = await client.GetMetadataAsync(new Empty(), options);
2352+
var response = await client.GetMetadataAsync(new Autogenerated.GetMetadataRequest(), options);
23532353
return new DaprMetadata(response.Id,
2354-
response.ActiveActorsCount.Select(c => new DaprActorMetadata(c.Type, c.Count)).ToList(),
2354+
response.ActorRuntime.ActiveActors.Select(c => new DaprActorMetadata(c.Type, c.Count)).ToList(),
23552355
response.ExtendedMetadata.ToDictionary(c => c.Key, c => c.Value),
23562356
response.RegisteredComponents.Select(c => new DaprComponentsMetadata(c.Name, c.Type, c.Version, c.Capabilities.ToArray())).ToList());
23572357
}

src/Dapr.Client/DaprMetadata.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// limitations under the License.
1212
// ------------------------------------------------------------------------
1313

14+
using System;
1415
using System.Collections.Generic;
1516

1617
namespace Dapr.Client

src/Dapr.Client/Protos/dapr/proto/dapr/v1/dapr.proto

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ service Dapr {
7979
// Unregister an actor reminder.
8080
rpc UnregisterActorReminder(UnregisterActorReminderRequest) returns (google.protobuf.Empty) {}
8181

82-
// Rename an actor reminder.
83-
rpc RenameActorReminder(RenameActorReminderRequest) returns (google.protobuf.Empty) {}
84-
8582
// Gets the state for a specific actor.
8683
rpc GetActorState(GetActorStateRequest) returns (GetActorStateResponse) {}
8784

@@ -122,7 +119,7 @@ service Dapr {
122119
rpc DecryptAlpha1(stream DecryptRequest) returns (stream DecryptResponse);
123120

124121
// Gets metadata of the sidecar
125-
rpc GetMetadata (google.protobuf.Empty) returns (GetMetadataResponse) {}
122+
rpc GetMetadata (GetMetadataRequest) returns (GetMetadataResponse) {}
126123

127124
// Sets value in extended metadata of the sidecar
128125
rpc SetMetadata (SetMetadataRequest) returns (google.protobuf.Empty) {}
@@ -190,7 +187,7 @@ service Dapr {
190187
// Raise an event to a running workflow instance
191188
rpc RaiseEventWorkflowBeta1 (RaiseEventWorkflowRequest) returns (google.protobuf.Empty) {}
192189
// Shutdown the sidecar
193-
rpc Shutdown (google.protobuf.Empty) returns (google.protobuf.Empty) {}
190+
rpc Shutdown (ShutdownRequest) returns (google.protobuf.Empty) {}
194191
}
195192

196193
// InvokeServiceRequest represents the request message for Service invocation.
@@ -407,15 +404,13 @@ message BulkPublishResponse {
407404

408405
// BulkPublishResponseFailedEntry is the message containing the entryID and error of a failed event in BulkPublishEvent call
409406
message BulkPublishResponseFailedEntry {
410-
411407
// The response scoped unique ID referring to this message
412408
string entry_id = 1;
413409

414410
// The error message if any on failure
415411
string error = 2;
416412
}
417413

418-
419414
// InvokeBindingRequest is the message to send data to output bindings
420415
message InvokeBindingRequest {
421416
// The name of the output binding to invoke.
@@ -544,14 +539,6 @@ message UnregisterActorReminderRequest {
544539
string name = 3;
545540
}
546541

547-
// RenameActorReminderRequest is the message to rename an actor reminder.
548-
message RenameActorReminderRequest {
549-
string actor_type = 1;
550-
string actor_id = 2;
551-
string old_name = 3;
552-
string new_name = 4;
553-
}
554-
555542
// GetActorStateRequest is the message to get key-value states from specific actor.
556543
message GetActorStateRequest {
557544
string actor_type = 1;
@@ -600,17 +587,45 @@ message InvokeActorResponse {
600587
bytes data = 1;
601588
}
602589

603-
// GetMetadataResponse is a message that is returned on GetMetadata rpc call
590+
// GetMetadataRequest is the message for the GetMetadata request.
591+
message GetMetadataRequest {
592+
// Empty
593+
}
594+
595+
// GetMetadataResponse is a message that is returned on GetMetadata rpc call.
604596
message GetMetadataResponse {
605597
string id = 1;
606-
repeated ActiveActorsCount active_actors_count = 2 [json_name = "actors"];
598+
// Deprecated alias for actor_runtime.active_actors.
599+
repeated ActiveActorsCount active_actors_count = 2 [json_name = "actors", deprecated = true];
607600
repeated RegisteredComponents registered_components = 3 [json_name = "components"];
608601
map<string, string> extended_metadata = 4 [json_name = "extended"];
609602
repeated PubsubSubscription subscriptions = 5 [json_name = "subscriptions"];
610603
repeated MetadataHTTPEndpoint http_endpoints = 6 [json_name = "httpEndpoints"];
611604
AppConnectionProperties app_connection_properties = 7 [json_name = "appConnectionProperties"];
612605
string runtime_version = 8 [json_name = "runtimeVersion"];
613606
repeated string enabled_features = 9 [json_name = "enabledFeatures"];
607+
ActorRuntime actor_runtime = 10 [json_name = "actorRuntime"];
608+
}
609+
610+
message ActorRuntime {
611+
enum ActorRuntimeStatus {
612+
// Indicates that the actor runtime is still being initialized.
613+
INITIALIZING = 0;
614+
// Indicates that the actor runtime is disabled.
615+
// This normally happens when Dapr is started without "placement-host-address"
616+
DISABLED = 1;
617+
// Indicates the actor runtime is running, either as an actor host or client.
618+
RUNNING = 2;
619+
}
620+
621+
// Contains an enum indicating whether the actor runtime has been initialized.
622+
ActorRuntimeStatus runtime_status = 1 [json_name = "runtimeStatus"];
623+
// Count of active actors per type.
624+
repeated ActiveActorsCount active_actors = 2 [json_name = "activeActors"];
625+
// Indicates whether the actor runtime is ready to host actors.
626+
bool host_ready = 3 [json_name = "hostReady"];
627+
// Custom message from the placement provider.
628+
string placement = 4 [json_name = "placement"];
614629
}
615630

616631
message ActiveActorsCount {
@@ -1088,3 +1103,8 @@ message PurgeWorkflowRequest {
10881103
// Name of the workflow component.
10891104
string workflow_component = 2 [json_name = "workflowComponent"];
10901105
}
1106+
1107+
// ShutdownRequest is the request for Shutdown.
1108+
message ShutdownRequest {
1109+
// Empty
1110+
}

src/Dapr.Workflow/Dapr.Workflow.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
</PropertyGroup>
1414

1515
<ItemGroup>
16-
<PackageReference Include="Microsoft.DurableTask.Client.Grpc" Version="1.0.*" />
17-
<PackageReference Include="Microsoft.DurableTask.Worker.Grpc" Version="1.0.*" />
16+
<PackageReference Include="Microsoft.DurableTask.Client.Grpc" Version="1.2.*" />
17+
<PackageReference Include="Microsoft.DurableTask.Worker.Grpc" Version="1.2.*" />
1818
</ItemGroup>
1919

2020
<ItemGroup>

src/Dapr.Workflow/DaprWorkflowClient.cs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,10 @@ public async Task<WorkflowState> WaitForWorkflowCompletionAsync(
158158
/// the terminated state.
159159
/// </para>
160160
/// <para>
161-
/// Terminating a workflow instance has no effect on any in-flight activity function executions
162-
/// or child workflows that were started by the terminated instance. Those actions will continue to run
163-
/// without interruption. However, their results will be discarded. If you want to terminate child-workflows,
164-
/// you must issue separate terminate commands for each child workflow instance individually.
161+
/// Terminating a workflow terminates all of the child workflow instances that were created by the target. But it
162+
/// has no effect on any in-flight activity function executions
163+
/// that were started by the terminated instance. Those actions will continue to run
164+
/// without interruption. However, their results will be discarded.
165165
/// </para><para>
166166
/// At the time of writing, there is no way to terminate an in-flight activity execution.
167167
/// </para>
@@ -178,7 +178,11 @@ public Task TerminateWorkflowAsync(
178178
string? output = null,
179179
CancellationToken cancellation = default)
180180
{
181-
return this.innerClient.TerminateInstanceAsync(instanceId, output, cancellation);
181+
TerminateInstanceOptions options = new TerminateInstanceOptions {
182+
Output = output,
183+
Recursive = true,
184+
};
185+
return this.innerClient.TerminateInstanceAsync(instanceId, options, cancellation);
182186
}
183187

184188
/// <summary>
@@ -269,6 +273,9 @@ public Task ResumeWorkflowAsync(
269273
/// <see cref="WorkflowRuntimeStatus.Completed"/>, <see cref="WorkflowRuntimeStatus.Failed"/>, or
270274
/// <see cref="WorkflowRuntimeStatus.Terminated"/> state can be purged.
271275
/// </para>
276+
/// <para>
277+
/// Purging a workflow purges all of the child workflows that were created by the target.
278+
/// </para>
272279
/// </remarks>
273280
/// <param name="instanceId">The unique ID of the workflow instance to purge.</param>
274281
/// <param name="cancellation">
@@ -280,7 +287,8 @@ public Task ResumeWorkflowAsync(
280287
/// </returns>
281288
public async Task<bool> PurgeInstanceAsync(string instanceId, CancellationToken cancellation = default)
282289
{
283-
PurgeResult result = await this.innerClient.PurgeInstanceAsync(instanceId, cancellation);
290+
PurgeInstanceOptions options = new PurgeInstanceOptions {Recursive = true};
291+
PurgeResult result = await this.innerClient.PurgeInstanceAsync(instanceId, options, cancellation);
284292
return result.PurgedInstanceCount > 0;
285293
}
286294

test/Dapr.Client.Test/DaprClientTest.InvokeMethodGrpcAsync.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ public async Task GetMetadataAsync_WrapsRpcException()
368368
var rpcException = new RpcException(rpcStatus, new Metadata(), rpcExceptionMessage);
369369

370370
client.Mock
371-
.Setup(m => m.GetMetadataAsync(It.IsAny<Empty>(), It.IsAny<CallOptions>()))
371+
.Setup(m => m.GetMetadataAsync(It.IsAny<GetMetadataRequest>(), It.IsAny<CallOptions>()))
372372
.Throws(rpcException);
373373

374374
var ex = await Assert.ThrowsAsync<DaprException>(async () =>
@@ -395,9 +395,10 @@ public async Task GetMetadataAsync_WithReturnTypeAndData()
395395
// Create Response & Respond
396396
var response = new Autogen.Grpc.v1.GetMetadataResponse()
397397
{
398+
ActorRuntime = new(),
398399
Id = "testId",
399400
};
400-
response.ActiveActorsCount.Add(new ActiveActorsCount { Type = "testType", Count = 1 });
401+
response.ActorRuntime.ActiveActors.Add(new ActiveActorsCount { Type = "testType", Count = 1 });
401402
response.RegisteredComponents.Add(new RegisteredComponents { Name = "testName", Type = "testType", Version = "V1" });
402403
response.ExtendedMetadata.Add("e1", "v1");
403404

0 commit comments

Comments
 (0)