Repository navigation
temporal-sdk-migration [2/x]: temporal: support protobuf sharing with the official Ruby SDK - #9
Merged
Conversation
yfang-figma
requested review from
a team,
kstewartfigma and
michaelnyu
and removed request for
a team
November 13, 2026 21:20
yfang-figma
marked this pull request as ready for review
November 13, 2026 21:20
kstewartfigma
approved these changes
Nov 13, 2026
yfang-figma
force-pushed
the
yfang/temporal-protobuf-coexistence
branch
from
November 17, 2026 07:09
0f7c066 to
a406677
Compare
yfang-figma
force-pushed
the
yfang/temporal-protobuf-coexistence
branch
from
November 17, 2026 07:15
a406677 to
29327b5
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 29327b5. Configure here.
|
|
||
| proto: | ||
| $(foreach PROTO_DIR,$(PROTO_DIRS),bundle exec grpc_tools_ruby_protoc -Iproto --ruby_out=$(PROTO_OUT) --grpc_out=$(PROTO_OUT) $(PROTO_DIR)*.proto;) | ||
| sed -i "/^require 'temporal\// s/$$/ unless ENV['COINBASE_TEMPORAL_RUBY_DISABLE_PROTO_LOAD'] == '1'/" $(PROTO_OUT)/temporal/api/workflowservice/v1/service_services_pb.rb $(PROTO_OUT)/temporal/api/operatorservice/v1/service_services_pb.rb |
There was a problem hiding this comment.
Proto sed breaks on macOS
Low Severity
The new make proto step uses GNU sed -i with no backup suffix to re-apply the COINBASE_TEMPORAL_RUBY_DISABLE_PROTO_LOAD guards. BSD sed on macOS treats the script as a backup extension and fails after protoc has already overwritten service_services_pb.rb. Regeneration then leaves the gRPC stubs unguarded, so a later commit can drop coexistence support.
Reviewed by Cursor Bugbot for commit 29327b5. Configure here.
yfang-figma
force-pushed
the
yfang/temporal-protobuf-coexistence
branch
2 times, most recently
from
November 17, 2026 07:49
a00938f to
29327b5
Compare
yfang-figma
force-pushed
the
yfang/temporal-protobuf-coexistence
branch
from
November 17, 2026 08:38
29327b5 to
34d2726
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Written with AI
Let the official SDK own Temporal protobuf messages when
COINBASE_TEMPORAL_RUBY_DISABLE_PROTO_LOAD=1. Keep Coinbase's Ruby gRPC stubs and preserve default Coinbase-only loading. Preserve the import guards after protobuf regeneration. This follows Coinbase PR 335.Load the official API classes before the first Coinbase require. Set the option before that require. Sharing definitions changes field access and decoding, so application schema compatibility needs review before dual loading is enabled. Application boot, fork behavior, and worker polling belong to the dependent application PRs. The official gem is a test dependency only.
Why the follow-up commits are needed
Preserve Coinbase's original protobuf import order. With upstream's order, the schedule-overlap serializer reads
ScheduleOverlapPolicybefore its protobuf definition loads. Removing this commit reproduced a Coinbase-only boot failure:NameError: uninitialized constant Temporalio::Api::Enums::V1::ScheduleOverlapPolicy. This commit loads the gRPC stubs and their protobuf dependencies before the serializers.The upstream PR description reports tests with both SDKs loaded together. When the official SDK loads first, the enum already exists. That loading sequence avoids this failure. The reproduced failure above concerns our fork with upstream's order; we did not run the complete, unmodified upstream SDK.
Honor PROTO_OUT when guarding generated imports. The Makefile already supports a custom output directory, but upstream's guard step targets
lib/gen. Use the configured directory so regenerated stubs retain the guards there too. This is needed when generation writes outsidelib/gen, including the temporary-directory validation below.Add tests, CI coverage, and documentation. Upstream supplies the loading mechanism without regression tests. These additions check default loading and shared definitions with Coinbase serializers, workers, replay-helper imports, and both gRPC stubs. CI runs the loading probes with the test-only official SDK dependency. The test Gemfiles pin protobuf to 4.33.1 to match the application. The published dependency remains
~> 4.33.0. Documentation records the required load order and the separate application checks.Update CI to Ruby 3.4 and repair test fixtures. CI selected Ruby 3.0.3, but the fork's existing protobuf dependency requires Ruby 3.1 or later. Ruby 3.4 matches the application environment. Existing fixtures also need explicit OpenStruct loading, positional-hash workflow inputs, and support for qualified backtrace labels. These repairs preserve the existing behavioral assertions.
Test plan
BUNDLE_GEMFILE=Gemfile bundle exec rspec spec/unit: 647 examples, zero failures, one expected pending coexistence example.BUNDLE_GEMFILE=gemfiles/temporalio.gemfile bundle exec rspec spec/unit: 647 examples, zero failures. The loading probes cover the default path, client-first boot, serializers, replay imports, workers, and both gRPC stubs.git submodule update --init --depth 1, runmake proto PROTO_OUT=/tmp/temporal-pr2-generatedwith the coexistence Gemfile. Generation passes. Both regenerated stubs load against the official classes with the opt-in enabled.Local unit checks used Ruby 3.4.12, temporalio 1.10.1, and google-protobuf 4.33.1. The earlier regeneration check used google-protobuf 4.33.6. CI also covers the example workflows against its Temporal server.