Skip to content

Commit fcc8b45

Browse files
yojagadpragnagopa
authored andcommitted
Updated subtree from https://github.com/azure/azure-functions-language-worker-protobuf. Tag: v1.3.5-protofile. Commit: a12f76345e2286ed3772ab4a9d8527af11899af2 (Azure#246)
1 parent 3b51b6f commit fcc8b45

File tree

4 files changed

+75
-9
lines changed

4 files changed

+75
-9
lines changed

azure-functions-language-worker-protobuf/README.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Azure Functions Languge Worker Protobuf
22

3-
This repository contains the protobuf definition file which defines the gRPC service which is used between the Azure WebJobs Script host and the Azure Functions language workers. This repo is shared across many repos in many languages (for each worker) by using git commands.
3+
This repository contains the protobuf definition file which defines the gRPC service which is used between the [Azure Functions Host](https://github.com/Azure/azure-functions-host) and the Azure Functions language workers. This repo is shared across many repos in many languages (for each worker) by using git commands.
44

55
To use this repo in Azure Functions language workers, follow steps below to add this repo as a subtree (*Adding This Repo*). If this repo is already embedded in a language worker repo, follow the steps to update the consumed file (*Pulling Updates*).
66

@@ -26,13 +26,24 @@ From within the Azure Functions language worker repo:
2626
1. Define remote branch for cleaner git commands
2727
- `git remote add proto-file https://github.com/azure/azure-functions-language-worker-protobuf.git`
2828
- `git fetch proto-file`
29-
2. Merge updates
30-
- `git merge -s subtree proto-file/<version branch> --squash --allow-unrelated-histories`
31-
- You can also merge with an explicit path to subtree: `git merge -X subtree=<path in language worker repo> --squash proto-file/<version branch> --allow-unrelated-histories`
32-
3. Finalize with commit
33-
- `git commit -m "Updated subtree from https://github.com/azure/azure-functions-language-worker-protobuf. Branch: <version branch>. Commit: <latest protobuf commit hash>"`
29+
2. Pull a specific release tag
30+
- `git fetch proto-file refs/tags/<tag-name>`
31+
- Example: `git fetch proto-file refs/tags/v1.1.0-protofile`
32+
3. Merge updates
33+
- Merge with an explicit path to subtree: `git merge -X subtree=<path in language worker repo> --squash <tag-name> --allow-unrelated-histories --strategy-option theirs`
34+
- Example: `git merge -X subtree=src/WebJobs.Script.Grpc/azure-functions-language-worker-protobuf --squash v1.1.0-protofile --allow-unrelated-histories --strategy-option theirs`
35+
4. Finalize with commit
36+
- `git commit -m "Updated subtree from https://github.com/azure/azure-functions-language-worker-protobuf. Tag: <tag-name>. Commit: <commit hash>"`
3437
- `git push`
35-
38+
39+
## Releasing a Language Worker Protobuf version
40+
41+
1. Draft a release in the GitHub UI
42+
- Be sure to inculde details of the release
43+
2. Create a release version, following semantic versioning guidelines ([semver.org](https://semver.org/))
44+
3. Tag the version with the pattern: `v<M>.<m>.<p>-protofile` (example: `v1.1.0-protofile`)
45+
3. Merge `dev` to `master`
46+
3647
## Consuming FunctionRPC.proto
3748
*Note: Update versionNumber before running following commands*
3849

azure-functions-language-worker-protobuf/src/proto/FunctionRpc.proto

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,9 @@ message RpcFunctionMetadata {
237237

238238
// Bindings info
239239
map<string, BindingInfo> bindings = 6;
240+
241+
// Is set to true for proxy
242+
bool is_proxy = 7;
240243
}
241244

242245
// Host requests worker to invoke a Function
@@ -252,6 +255,21 @@ message InvocationRequest {
252255

253256
// binding metadata from trigger
254257
map<string, TypedData> trigger_metadata = 4;
258+
259+
// Populates activityId, tracestate and tags from host
260+
RpcTraceContext trace_context = 5;
261+
}
262+
263+
// Host sends ActivityId, traceStateString and Tags from host
264+
message RpcTraceContext {
265+
// This corresponds to Activity.Current?.Id
266+
string trace_parent = 1;
267+
268+
// This corresponds to Activity.Current?.TraceStateString
269+
string trace_state = 2;
270+
271+
// This corresponds to Activity.Current?.Tags
272+
map<string, string> attributes = 3;
255273
}
256274

257275
// Host requests worker to cancel invocation
@@ -286,11 +304,35 @@ message TypedData {
286304
bytes bytes = 3;
287305
bytes stream = 4;
288306
RpcHttp http = 5;
289-
sint64 int = 6;
307+
sint64 int = 6;
290308
double double = 7;
309+
CollectionBytes collection_bytes = 8;
310+
CollectionString collection_string = 9;
311+
CollectionDouble collection_double = 10;
312+
CollectionSInt64 collection_sint64 = 11;
291313
}
292314
}
293315

316+
// Used to encapsulate collection string
317+
message CollectionString {
318+
repeated string string = 1;
319+
}
320+
321+
// Used to encapsulate collection bytes
322+
message CollectionBytes {
323+
repeated bytes bytes = 1;
324+
}
325+
326+
// Used to encapsulate collection double
327+
message CollectionDouble {
328+
repeated double double = 1;
329+
}
330+
331+
// Used to encapsulate collection sint64
332+
message CollectionSInt64 {
333+
repeated sint64 sint64 = 1;
334+
}
335+
294336
// Used to describe a given binding on invocation
295337
message ParameterBinding {
296338
// Name for the binding
@@ -341,6 +383,12 @@ message RpcLog {
341383
None = 6;
342384
}
343385

386+
// Category of the log. Defaults to User if not specified.
387+
enum RpcLogCategory {
388+
User = 0;
389+
System = 1;
390+
}
391+
344392
// Unique id for invocation (if exists)
345393
string invocation_id = 1;
346394

@@ -362,6 +410,9 @@ message RpcLog {
362410

363411
// json serialized property bag, or could use a type scheme like map<string, TypedData>
364412
string properties = 7;
413+
414+
// Category of the log. Either user(default) or system.
415+
RpcLogCategory log_category = 8;
365416
}
366417

367418
// Encapsulates an Exception
@@ -372,7 +423,7 @@ message RpcException {
372423
// Stack trace for the exception
373424
string stack_trace = 1;
374425

375-
// Textual message describing hte exception
426+
// Textual message describing the exception
376427
string message = 2;
377428
}
378429

azure-functions-language-worker-protobuf/src/proto/identity/ClaimsIdentityRpc.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
syntax = "proto3";
22
// protobuf vscode extension: https://marketplace.visualstudio.com/items?itemName=zxh404.vscode-proto3
33

4+
option java_package = "com.microsoft.azure.functions.rpc.messages";
5+
46
import "shared/NullableTypes.proto";
57

68
// Light-weight representation of a .NET System.Security.Claims.ClaimsIdentity object.

azure-functions-language-worker-protobuf/src/proto/shared/NullableTypes.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
syntax = "proto3";
22
// protobuf vscode extension: https://marketplace.visualstudio.com/items?itemName=zxh404.vscode-proto3
33

4+
option java_package = "com.microsoft.azure.functions.rpc.messages";
5+
46
import "google/protobuf/timestamp.proto";
57

68
message NullableString {

0 commit comments

Comments
 (0)