Skip to content

Commit

Permalink
Merge ui service annotations with our official ones (#319)
Browse files Browse the repository at this point in the history
The new proto library we're attempting to use crashes if you have
multiple service definitions for a given proto. gogo/protobuf
technically _should_ have but didn't, so now we need to merge our
definitions so there's only one.

While here I silenced the API linter like in temporalio/temporal#4988
  • Loading branch information
tdeebswihart authored Oct 19, 2023
1 parent 1356912 commit 660b52b
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 20 deletions.
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ PATH := $(GOBIN):$(PATH)

COLOR := "\e[1;36m%s\e[0m\n"

# Only prints output if the exit code is non-zero
define silent_exec
@output=$$($(1) 2>&1); \
status=$$?; \
if [ $$status -ne 0 ]; then \
echo "$$output"; \
fi; \
exit $$status
endef

PROTO_ROOT := .
PROTO_FILES = $(shell find $(PROTO_ROOT) -name "*.proto")
PROTO_DIRS = $(sort $(dir $(PROTO_FILES)))
Expand Down Expand Up @@ -68,7 +78,7 @@ buf-install:
##### Linters #####
api-linter:
printf $(COLOR) "Run api-linter..."
api-linter --set-exit-status $(PROTO_IMPORTS) --config $(PROTO_ROOT)/api-linter.yaml $(PROTO_FILES)
$(call silent_exec, api-linter --set-exit-status $(PROTO_IMPORTS) --config $(PROTO_ROOT)/api-linter.yaml $(PROTO_FILES))

buf-lint:
printf $(COLOR) "Run buf linter..."
Expand Down
4 changes: 4 additions & 0 deletions temporal/api/operatorservice/v1/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ option csharp_namespace = "Temporalio.Api.OperatorService.V1";


import "temporal/api/operatorservice/v1/request_response.proto";
import "google/api/annotations.proto";

// OperatorService API defines how Temporal SDKs and other clients interact with the Temporal server
// to perform administrative functions like registering a search attribute or a namespace.
Expand All @@ -56,6 +57,9 @@ service OperatorService {

// ListSearchAttributes returns comprehensive information about search attributes.
rpc ListSearchAttributes (ListSearchAttributesRequest) returns (ListSearchAttributesResponse) {
option (google.api.http) = {
get: "/api/v1/namespaces/{namespace}/search-attributes",
};
}

// DeleteNamespace synchronously deletes a namespace and asynchronously reclaims all namespace resources.
Expand Down
36 changes: 17 additions & 19 deletions temporal/api/workflowservice/v1/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ service WorkflowService {
// Deprecated.
//
// (-- api-linter: core::0127::http-annotation=disabled
// aip.dev/not-precedent: Deprecated. --)
// aip.dev/not-precedent: Deprecated --)
rpc DeprecateNamespace (DeprecateNamespaceRequest) returns (DeprecateNamespaceResponse) {
}

Expand Down Expand Up @@ -350,22 +350,19 @@ service WorkflowService {
//
// (-- api-linter: core::0127::http-annotation=disabled
// aip.dev/not-precedent: Workflow deletion not exposed to HTTP, users should use cancel or terminate. --)
rpc DeleteWorkflowExecution (DeleteWorkflowExecutionRequest) returns (DeleteWorkflowExecutionResponse) {
}
rpc DeleteWorkflowExecution (DeleteWorkflowExecutionRequest) returns (DeleteWorkflowExecutionResponse) {}

// ListOpenWorkflowExecutions is a visibility API to list the open executions in a specific namespace.
//
// (-- api-linter: core::0127::http-annotation=disabled
// aip.dev/not-precedent: HTTP users should use ListWorkflowExecutions instead. --)
rpc ListOpenWorkflowExecutions (ListOpenWorkflowExecutionsRequest) returns (ListOpenWorkflowExecutionsResponse) {
}
rpc ListOpenWorkflowExecutions (ListOpenWorkflowExecutionsRequest) returns (ListOpenWorkflowExecutionsResponse) {}

// ListClosedWorkflowExecutions is a visibility API to list the closed executions in a specific namespace.
//
// (-- api-linter: core::0127::http-annotation=disabled
// aip.dev/not-precedent: HTTP users should use ListWorkflowExecutions instead. --)
rpc ListClosedWorkflowExecutions (ListClosedWorkflowExecutionsRequest) returns (ListClosedWorkflowExecutionsResponse) {
}
rpc ListClosedWorkflowExecutions (ListClosedWorkflowExecutionsRequest) returns (ListClosedWorkflowExecutionsResponse) {}

// ListWorkflowExecutions is a visibility API to list workflow executions in a specific namespace.
rpc ListWorkflowExecutions (ListWorkflowExecutionsRequest) returns (ListWorkflowExecutionsResponse) {
Expand Down Expand Up @@ -399,8 +396,7 @@ service WorkflowService {
//
// (-- api-linter: core::0127::http-annotation=disabled
// aip.dev/not-precedent: We do not expose this search attribute API to HTTP (but may expose on OperatorService). --)
rpc GetSearchAttributes (GetSearchAttributesRequest) returns (GetSearchAttributesResponse) {
}
rpc GetSearchAttributes (GetSearchAttributesRequest) returns (GetSearchAttributesResponse) {}

// RespondQueryTaskCompleted is called by workers to complete queries which were delivered on
// the `query` (not `queries`) field of a `PollWorkflowTaskQueueResponse`.
Expand All @@ -410,8 +406,7 @@ service WorkflowService {
//
// (-- api-linter: core::0127::http-annotation=disabled
// aip.dev/not-precedent: We do not expose worker API to HTTP. --)
rpc RespondQueryTaskCompleted (RespondQueryTaskCompletedRequest) returns (RespondQueryTaskCompletedResponse) {
}
rpc RespondQueryTaskCompleted (RespondQueryTaskCompletedRequest) returns (RespondQueryTaskCompletedResponse) {}

// ResetStickyTaskQueue resets the sticky task queue related information in the mutable state of
// a given workflow. This is prudent for workers to perform if a workflow has been paged out of
Expand Down Expand Up @@ -535,11 +530,13 @@ service WorkflowService {
// (-- api-linter: core::0127::http-annotation=disabled
// aip.dev/not-precedent: We do yet expose versioning API to HTTP. --)
rpc UpdateWorkerBuildIdCompatibility (UpdateWorkerBuildIdCompatibilityRequest) returns (UpdateWorkerBuildIdCompatibilityResponse) {}

// Fetches the worker build id versioning sets for a task queue.
//
// (-- api-linter: core::0127::http-annotation=disabled
// aip.dev/not-precedent: We do yet expose versioning API to HTTP. --)
rpc GetWorkerBuildIdCompatibility (GetWorkerBuildIdCompatibilityRequest) returns (GetWorkerBuildIdCompatibilityResponse) {}
rpc GetWorkerBuildIdCompatibility (GetWorkerBuildIdCompatibilityRequest) returns (GetWorkerBuildIdCompatibilityResponse) {
option (google.api.http) = {
get: "/api/v1/namespaces/{namespace}/task-queues/{task_queue}/worker-build-id-compatibility"
};
}

// Fetches task reachability to determine whether a worker may be retired.
// The request may specify task queues to query for or let the server fetch all task queues mapped to the given
Expand All @@ -553,10 +550,11 @@ service WorkflowService {
//
// Open source users can adjust this limit by setting the server's dynamic config value for
// `limit.reachabilityTaskQueueScan` with the caveat that this call can strain the visibility store.
//
// (-- api-linter: core::0127::http-annotation=disabled
// aip.dev/not-precedent: We do yet expose versioning API to HTTP. --)
rpc GetWorkerTaskReachability (GetWorkerTaskReachabilityRequest) returns (GetWorkerTaskReachabilityResponse) {}
rpc GetWorkerTaskReachability (GetWorkerTaskReachabilityRequest) returns (GetWorkerTaskReachabilityResponse) {
option (google.api.http) = {
get: "/api/v1/namespaces/{namespace}/worker-task-reachability"
};
}

// Invokes the specified update function on user workflow code.
rpc UpdateWorkflowExecution(UpdateWorkflowExecutionRequest) returns (UpdateWorkflowExecutionResponse) {
Expand Down

0 comments on commit 660b52b

Please sign in to comment.