Skip to content

Commit

Permalink
Update Temporal API to 1.16 (coinbase#217)
Browse files Browse the repository at this point in the history
* Upgrade Temporal proto API to version 1.16

* Rename Temporal::Api -> Temporalio::Api

* Remove deprecated namespace field for activity task scheduling

* Increase version to 0.0.2 because of Temporalio package change
  • Loading branch information
jeffschoner authored Feb 13, 2023
1 parent 214b334 commit f16228e
Show file tree
Hide file tree
Showing 104 changed files with 1,667 additions and 488 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
PROTO_ROOT := proto/temporal
PROTO_ROOT := proto
PROTO_FILES = $(shell find $(PROTO_ROOT) -name "*.proto")
PROTO_DIRS = $(sort $(dir $(PROTO_FILES)))
PROTO_OUT := lib/gen

proto:
$(foreach PROTO_DIR,$(PROTO_DIRS),bundle exec grpc_tools_ruby_protoc -Iproto --ruby_out=$(PROTO_OUT) --grpc_out=$(PROTO_OUT) $(PROTO_DIR)*.proto;)

.PHONY: proto
.PHONY: proto
8 changes: 4 additions & 4 deletions examples/lib/cryptconverter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def to_payloads(data)

payloads = super(data)

Temporal::Api::Common::V1::Payloads.new(
Temporalio::Api::Common::V1::Payloads.new(
payloads: payloads.payloads.map { |payload| encrypt_payload(payload, key_id, key) }
)
end
Expand Down Expand Up @@ -55,12 +55,12 @@ def encrypt(data, key)
end

def encrypt_payload(payload, key_id, key)
Temporal::Api::Common::V1::Payload.new(
Temporalio::Api::Common::V1::Payload.new(
metadata: {
METADATA_ENCODING_KEY => METADATA_ENCODING,
METADATA_KEY_ID_KEY => key_id,
},
data: encrypt(Temporal::Api::Common::V1::Payload.encode(payload), key)
data: encrypt(Temporalio::Api::Common::V1::Payload.encode(payload), key)
)
end

Expand All @@ -85,7 +85,7 @@ def decrypt_payload(payload)
key = get_key(key_id)
serialized_payload = decrypt(payload.data, key)

Temporal::Api::Common::V1::Payload.decode(serialized_payload)
Temporalio::Api::Common::V1::Payload.decode(serialized_payload)
end
end
end
2 changes: 1 addition & 1 deletion examples/spec/integration/describe_namespace_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
end
expect(rescued).to eq(true)
result = Temporal.describe_namespace(namespace)
expect(result).to be_an_instance_of(Temporal::Api::WorkflowService::V1::DescribeNamespaceResponse)
expect(result).to be_an_instance_of(Temporalio::Api::WorkflowService::V1::DescribeNamespaceResponse)
expect(result.namespace_info.name).to eq(namespace)
expect(result.namespace_info.state).to eq(:NAMESPACE_STATE_REGISTERED)
expect(result.namespace_info.description).to_not eq(nil)
Expand Down
2 changes: 1 addition & 1 deletion examples/spec/integration/list_namespaces_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe 'Temporal.list_namespaces', :integration do
it 'returns the correct values' do
result = Temporal.list_namespaces(page_size: 100)
expect(result).to be_an_instance_of(Temporal::Api::WorkflowService::V1::ListNamespacesResponse)
expect(result).to be_an_instance_of(Temporalio::Api::WorkflowService::V1::ListNamespacesResponse)
end
end
14 changes: 14 additions & 0 deletions lib/gen/dependencies/gogoproto/gogo_pb.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 50 additions & 0 deletions lib/gen/temporal/api/batch/v1/message_pb.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 16 additions & 2 deletions lib/gen/temporal/api/command/v1/message_pb.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion lib/gen/temporal/api/common/v1/message_pb.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions lib/gen/temporal/api/enums/v1/batch_operation_pb.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion lib/gen/temporal/api/enums/v1/command_type_pb.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions lib/gen/temporal/api/enums/v1/common_pb.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion lib/gen/temporal/api/enums/v1/event_type_pb.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 20 additions & 1 deletion lib/gen/temporal/api/enums/v1/failed_cause_pb.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f16228e

Please sign in to comment.