Skip to content

Commit aa8b0fd

Browse files
authored
Extracted Protos out to common project (#1367)
Protos pulled out to separate shared project
1 parent 2365677 commit aa8b0fd

File tree

11 files changed

+89
-47
lines changed

11 files changed

+89
-47
lines changed

all.sln

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dapr.E2E.Test.Actors.Genera
118118
EndProject
119119
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cryptography", "examples\Client\Cryptography\Cryptography.csproj", "{C74FBA78-13E8-407F-A173-4555AEE41FF3}"
120120
EndProject
121+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dapr.Protos", "src\Dapr.Protos\Dapr.Protos.csproj", "{DFBABB04-50E9-42F6-B470-310E1B545638}"
122+
EndProject
121123
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dapr.Common", "src\Dapr.Common\Dapr.Common.csproj", "{B445B19C-A925-4873-8CB7-8317898B6970}"
122124
EndProject
123125
Global
@@ -292,6 +294,10 @@ Global
292294
{C74FBA78-13E8-407F-A173-4555AEE41FF3}.Debug|Any CPU.Build.0 = Debug|Any CPU
293295
{C74FBA78-13E8-407F-A173-4555AEE41FF3}.Release|Any CPU.ActiveCfg = Release|Any CPU
294296
{C74FBA78-13E8-407F-A173-4555AEE41FF3}.Release|Any CPU.Build.0 = Release|Any CPU
297+
{DFBABB04-50E9-42F6-B470-310E1B545638}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
298+
{DFBABB04-50E9-42F6-B470-310E1B545638}.Debug|Any CPU.Build.0 = Debug|Any CPU
299+
{DFBABB04-50E9-42F6-B470-310E1B545638}.Release|Any CPU.ActiveCfg = Release|Any CPU
300+
{DFBABB04-50E9-42F6-B470-310E1B545638}.Release|Any CPU.Build.0 = Release|Any CPU
295301
{B445B19C-A925-4873-8CB7-8317898B6970}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
296302
{B445B19C-A925-4873-8CB7-8317898B6970}.Debug|Any CPU.Build.0 = Debug|Any CPU
297303
{B445B19C-A925-4873-8CB7-8317898B6970}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -349,6 +355,7 @@ Global
349355
{AF89083D-4715-42E6-93E9-38497D12A8A6} = {DD020B34-460F-455F-8D17-CF4A949F100B}
350356
{B5CDB0DC-B26D-48F1-B934-FE5C1C991940} = {DD020B34-460F-455F-8D17-CF4A949F100B}
351357
{C74FBA78-13E8-407F-A173-4555AEE41FF3} = {A7F41094-8648-446B-AECD-DCC2CC871F73}
358+
{DFBABB04-50E9-42F6-B470-310E1B545638} = {27C5D71D-0721-4221-9286-B94AB07B58CF}
352359
{B445B19C-A925-4873-8CB7-8317898B6970} = {27C5D71D-0721-4221-9286-B94AB07B58CF}
353360
EndGlobalSection
354361
GlobalSection(ExtensibilityGlobals) = postSolution

examples/AspNetCore/GrpcServiceSample/GrpcServiceSample.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
<ItemGroup>
2121
<ProjectReference Include="..\..\..\src\Dapr.AspNetCore\Dapr.AspNetCore.csproj" />
22+
<ProjectReference Include="..\..\..\src\Dapr.Protos\Dapr.Protos.csproj" />
2223
</ItemGroup>
2324

2425
</Project>

src/Dapr.Client/Dapr.Client.csproj

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,20 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<ItemGroup>
4-
<Protobuf Include="Protos\dapr\proto\common\v1\common.proto" ProtoRoot="Protos" GrpcServices="Client,Server" />
5-
<Protobuf Include="Protos\dapr\proto\dapr\v1\dapr.proto" ProtoRoot="Protos" GrpcServices="Client" />
6-
<Protobuf Include="Protos\dapr\proto\dapr\v1\appcallback.proto" ProtoRoot="Protos" GrpcServices="Server" />
7-
</ItemGroup>
8-
93
<!-- Additional Nuget package properties. -->
104
<PropertyGroup>
115
<Description>This package contains the reference assemblies for developing services using Dapr.</Description>
126
</PropertyGroup>
7+
138
<ItemGroup>
149
<PackageReference Include="Google.Protobuf" />
1510
<PackageReference Include="Grpc.Net.Client" />
1611
<PackageReference Include="Grpc.Tools" PrivateAssets="All" />
1712
<PackageReference Include="Google.Api.CommonProtos" />
1813
</ItemGroup>
19-
20-
<ItemGroup>
21-
<Folder Include="Protos\" />
22-
</ItemGroup>
23-
14+
2415
<ItemGroup>
16+
<ProjectReference Include="..\Dapr.Protos\Dapr.Protos.csproj" />
2517
<ProjectReference Include="..\Dapr.Common\Dapr.Common.csproj" />
2618
</ItemGroup>
27-
19+
2820
</Project>

src/Dapr.Protos/Dapr.Protos.csproj

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<ImplicitUsings>enable</ImplicitUsings>
5+
<Nullable>enable</Nullable>
6+
<Description>This package contains the reference protos used by develop services using Dapr.</Description>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<Protobuf Include="Protos\dapr\proto\common\v1\common.proto" ProtoRoot="Protos" GrpcServices="Client,Server" />
11+
<Protobuf Include="Protos\dapr\proto\runtime\v1\dapr.proto" ProtoRoot="Protos" GrpcServices="Client" />
12+
<Protobuf Include="Protos\dapr\proto\runtime\v1\appcallback.proto" ProtoRoot="Protos" GrpcServices="Server" />
13+
</ItemGroup>
14+
15+
<ItemGroup>
16+
<PackageReference Include="Google.Protobuf" />
17+
<PackageReference Include="Grpc.Net.Client" />
18+
<PackageReference Include="Grpc.Tools" PrivateAssets="All" />
19+
<PackageReference Include="Google.Api.CommonProtos" />
20+
</ItemGroup>
21+
22+
</Project>

src/Dapr.Client/Protos/dapr/proto/common/v1/common.proto renamed to src/Dapr.Protos/Protos/dapr/proto/common/v1/common.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/*
22
Copyright 2021 The Dapr Authors
33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.
@@ -26,7 +26,7 @@ option go_package = "github.com/dapr/dapr/pkg/proto/common/v1;common";
2626
// when Dapr runtime delivers HTTP content.
2727
//
2828
// For example, when callers calls http invoke api
29-
// POST http://localhost:3500/v1.0/invoke/<app_id>/method/<method>?query1=value1&query2=value2
29+
// `POST http://localhost:3500/v1.0/invoke/<app_id>/method/<method>?query1=value1&query2=value2`
3030
//
3131
// Dapr runtime will parse POST as a verb and extract querystring to quersytring map.
3232
message HTTPExtension {

src/Dapr.Client/Protos/dapr/proto/dapr/v1/appcallback.proto renamed to src/Dapr.Protos/Protos/dapr/proto/runtime/v1/appcallback.proto

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/*
22
Copyright 2021 The Dapr Authors
33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.
@@ -58,7 +58,7 @@ service AppCallbackHealthCheck {
5858
// AppCallbackAlpha V1 is an optional extension to AppCallback V1 to opt
5959
// for Alpha RPCs.
6060
service AppCallbackAlpha {
61-
// Subscribes bulk events from Pubsub
61+
// Subscribes bulk events from Pubsub
6262
rpc OnBulkTopicEventAlpha1(TopicEventBulkRequest) returns (TopicEventBulkResponse) {}
6363

6464
// Sends job back to the app's endpoint at trigger time.
@@ -185,14 +185,14 @@ message TopicEventBulkRequestEntry {
185185

186186
// content type of the event contained.
187187
string content_type = 4;
188-
188+
189189
// The metadata associated with the event.
190190
map<string,string> metadata = 5;
191191
}
192192

193193
// TopicEventBulkRequest represents request for bulk message
194194
message TopicEventBulkRequest {
195-
// Unique identifier for the bulk request.
195+
// Unique identifier for the bulk request.
196196
string id = 1;
197197

198198
// The list of items inside this bulk request.
@@ -203,10 +203,10 @@ message TopicEventBulkRequest {
203203

204204
// The pubsub topic which publisher sent to.
205205
string topic = 4;
206-
206+
207207
// The name of the pubsub the publisher sent to.
208208
string pubsub_name = 5;
209-
209+
210210
// The type of event related to the originating occurrence.
211211
string type = 6;
212212

@@ -310,8 +310,8 @@ message TopicRoutes {
310310

311311
message TopicRule {
312312
// The optional CEL expression used to match the event.
313-
// If the match is not specified, then the route is considered
314-
// the default.
313+
// If the match is not specified, then the route is considered
314+
// the default.
315315
string match = 1;
316316

317317
// The path used to identify matches for this subscription.

src/Dapr.Client/Protos/dapr/proto/dapr/v1/dapr.proto renamed to src/Dapr.Protos/Protos/dapr/proto/runtime/v1/dapr.proto

Lines changed: 41 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/*
22
Copyright 2021 The Dapr Authors
33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@ import "google/protobuf/any.proto";
1919
import "google/protobuf/empty.proto";
2020
import "google/protobuf/timestamp.proto";
2121
import "dapr/proto/common/v1/common.proto";
22-
import "dapr/proto/dapr/v1/appcallback.proto";
22+
import "dapr/proto/runtime/v1/appcallback.proto";
2323

2424
option csharp_namespace = "Dapr.Client.Autogen.Grpc.v1";
2525
option java_outer_classname = "DaprProtos";
@@ -61,7 +61,7 @@ service Dapr {
6161

6262
// SubscribeTopicEventsAlpha1 subscribes to a PubSub topic and receives topic
6363
// events from it.
64-
rpc SubscribeTopicEventsAlpha1(stream SubscribeTopicEventsRequestAlpha1) returns (stream TopicEventRequest) {}
64+
rpc SubscribeTopicEventsAlpha1(stream SubscribeTopicEventsRequestAlpha1) returns (stream SubscribeTopicEventsResponseAlpha1) {}
6565

6666
// Invokes binding data to specific output bindings
6767
rpc InvokeBinding(InvokeBindingRequest) returns (InvokeBindingResponse) {}
@@ -428,17 +428,17 @@ message BulkPublishResponseFailedEntry {
428428
// SubscribeTopicEventsRequestAlpha1 is a message containing the details for
429429
// subscribing to a topic via streaming.
430430
// The first message must always be the initial request. All subsequent
431-
// messages must be event responses.
431+
// messages must be event processed responses.
432432
message SubscribeTopicEventsRequestAlpha1 {
433433
oneof subscribe_topic_events_request_type {
434-
SubscribeTopicEventsInitialRequestAlpha1 initial_request = 1;
435-
SubscribeTopicEventsResponseAlpha1 event_response = 2;
434+
SubscribeTopicEventsRequestInitialAlpha1 initial_request = 1;
435+
SubscribeTopicEventsRequestProcessedAlpha1 event_processed = 2;
436436
}
437437
}
438438

439-
// SubscribeTopicEventsInitialRequestAlpha1 is the initial message containing the
440-
// details for subscribing to a topic via streaming.
441-
message SubscribeTopicEventsInitialRequestAlpha1 {
439+
// SubscribeTopicEventsRequestInitialAlpha1 is the initial message containing
440+
// the details for subscribing to a topic via streaming.
441+
message SubscribeTopicEventsRequestInitialAlpha1 {
442442
// The name of the pubsub component
443443
string pubsub_name = 1;
444444

@@ -456,16 +456,31 @@ message SubscribeTopicEventsInitialRequestAlpha1 {
456456
optional string dead_letter_topic = 4;
457457
}
458458

459-
// SubscribeTopicEventsResponseAlpha1 is a message containing the result of a
459+
// SubscribeTopicEventsRequestProcessedAlpha1 is the message containing the
460460
// subscription to a topic.
461-
message SubscribeTopicEventsResponseAlpha1 {
461+
message SubscribeTopicEventsRequestProcessedAlpha1 {
462462
// id is the unique identifier for the subscription request.
463463
string id = 1;
464464

465465
// status is the result of the subscription request.
466466
TopicEventResponse status = 2;
467467
}
468468

469+
470+
// SubscribeTopicEventsResponseAlpha1 is a message returned from daprd
471+
// when subscribing to a topic via streaming.
472+
message SubscribeTopicEventsResponseAlpha1 {
473+
oneof subscribe_topic_events_response_type {
474+
SubscribeTopicEventsResponseInitialAlpha1 initial_response = 1;
475+
TopicEventRequest event_message = 2;
476+
}
477+
}
478+
479+
// SubscribeTopicEventsResponseInitialAlpha1 is the initial response from daprd
480+
// when subscribing to a topic.
481+
message SubscribeTopicEventsResponseInitialAlpha1 {}
482+
483+
469484
// InvokeBindingRequest is the message to send data to output bindings
470485
message InvokeBindingRequest {
471486
// The name of the output binding to invoke.
@@ -478,6 +493,7 @@ message InvokeBindingRequest {
478493
//
479494
// Common metadata property:
480495
// - ttlInSeconds : the time to live in seconds for the message.
496+
//
481497
// If set in the binding definition will cause all messages to
482498
// have a default time to live. The message ttl overrides any value
483499
// in the binding definition.
@@ -824,11 +840,11 @@ message TryLockRequest {
824840
//
825841
// The reason why we don't make it automatically generated is:
826842
// 1. If it is automatically generated,there must be a 'my_lock_owner_id' field in the response.
827-
// This name is so weird that we think it is inappropriate to put it into the api spec
843+
// This name is so weird that we think it is inappropriate to put it into the api spec
828844
// 2. If we change the field 'my_lock_owner_id' in the response to 'lock_owner',which means the current lock owner of this lock,
829-
// we find that in some lock services users can't get the current lock owner.Actually users don't need it at all.
845+
// we find that in some lock services users can't get the current lock owner.Actually users don't need it at all.
830846
// 3. When reentrant lock is needed,the existing lock_owner is required to identify client and check "whether this client can reenter this lock".
831-
// So this field in the request shouldn't be removed.
847+
// So this field in the request shouldn't be removed.
832848
string lock_owner = 3 [json_name = "lockOwner"];
833849

834850
// Required. The time before expiry.The time unit is second.
@@ -865,7 +881,7 @@ message SubtleGetKeyRequest {
865881
// JSON (JSON Web Key) as string
866882
JSON = 1;
867883
}
868-
884+
869885
// Name of the component
870886
string component_name = 1 [json_name="componentName"];
871887
// Name (or name/version) of the key to use in the key vault
@@ -1047,7 +1063,7 @@ message EncryptRequestOptions {
10471063
// If true, the encrypted document does not contain a key reference.
10481064
// In that case, calls to the Decrypt method must provide a key reference (name or name/version).
10491065
// Defaults to false.
1050-
bool omit_decryption_key_name = 11 [json_name="omitDecryptionKeyName"];
1066+
bool omit_decryption_key_name = 11 [json_name="omitDecryptionKeyName"];
10511067
// Key reference to embed in the encrypted document (name or name/version).
10521068
// This is helpful if the reference of the key used to decrypt the document is different from the one used to encrypt it.
10531069
// If unset, uses the reference of the key used to encrypt the document (this is the default behavior).
@@ -1196,14 +1212,14 @@ message Job {
11961212
// "0 15 3 * * *" - every day at 03:15
11971213
//
11981214
// Period string expressions:
1199-
// Entry | Description | Equivalent To
1200-
// ----- | ----------- | -------------
1201-
// @every <duration> | Run every <duration> (e.g. '@every 1h30m') | N/A
1202-
// @yearly (or @annually) | Run once a year, midnight, Jan. 1st | 0 0 0 1 1 *
1203-
// @monthly | Run once a month, midnight, first of month | 0 0 0 1 * *
1204-
// @weekly | Run once a week, midnight on Sunday | 0 0 0 * * 0
1205-
// @daily (or @midnight) | Run once a day, midnight | 0 0 0 * * *
1206-
// @hourly | Run once an hour, beginning of hour | 0 0 * * * *
1215+
// Entry | Description | Equivalent To
1216+
// ----- | ----------- | -------------
1217+
// @every `<duration>` | Run every `<duration>` (e.g. '@every 1h30m') | N/A
1218+
// @yearly (or @annually) | Run once a year, midnight, Jan. 1st | 0 0 0 1 1 *
1219+
// @monthly | Run once a month, midnight, first of month | 0 0 0 1 * *
1220+
// @weekly | Run once a week, midnight on Sunday | 0 0 0 * * 0
1221+
// @daily (or @midnight) | Run once a day, midnight | 0 0 0 * * *
1222+
// @hourly | Run once an hour, beginning of hour | 0 0 * * * *
12071223
optional string schedule = 2 [json_name = "schedule"];
12081224

12091225
// repeats is the optional number of times in which the job should be
@@ -1258,4 +1274,4 @@ message DeleteJobRequest {
12581274
// DeleteJobResponse is the message response to delete the job by name.
12591275
message DeleteJobResponse {
12601276
// Empty
1261-
}
1277+
}

test/Dapr.AspNetCore.IntegrationTest/Dapr.AspNetCore.IntegrationTest.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
<ItemGroup>
1919
<ProjectReference Include="..\..\src\Dapr.AspNetCore\Dapr.AspNetCore.csproj" />
20+
<ProjectReference Include="..\..\src\Dapr.Protos\Dapr.Protos.csproj" />
2021
<ProjectReference Include="..\..\src\Dapr.Common\Dapr.Common.csproj" />
2122
<ProjectReference Include="..\Dapr.AspNetCore.IntegrationTest.App\Dapr.AspNetCore.IntegrationTest.App.csproj" />
2223
</ItemGroup>

test/Dapr.AspNetCore.Test/Dapr.AspNetCore.Test.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
<ItemGroup>
2323
<ProjectReference Include="..\..\src\Dapr.AspNetCore\Dapr.AspNetCore.csproj" />
24+
<ProjectReference Include="..\..\src\Dapr.Protos\Dapr.Protos.csproj" />
2425
</ItemGroup>
2526

2627
</Project>

test/Dapr.Client.Test/Dapr.Client.Test.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
<ItemGroup>
3535
<ProjectReference Include="..\..\src\Dapr.Client\Dapr.Client.csproj" />
36+
<ProjectReference Include="..\..\src\Dapr.Protos\Dapr.Protos.csproj" />
3637
<ProjectReference Include="..\..\src\Dapr.Common\Dapr.Common.csproj" />
3738
</ItemGroup>
3839

0 commit comments

Comments
 (0)