Support disabling proto load via environment variable #335
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.
When working through an interop sample that has both https://github.com/coinbase/temporal-ruby and https://github.com/temporalio/sdk-ruby in the same process, it clashed due to how Google protobuf library does not allow the same qualified proto generated in different places.
After testing, I am happy to report the projects can coexist so long as the Temporal Ruby SDK's generated protos are loaded instead. So this PR checks for an env var and if that env var is set, the
require
is not called for loading protos. With this change, I have confirmed that the Coinbase Ruby SDK client can use Temporal Ruby SDK workflows, and vice versa, and that Coinbase Ruby SDK workflows can use Temporal Ruby SDK activities, and vice versa. I should have a sample showing this soon.Note, for the
sed
changes toMakefile
, the protos have not been regenerated for a couple of years, and if the latestprotoc
fromgrpc-tools
is used it makes several changes which I didn't want to do. So I manually/temporarily runbundle add grpc-tools --version 1.53.2
(the version at the time of last proto gen in this repo) beforemake proto
to ensure these changes add no unnecessary side effects.