Skip to content

Commit 293b0eb

Browse files
authored
chore(release) Update workflows and protos to use v1.10.0 Dapr (#455)
Update proto and e2e workflow Signed-off-by: Shubham Sharma <[email protected]>
1 parent 495d343 commit 293b0eb

21 files changed

+8862
-2360
lines changed

.github/workflows/test-e2e.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ jobs:
3535
runs-on: ubuntu-latest
3636
env:
3737
GOVER: 1.19
38-
DAPR_CLI_VER: 1.9.1
39-
DAPR_RUNTIME_VER: 1.9.5
38+
DAPR_CLI_VER: 1.10.0
39+
DAPR_RUNTIME_VER: 1.10.0
4040
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/master/install/install.sh
4141
DAPR_CLI_REF: ""
4242
DAPR_REF: ""

scripts/fetch-proto.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ OS=$(echo `uname`|tr '[:upper:]' '[:lower:]')
33
ARCH=$(uname -m)
44
ORG_NAME="dapr"
55
REPO_NAME="dapr"
6-
BRANCH_NAME="v1.9.0"
6+
BRANCH_NAME="v1.10.0"
77

88
# Path to store output
99
PATH_ROOT=$(pwd)

src/proto/dapr/proto/common/v1/common.proto

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ message InvokeRequest {
6060
// Required. method is a method name which will be invoked by caller.
6161
string method = 1;
6262

63-
// Required. Bytes value or Protobuf message which caller sent.
63+
// Required in unary RPCs. Bytes value or Protobuf message which caller sent.
6464
// Dapr treats Any.value as bytes type if Any.type_url is unset.
6565
google.protobuf.Any data = 2;
6666

@@ -82,13 +82,26 @@ message InvokeRequest {
8282
// This message is used in InvokeService of Dapr gRPC Service and OnInvoke
8383
// of AppCallback gRPC service.
8484
message InvokeResponse {
85-
// Required. The content body of InvokeService response.
85+
// Required in unary RPCs. The content body of InvokeService response.
8686
google.protobuf.Any data = 1;
8787

8888
// Required. The type of data content.
8989
string content_type = 2;
9090
}
9191

92+
// Chunk of data sent in a streaming request or response.
93+
// This is used in requests including InternalInvokeRequestStream.
94+
message StreamPayload {
95+
// Data sent in the chunk.
96+
// The amount of data included in each chunk is up to the discretion of the sender, and can be empty.
97+
// Additionally, the amount of data doesn't need to be fixed and subsequent messages can send more, or less, data.
98+
// Receivers must not make assumptions about the number of bytes they'll receive in each chunk.
99+
bytes data = 1;
100+
101+
// Sequence number. This is a counter that starts from 0 and increments by 1 on each chunk sent.
102+
uint32 seq = 2;
103+
}
104+
92105
// StateItem represents state key, value, and additional options to save state.
93106
message StateItem {
94107
// Required. The state key

src/proto/dapr/proto/common/v1/common_pb.d.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,31 @@ export namespace InvokeResponse {
105105
}
106106
}
107107

108+
export class StreamPayload extends jspb.Message {
109+
getData(): Uint8Array | string;
110+
getData_asU8(): Uint8Array;
111+
getData_asB64(): string;
112+
setData(value: Uint8Array | string): StreamPayload;
113+
getSeq(): number;
114+
setSeq(value: number): StreamPayload;
115+
116+
serializeBinary(): Uint8Array;
117+
toObject(includeInstance?: boolean): StreamPayload.AsObject;
118+
static toObject(includeInstance: boolean, msg: StreamPayload): StreamPayload.AsObject;
119+
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
120+
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
121+
static serializeBinaryToWriter(message: StreamPayload, writer: jspb.BinaryWriter): void;
122+
static deserializeBinary(bytes: Uint8Array): StreamPayload;
123+
static deserializeBinaryFromReader(message: StreamPayload, reader: jspb.BinaryReader): StreamPayload;
124+
}
125+
126+
export namespace StreamPayload {
127+
export type AsObject = {
128+
data: Uint8Array | string,
129+
seq: number,
130+
}
131+
}
132+
108133
export class StateItem extends jspb.Message {
109134
getKey(): string;
110135
setKey(value: string): StateItem;

src/proto/dapr/proto/common/v1/common_pb.js

Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ goog.exportSymbol('proto.dapr.proto.common.v1.StateItem', null, global);
2727
goog.exportSymbol('proto.dapr.proto.common.v1.StateOptions', null, global);
2828
goog.exportSymbol('proto.dapr.proto.common.v1.StateOptions.StateConcurrency', null, global);
2929
goog.exportSymbol('proto.dapr.proto.common.v1.StateOptions.StateConsistency', null, global);
30+
goog.exportSymbol('proto.dapr.proto.common.v1.StreamPayload', null, global);
3031
/**
3132
* Generated by JsPbCodeGenerator.
3233
* @param {Array=} opt_data Optional initial data array, typically from a
@@ -90,6 +91,27 @@ if (goog.DEBUG && !COMPILED) {
9091
*/
9192
proto.dapr.proto.common.v1.InvokeResponse.displayName = 'proto.dapr.proto.common.v1.InvokeResponse';
9293
}
94+
/**
95+
* Generated by JsPbCodeGenerator.
96+
* @param {Array=} opt_data Optional initial data array, typically from a
97+
* server response, or constructed directly in Javascript. The array is used
98+
* in place and becomes part of the constructed object. It is not cloned.
99+
* If no data is provided, the constructed object will be empty, but still
100+
* valid.
101+
* @extends {jspb.Message}
102+
* @constructor
103+
*/
104+
proto.dapr.proto.common.v1.StreamPayload = function(opt_data) {
105+
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
106+
};
107+
goog.inherits(proto.dapr.proto.common.v1.StreamPayload, jspb.Message);
108+
if (goog.DEBUG && !COMPILED) {
109+
/**
110+
* @public
111+
* @override
112+
*/
113+
proto.dapr.proto.common.v1.StreamPayload.displayName = 'proto.dapr.proto.common.v1.StreamPayload';
114+
}
93115
/**
94116
* Generated by JsPbCodeGenerator.
95117
* @param {Array=} opt_data Optional initial data array, typically from a
@@ -796,6 +818,190 @@ proto.dapr.proto.common.v1.InvokeResponse.prototype.setContentType = function(va
796818

797819

798820

821+
if (jspb.Message.GENERATE_TO_OBJECT) {
822+
/**
823+
* Creates an object representation of this proto.
824+
* Field names that are reserved in JavaScript and will be renamed to pb_name.
825+
* Optional fields that are not set will be set to undefined.
826+
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
827+
* For the list of reserved names please see:
828+
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
829+
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
830+
* JSPB instance for transitional soy proto support:
831+
* http://goto/soy-param-migration
832+
* @return {!Object}
833+
*/
834+
proto.dapr.proto.common.v1.StreamPayload.prototype.toObject = function(opt_includeInstance) {
835+
return proto.dapr.proto.common.v1.StreamPayload.toObject(opt_includeInstance, this);
836+
};
837+
838+
839+
/**
840+
* Static version of the {@see toObject} method.
841+
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
842+
* the JSPB instance for transitional soy proto support:
843+
* http://goto/soy-param-migration
844+
* @param {!proto.dapr.proto.common.v1.StreamPayload} msg The msg instance to transform.
845+
* @return {!Object}
846+
* @suppress {unusedLocalVariables} f is only used for nested messages
847+
*/
848+
proto.dapr.proto.common.v1.StreamPayload.toObject = function(includeInstance, msg) {
849+
var f, obj = {
850+
data: msg.getData_asB64(),
851+
seq: jspb.Message.getFieldWithDefault(msg, 2, 0)
852+
};
853+
854+
if (includeInstance) {
855+
obj.$jspbMessageInstance = msg;
856+
}
857+
return obj;
858+
};
859+
}
860+
861+
862+
/**
863+
* Deserializes binary data (in protobuf wire format).
864+
* @param {jspb.ByteSource} bytes The bytes to deserialize.
865+
* @return {!proto.dapr.proto.common.v1.StreamPayload}
866+
*/
867+
proto.dapr.proto.common.v1.StreamPayload.deserializeBinary = function(bytes) {
868+
var reader = new jspb.BinaryReader(bytes);
869+
var msg = new proto.dapr.proto.common.v1.StreamPayload;
870+
return proto.dapr.proto.common.v1.StreamPayload.deserializeBinaryFromReader(msg, reader);
871+
};
872+
873+
874+
/**
875+
* Deserializes binary data (in protobuf wire format) from the
876+
* given reader into the given message object.
877+
* @param {!proto.dapr.proto.common.v1.StreamPayload} msg The message object to deserialize into.
878+
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
879+
* @return {!proto.dapr.proto.common.v1.StreamPayload}
880+
*/
881+
proto.dapr.proto.common.v1.StreamPayload.deserializeBinaryFromReader = function(msg, reader) {
882+
while (reader.nextField()) {
883+
if (reader.isEndGroup()) {
884+
break;
885+
}
886+
var field = reader.getFieldNumber();
887+
switch (field) {
888+
case 1:
889+
var value = /** @type {!Uint8Array} */ (reader.readBytes());
890+
msg.setData(value);
891+
break;
892+
case 2:
893+
var value = /** @type {number} */ (reader.readUint32());
894+
msg.setSeq(value);
895+
break;
896+
default:
897+
reader.skipField();
898+
break;
899+
}
900+
}
901+
return msg;
902+
};
903+
904+
905+
/**
906+
* Serializes the message to binary data (in protobuf wire format).
907+
* @return {!Uint8Array}
908+
*/
909+
proto.dapr.proto.common.v1.StreamPayload.prototype.serializeBinary = function() {
910+
var writer = new jspb.BinaryWriter();
911+
proto.dapr.proto.common.v1.StreamPayload.serializeBinaryToWriter(this, writer);
912+
return writer.getResultBuffer();
913+
};
914+
915+
916+
/**
917+
* Serializes the given message to binary data (in protobuf wire
918+
* format), writing to the given BinaryWriter.
919+
* @param {!proto.dapr.proto.common.v1.StreamPayload} message
920+
* @param {!jspb.BinaryWriter} writer
921+
* @suppress {unusedLocalVariables} f is only used for nested messages
922+
*/
923+
proto.dapr.proto.common.v1.StreamPayload.serializeBinaryToWriter = function(message, writer) {
924+
var f = undefined;
925+
f = message.getData_asU8();
926+
if (f.length > 0) {
927+
writer.writeBytes(
928+
1,
929+
f
930+
);
931+
}
932+
f = message.getSeq();
933+
if (f !== 0) {
934+
writer.writeUint32(
935+
2,
936+
f
937+
);
938+
}
939+
};
940+
941+
942+
/**
943+
* optional bytes data = 1;
944+
* @return {!(string|Uint8Array)}
945+
*/
946+
proto.dapr.proto.common.v1.StreamPayload.prototype.getData = function() {
947+
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
948+
};
949+
950+
951+
/**
952+
* optional bytes data = 1;
953+
* This is a type-conversion wrapper around `getData()`
954+
* @return {string}
955+
*/
956+
proto.dapr.proto.common.v1.StreamPayload.prototype.getData_asB64 = function() {
957+
return /** @type {string} */ (jspb.Message.bytesAsB64(
958+
this.getData()));
959+
};
960+
961+
962+
/**
963+
* optional bytes data = 1;
964+
* Note that Uint8Array is not supported on all browsers.
965+
* @see http://caniuse.com/Uint8Array
966+
* This is a type-conversion wrapper around `getData()`
967+
* @return {!Uint8Array}
968+
*/
969+
proto.dapr.proto.common.v1.StreamPayload.prototype.getData_asU8 = function() {
970+
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
971+
this.getData()));
972+
};
973+
974+
975+
/**
976+
* @param {!(string|Uint8Array)} value
977+
* @return {!proto.dapr.proto.common.v1.StreamPayload} returns this
978+
*/
979+
proto.dapr.proto.common.v1.StreamPayload.prototype.setData = function(value) {
980+
return jspb.Message.setProto3BytesField(this, 1, value);
981+
};
982+
983+
984+
/**
985+
* optional uint32 seq = 2;
986+
* @return {number}
987+
*/
988+
proto.dapr.proto.common.v1.StreamPayload.prototype.getSeq = function() {
989+
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
990+
};
991+
992+
993+
/**
994+
* @param {number} value
995+
* @return {!proto.dapr.proto.common.v1.StreamPayload} returns this
996+
*/
997+
proto.dapr.proto.common.v1.StreamPayload.prototype.setSeq = function(value) {
998+
return jspb.Message.setProto3IntField(this, 2, value);
999+
};
1000+
1001+
1002+
1003+
1004+
7991005
if (jspb.Message.GENERATE_TO_OBJECT) {
8001006
/**
8011007
* Creates an object representation of this proto.

src/proto/dapr/proto/internals/v1/service_invocation.proto

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,17 @@ service ServiceInvocation {
3737

3838
// Invokes a method of the specific service.
3939
rpc CallLocal (InternalInvokeRequest) returns (InternalInvokeResponse) {}
40+
41+
// Invokes a method of the specific service using a stream of data.
42+
// Although this uses a bi-directional stream, it behaves as a "simple RPC" in which the caller sends the full request (chunked in multiple messages in the stream), then reads the full response (chunked in the stream).
43+
// Each message in the stream contains a `InternalInvokeRequestStream` (for caller) or `InternalInvokeResponseStream` (for callee):
44+
// - The first message in the stream MUST contain a `request` (caller) or `response` (callee) message with all required properties present.
45+
// - The first message in the stream MAY contain a `payload`, which is not required and may be empty.
46+
// - Subsequent messages (any message except the first one in the stream) MUST contain a `payload` and MUST NOT contain any other property (like `request` or `response`).
47+
// - Each message with a `payload` MUST contain a sequence number in `seq`, which is a counter that starts from 0 and MUST be incremented by 1 in each chunk. The `seq` counter MUST NOT be included if the message does not have a `payload`.
48+
// - When the sender has completed sending the data, it MUST call `CloseSend` on the stream.
49+
// The caller and callee must send at least one message in the stream. If only 1 message is sent in each direction, that message must contain both a `request`/`response` (the `payload` may be empty).
50+
rpc CallLocalStream (stream InternalInvokeRequestStream) returns (stream InternalInvokeResponseStream) {}
4051
}
4152

4253
// Actor represents actor using actor_type and actor_id
@@ -82,6 +93,26 @@ message InternalInvokeResponse {
8293
common.v1.InvokeResponse message = 4;
8394
}
8495

96+
// InternalInvokeRequestStream is a variant of InternalInvokeRequest used in streaming RPCs.
97+
message InternalInvokeRequestStream {
98+
// Request details.
99+
// This does not contain any data in message.data.
100+
InternalInvokeRequest request = 1;
101+
102+
// Chunk of data.
103+
common.v1.StreamPayload payload = 2;
104+
}
105+
106+
// InternalInvokeResponseStream is a variant of InternalInvokeResponse used in streaming RPCs.
107+
message InternalInvokeResponseStream {
108+
// Response details.
109+
// This does not contain any data in message.data.
110+
InternalInvokeResponse response = 1;
111+
112+
// Chunk of data.
113+
common.v1.StreamPayload payload = 2;
114+
}
115+
85116
// ListStringValue represents string value array
86117
message ListStringValue {
87118
// The array of string.

0 commit comments

Comments
 (0)