Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
386 commits
Select commit Hold shift + click to select a range
d8a5df7
Revert signal_with_start (before taking a different approach)
nagl-stripe Oct 27, 2021
06626ad
Add signal arguments to start_workflow (to support signal_with_start)
nagl-stripe Oct 27, 2021
ac66062
Merge memo changes
nagl-stripe Oct 27, 2021
0aec214
Address PR feedback
nagl-stripe Oct 27, 2021
50ab4da
Merge pull request #46 from stripe-private-oss-forks/nagl-signal-with…
nagl-stripe Oct 27, 2021
be0510c
Update method signature in temporal test fixture
nagl-stripe Oct 28, 2021
bbc6d89
Add detail to a few error messages
nagl-stripe Oct 28, 2021
73120be
Merge pull request #48 from stripe-private-oss-forks/nagl-signal-with…
nagl-stripe Oct 28, 2021
22006e3
Update our FailWorkflowTask logic's call to ErrorHandler.handle
nagl-stripe Oct 28, 2021
6e9624e
Merge pull request #49 from stripe-private-oss-forks/nagl-signal-with…
nagl-stripe Oct 28, 2021
55253af
Workflow await
jeffschoner-stripe Oct 28, 2021
399f9b8
Make dispatch more generic
jeffschoner-stripe Nov 1, 2021
b461af9
Fix race condition
jeffschoner-stripe Nov 2, 2021
c76042a
Merge await into wait_for
jeffschoner-stripe Nov 2, 2021
7310062
Update sample workflow to use wait_for, rename to WaitForWorkflow
jeffschoner-stripe Nov 2, 2021
256f472
Reorganize and extend wait_for tests
jeffschoner-stripe Nov 2, 2021
9c776c5
Check for completed futures before setting dispatcher and yielding th…
jeffschoner-stripe Nov 2, 2021
3c5b77a
Extend wait_for to take multiple futures and a condition block
jeffschoner-stripe Oct 28, 2021
dc74dae
Merge pull request #47 from stripe-private-oss-forks/jeffschoner/wofl…
jeffschoner-stripe Nov 10, 2021
51f6c9b
Differentiate TARGET_WILDCARD and WILDCARD, allow comparison with Eve…
jeffschoner-stripe Nov 12, 2021
a280807
Merge pull request #50 from stripe-private-oss-forks/jeffschoner/wofl…
jeffschoner-stripe Nov 13, 2021
7290de3
Use Ruby 2.7 to be consistent with pay-server
jeffschoner-stripe Nov 15, 2021
68de5bf
Merge pull request #51 from stripe-private-oss-forks/jeffschoner/m1-f…
jeffschoner-stripe Nov 15, 2021
acd5220
Turn off schedule_to_start activity timeout by default
drewhoskins-stripe Nov 15, 2021
62137ba
Merge pull request #52 from stripe-private-oss-forks/drewhoskins_sche…
drewhoskins-stripe Nov 17, 2021
0bc8a62
Refactor metadata generation
jeffschoner-stripe Nov 17, 2021
391cd1f
Make task queue available on workflow metadata, add example test
jeffschoner-stripe Oct 14, 2021
a16f856
Expose workflow start time metadata
jeffschoner-stripe Oct 15, 2021
36b45a6
Add memos
jeffschoner-stripe Oct 13, 2021
a7ca88a
Merge branch 'memos' from https://github.com/jeffschoner-stripe/tempo…
jeffschoner-stripe Nov 19, 2021
71b5bd3
Merge branch 'master' into upgrade-latest
jeffschoner-stripe Nov 19, 2021
7285165
Merge pull request #53 from stripe-private-oss-forks/upgrade-latest
jeffschoner-stripe Nov 20, 2021
2842f6f
Merge branch 'master' into jeffschoner/latest-coinbase
jeffschoner-stripe Nov 29, 2021
265cd3e
Merge pull request #54 from stripe-private-oss-forks/jeffschoner/late…
jeffschoner-stripe Nov 30, 2021
aca915b
Merge branch 'master' into coinbase-latest
jeffschoner-stripe Dec 9, 2021
1b03601
Merge pull request #55 from stripe-private-oss-forks/coinbase-latest
jeffschoner-stripe Dec 9, 2021
c9af317
Make error deserialization more resilient
nagl-stripe Dec 16, 2021
1c4177f
Merge pull request #56 from stripe-private-oss-forks/nagl-RUN_WOFLO-218
nagl-stripe Dec 16, 2021
9a7d969
Make temporal-ruby able to deserialize larger histories
nagl-stripe Dec 20, 2021
10d7cd6
Remove temporary test
nagl-stripe Dec 20, 2021
3b21b3d
Merge pull request #57 from stripe-private-oss-forks/nagl-large-histo…
nagl-stripe Dec 20, 2021
368afe3
Expose workflow name in activity metadata in temporal-ruby's unit tester
nagl-stripe Jan 11, 2022
e23dc5e
Add a workflow-level test
nagl-stripe Jan 11, 2022
60b09d3
Merge pull request #58 from stripe-private-oss-forks/nagl-RUN_WOFLO-237
nagl-stripe Jan 11, 2022
c3efa7f
add namespace to emitted metrics
christopherb-stripe Jan 19, 2022
2e50ab5
Merge pull request #59 from stripe-private-oss-forks/christopherb/met…
christopherb-stripe Jan 21, 2022
086a635
emit the workflow name tag during activity processing
christopherb-stripe Jan 31, 2022
9297afb
fix typo
christopherb-stripe Jan 31, 2022
622b8bc
Merge pull request #60 from stripe-private-oss-forks/christopherb/add…
christopherb-stripe Feb 1, 2022
521e53e
merged coinbase latest
calum-stripe Feb 15, 2022
b9acc5d
added failworkflowtaskerror
calum-stripe Feb 15, 2022
fedfd7f
Merge pull request #61 from stripe-private-oss-forks/calum-updating-t…
calum-stripe Feb 16, 2022
54be471
Merge pull request #63 from stripe-private-oss-forks/drewhoskins_coin…
drewhoskins-stripe Mar 1, 2022
92a4db3
updated register namespace to accept new params
calum-stripe Mar 2, 2022
ebc8462
examples
calum-stripe Mar 2, 2022
9bab13b
fixed namespace test
calum-stripe Mar 2, 2022
91c50c9
empty
calum-stripe Mar 2, 2022
cb02791
updated unit tests
calum-stripe Mar 3, 2022
4516126
removed unncessary code
calum-stripe Mar 3, 2022
1b78814
updated seconds
calum-stripe Mar 3, 2022
f5978d2
Add replay flag to workflow context
jeffschoner-stripe Mar 3, 2022
f0801b2
fixed nits
calum-stripe Mar 4, 2022
8a4d875
Rename to replay? to history_replaying?
jeffschoner-stripe Mar 4, 2022
7e223f0
updated sleep to 0.5
calum-stripe Mar 4, 2022
79ecd67
updated unit tests and nits
calum-stripe Mar 4, 2022
1c0e38c
fixed unit tests
calum-stripe Mar 4, 2022
47e04fd
Merge pull request #66 from stripe-private-oss-forks/jeffschoner/cont…
jeffschoner-stripe Mar 4, 2022
557912a
added link to comment
calum-stripe Mar 4, 2022
b76c17d
Merge pull request #67 from stripe-private-oss-forks/calum-updating-r…
calum-stripe Mar 7, 2022
a9b236f
Merge branch 'master' into upstream_merge
drewhoskins-stripe Mar 7, 2022
4f0684b
Merge fix
drewhoskins-stripe Mar 7, 2022
19fae32
Merge pull request #69 from stripe-private-oss-forks/upstream_merge
drewhoskins-stripe Mar 7, 2022
3d1df21
Fix upsert_search_attributes
drewhoskins-stripe Mar 7, 2022
c698f70
Merge pull request #70 from stripe-private-oss-forks/drewhoskins_upse…
drewhoskins-stripe Mar 7, 2022
1ca8365
added fix for nil search attributes
calum-stripe Mar 8, 2022
c49aadb
added unit test
calum-stripe Mar 8, 2022
04cd6df
updated unit test
calum-stripe Mar 8, 2022
e45bbef
added expect to be nil
calum-stripe Mar 8, 2022
7170411
Merge pull request #72 from stripe-private-oss-forks/calum-fixing-lis…
calum-stripe Mar 8, 2022
33208a7
Expose scheduled_time and current_attempt_scheduled_time on activity …
nagl-stripe Mar 10, 2022
4c03bf7
Merge pull request #73 from stripe-private-oss-forks/nagl-RUN_WOFLO-310
nagl-stripe Mar 11, 2022
ea8a78a
Merge remote-tracking branch 'public/master' into public-latest
aryak-stripe Mar 14, 2022
1e59a14
Merge pull request #74 from stripe-private-oss-forks/public-latest
aryak-stripe Mar 14, 2022
961ed83
Implement ParentClosePolicy for child workflows
aryak-stripe Mar 10, 2022
1a7dbac
Add e2e test for child workflow execution
aryak-stripe Mar 10, 2022
ac589fd
move serialization logic farther down the stack
aryak-stripe Mar 14, 2022
525fa0b
Refactor serialize_parent_close_policy; add unit tests
aryak-stripe Mar 14, 2022
7a7648b
Merge pull request #76 from stripe-private-oss-forks/aryak/parent_clo…
aryak-stripe Mar 15, 2022
4012392
Expose wait_for_start for child workflow execution
aryak-stripe Mar 16, 2022
151eb75
Remove future `workflow_id,run_id` annotations; simplify wait_for logic
aryak-stripe Mar 16, 2022
064d2ee
Merge pull request #77 from stripe-private-oss-forks/aryak/child-work…
aryak-stripe Mar 16, 2022
4537fda
Add parent_run_id, parent_id to workflow metadata
aryak-stripe Mar 16, 2022
ddae0f9
Merge pull request #78 from stripe-private-oss-forks/aryak/expose-par…
aryak-stripe Mar 16, 2022
c3e662b
Allow opting out of child workflow futures
aryak-stripe Mar 25, 2022
8c25716
Merge pull request #79 from stripe-private-oss-forks/aryak/child_work…
aryak-stripe Mar 28, 2022
decf50a
Remove duplicate describe block
nagl-stripe Apr 6, 2022
0da1591
Factor out workflow_id_reuse_policy serialization
nagl-stripe Apr 6, 2022
409eb83
Respect workflow_id_reuse_policy for child workflows
nagl-stripe Apr 6, 2022
b61298e
Add integration tests
nagl-stripe Apr 6, 2022
f48893f
Use a nicer exception type
nagl-stripe Apr 6, 2022
eb6618d
Merge pull request #82 from stripe-private-oss-forks/nagl-RUN_WOFLO-3…
nagl-stripe Apr 6, 2022
173f3b4
Refactor wait_for into distinct wait_for_any and wait_for_condition m…
jeffschoner-stripe Apr 5, 2022
3057ac5
Order wildcard dispatch handlers
jeffschoner-stripe Apr 6, 2022
84b3833
Remove finished handlers
jeffschoner-stripe Apr 6, 2022
5c96eb5
Check finished? on wait_for_any, add more unit specs
jeffschoner-stripe Apr 7, 2022
e7a3dc0
More dispatch unit specs
jeffschoner-stripe Apr 7, 2022
eff84f1
Use hash instead of list for callbacks per target
jeffschoner-stripe Apr 7, 2022
56e2e17
Remove dead code, improve error messages in local workflow context
jeffschoner-stripe Apr 8, 2022
5b0d0ab
Correct swapped arguments
jeffschoner-stripe Apr 8, 2022
b907446
Eliminate unnecessary IDs for dispatcher handlers
jeffschoner-stripe Apr 8, 2022
016cab4
Raise on duplicate ID
jeffschoner-stripe Apr 9, 2022
350720d
Merge pull request #83 from stripe-private-oss-forks/jeffschoner/wait…
jeffschoner-stripe Apr 11, 2022
c83746c
added paginated workflows
calum-stripe Apr 14, 2022
2008444
client spec
calum-stripe Apr 14, 2022
8fa91a7
reset
calum-stripe Apr 14, 2022
d1140c3
Merge pull request #86 from stripe-private-oss-forks/calum-paginated-…
calum-stripe Apr 14, 2022
946eb98
Downstream the rest of [activity_metadata.workflow_name](https://gith…
nagl-stripe Feb 7, 2022
8cc93aa
Downstream the rest of [activity_metadata.scheduled_time](https://git…
nagl-stripe Mar 16, 2022
4c19e3e
Fix an activity_metadata related test that doesn't exist upstream
nagl-stripe Apr 20, 2022
d08b3d9
Downstream the rest of [child workflow workflow_id_reuse_policy fixes…
nagl-stripe Apr 7, 2022
fda7801
Downstream [merge error fix](https://github.com/coinbase/temporal-rub…
nagl-stripe Apr 20, 2022
5c96811
Merge pull request #87 from stripe-private-oss-forks/nagl-downstream-…
nagl-stripe Apr 20, 2022
3524880
Merge branch 'master' into jeffschoner/latest-coinbase
jeffschoner-stripe May 17, 2022
1682222
Merge pull request #89 from stripe-private-oss-forks/jeffschoner/late…
jeffschoner-stripe May 18, 2022
8e64342
added json protobuf
calum-stripe May 27, 2022
9a8ed7c
Update json_protobuf.rb
calum-stripe May 27, 2022
47ef88b
added unit test
calum-stripe May 27, 2022
66d643e
Merge pull request #91 from stripe-private-oss-forks/calum-json-proto…
calum-stripe May 27, 2022
b199a36
Remove duplicate tests in context_spec
jeffschoner-stripe May 29, 2022
599904c
Merge pull request #92 from stripe-private-oss-forks/jeffschoner/remo…
jeffschoner-stripe May 31, 2022
9d9d462
allow connection options to be set
christopherb-stripe May 24, 2022
0a4739d
add missing comma
christopherb-stripe May 24, 2022
c26eeb2
add test for interceptors
christopherb-stripe Jun 4, 2022
bf78dbd
remove unused variable
christopherb-stripe Jun 4, 2022
b36d27c
Merge branch 'master' into jeffschoner/dispatcher-merge
jeffschoner-stripe Jun 6, 2022
24be2fd
Merge pull request #94 from stripe-private-oss-forks/jeffschoner/disp…
jeffschoner-stripe Jun 11, 2022
45765e0
Merge pull request #93 from stripe-private-oss-forks/christopherb/int…
christopherb-stripe Jun 11, 2022
37b0b73
Merge branch 'master' into jeffschoner/stack-trace
jeffschoner-stripe Jun 25, 2022
c3f1fbd
use new Temporal client in interceptor test to avoid test pollution
christopherb-stripe Jun 25, 2022
3fbcbe5
Merge pull request #96 from stripe-private-oss-forks/christopherb/fix…
christopherb-stripe Jun 27, 2022
7d2ef3a
Merge pull request #95 from stripe-private-oss-forks/jeffschoner/stac…
jeffschoner-stripe Jun 27, 2022
fa8fec0
add option to specify search attributes when starting workflows
jazevedo-stripe Jul 13, 2022
e5d4efe
move empty check out of Temporal::Workflow::Context::Helpers.process_…
jazevedo-stripe Jul 18, 2022
c75bda4
move process_search_attributes out of ExecutionOptions.initialize
jazevedo-stripe Jul 18, 2022
4896f84
allow default search attributes to be configured globally
jazevedo-stripe Jul 18, 2022
7aff9f3
fix tests, unit test global default search attributes
jazevedo-stripe Jul 18, 2022
afca5da
add unit test for gRPC serialization
jazevedo-stripe Jul 18, 2022
dd6d544
clean up the integration test
jazevedo-stripe Jul 18, 2022
9968901
Merge pull request #97 from stripe-private-oss-forks/jazevedo/add-sea…
jazevedo-stripe Jul 19, 2022
f3925d4
Include remaining changes from upstream #188 (#98)
jazevedo-stripe Aug 8, 2022
ecd87ee
Remove dead code from previous messy merge
jeffschoner Aug 15, 2022
adb48dd
Separate wait_until handlers, execute at end
jeffschoner Aug 15, 2022
a6557c2
Modify signal_with_start_workflow to cover dwillett's repro
jeffschoner Aug 15, 2022
7560963
Merge pull request #99 from stripe-private-oss-forks/jeffschoner/disp…
jeffschoner-stripe Aug 17, 2022
c1457c0
Merge remote-tracking branch 'coinbase/master' into jeffschoner/dispa…
jeffschoner-stripe Sep 6, 2022
76ee0ba
Merge pull request #100 from stripe-private-oss-forks/jeffschoner/dis…
jeffschoner-stripe Sep 6, 2022
1c18b5d
Disable running rubyfmt on save
jeffschoner-stripe Sep 26, 2022
20b54bb
Consolidate metrics constants
jeffschoner-stripe Sep 24, 2022
ee37874
Add workflow task failure counter
jeffschoner-stripe Sep 24, 2022
33ed56d
Use metric_keys.rb for filename
jeffschoner-stripe Sep 26, 2022
7d28754
Merge pull request #101 from stripe-private-oss-forks/jeffschoner/WOF…
jeffschoner-stripe Sep 26, 2022
22420b7
Allow client identity to be configurable
jeffschoner-stripe Oct 19, 2022
61a95e7
Use PID instead of thread ID in default identity
jeffschoner-stripe Oct 19, 2022
85c6bae
Merge pull request #102 from stripe-private-oss-forks/jeffschoner/cli…
jeffschoner-stripe Oct 19, 2022
74a29c8
Add poller completed metrics
jeffschoner-stripe Oct 20, 2022
70efdb4
Gauge metrics for queue size and available threads per thread pool
jeffschoner-stripe Oct 20, 2022
88eb156
Merge pull request #103 from stripe-private-oss-forks/jeffschoner/idl…
jeffschoner-stripe Oct 20, 2022
000f3e3
Add task queue and namespace to thread pool metrics
jeffschoner-stripe Oct 20, 2022
4d11b85
Merge pull request #104 from stripe-private-oss-forks/jeffschoner/mor…
jeffschoner-stripe Oct 20, 2022
1266923
Fix tag
jeffschoner-stripe Oct 20, 2022
1edc8b4
Merge pull request #105 from stripe-private-oss-forks/jeffschoner/fix…
jeffschoner-stripe Oct 20, 2022
ee81e0c
Merge remote-tracking branch 'origin/master' into jeffschoner/downstream
jeffschoner-stripe Oct 28, 2022
3deda64
Merge pull request #106 from stripe-private-oss-forks/jeffschoner/dow…
jeffschoner-stripe Oct 31, 2022
e59db77
reverted proto_json changes
calum-stripe Nov 11, 2022
e805a38
Merge pull request #107 from stripe-private-oss-forks/calum/reverting…
calum-stripe Nov 11, 2022
a57601a
fixed import
calum-stripe Nov 14, 2022
1b270af
remmoved test file
calum-stripe Nov 14, 2022
48cbe20
Merge pull request #108 from stripe-private-oss-forks/calum/fixing-im…
calum-stripe Nov 14, 2022
0e2cbae
updated
calum-stripe Nov 21, 2022
d768b67
Merge pull request #109 from stripe-private-oss-forks/calum/upgrading…
calum-stripe Nov 21, 2022
41d8c7d
Revert "Merge pull request #108 from stripe-private-oss-forks/calum/f…
jeffschoner-stripe Dec 2, 2022
31d9fe7
Revert "Merge pull request #107 from stripe-private-oss-forks/calum/r…
jeffschoner-stripe Dec 2, 2022
0dba46a
Exempt the necessary system workflows from normal JSON proto deserial…
jeffschoner-stripe Dec 2, 2022
2efdbf9
Merge pull request #110 from stripe-private-oss-forks/jeffschoner/RUN…
jeffschoner-stripe Dec 3, 2022
4b95576
Emit task queue for workflow task failures
bryton-stripe Dec 7, 2022
03b6f51
Added task queue tags to workflow and activity task queue time metrics
bryton-stripe Dec 7, 2022
daaa508
Merge pull request #111 from stripe-private-oss-forks/ghe-master-bryt…
bryton-stripe Dec 7, 2022
14411ca
DynamicActivity
drewhoskins-stripe Dec 13, 2022
281fdec
Use const_get
drewhoskins-stripe Dec 13, 2022
353c9d6
Cleanup error message
drewhoskins-stripe Dec 13, 2022
40f1aa4
Jeff feedback
drewhoskins-stripe Dec 14, 2022
f9b38b7
Merge pull request #112 from stripe-private-oss-forks/drewhoskins_dyn…
drewhoskins-stripe Dec 14, 2022
361dd0d
Public version of dynamic activities
drewhoskins-stripe Jan 4, 2023
0696eab
Merge pull request #113 from stripe-private-oss-forks/public-latest
drewhoskins-stripe Jan 4, 2023
51fbeb9
do not fail workflow task if completing it errors
christopherb-stripe Jan 9, 2023
5d492a1
add a comment
christopherb-stripe Jan 11, 2023
71c85e9
use more realistic error type in tests
christopherb-stripe Jan 11, 2023
97aab20
Remove orphaned code post-merge
drewhoskins-stripe Jan 11, 2023
5f1f868
Merge pull request #115 from stripe-private-oss-forks/ghe-master
drewhoskins-stripe Jan 11, 2023
1693693
Merge pull request #114 from stripe-private-oss-forks/christopherb/wo…
christopherb-stripe Jan 11, 2023
0376b62
Allow empty pages when paginating through history
drewhoskins-stripe Jan 19, 2023
e98745b
Remove unused error
drewhoskins-stripe Jan 19, 2023
8b81871
Merge pull request #117 from stripe-private-oss-forks/drewhoskins_tur…
drewhoskins-stripe Jan 19, 2023
b9be213
Allow ActivityException to accept args
drewhoskins-stripe Jan 13, 2023
35db489
Improve deserialization code flow
drewhoskins-stripe Jan 13, 2023
d90d162
Use the default converter to serialize errors when configured to do so
drewhoskins-stripe Jan 27, 2023
0a2f176
Get tests working
drewhoskins-stripe Jan 28, 2023
c357bc4
Cleanup
drewhoskins-stripe Jan 28, 2023
82771d8
fix nit
drewhoskins-stripe Jan 28, 2023
f49e14e
Fix extraneous debug spew
drewhoskins-stripe Jan 30, 2023
0f497f6
Merge pull request #116 from stripe-private-oss-forks/drewhoskins_act…
drewhoskins-stripe Jan 30, 2023
706a49d
added max page size param
calum-stripe Jan 31, 2023
6ccbb4a
Merge pull request #118 from stripe-private-oss-forks/calum/adding-pa…
calum-stripe Feb 1, 2023
66d0021
Show bad data on Activity error serialization failure
drewhoskins-stripe Feb 2, 2023
9ef86bd
Merge pull request #119 from stripe-private-oss-forks/drewhoskins_act…
drewhoskins-stripe Feb 2, 2023
900e52c
Upgrade Temporal proto API to version 1.16
jeffschoner Feb 8, 2023
7dce335
Rename Temporal -> Temporalio
jeffschoner-stripe Feb 8, 2023
f4b916f
Remove deprecated namespace field for activity task scheduling
jeffschoner Feb 8, 2023
957c0c5
Merge pull request #120 from stripe-private-oss-forks/jeffschoner-upd…
jeffschoner-stripe Feb 9, 2023
837d5b4
Merge branch 'master' into jeffschoner-api-1.16-merge
jeffschoner-stripe Feb 13, 2023
ec831fc
Merge pull request #122 from stripe-private-oss-forks/jeffschoner-api…
jeffschoner-stripe Feb 13, 2023
43040a8
Methods for operating on custom search attributes
jeffschoner Feb 14, 2023
dee6e30
Example test for custom search attribute APIs
jeffschoner Feb 14, 2023
713d770
Unit tests
jeffschoner Feb 14, 2023
94cd205
Merge pull request #121 from stripe-private-oss-forks/jeffschoner-sea…
jeffschoner-stripe Feb 14, 2023
c913539
Treat missing history submessage on GetWorkflowExecutionHistoryRespon…
jeffschoner-stripe Feb 16, 2023
0c86fbf
Remove unnecessary &.
jeffschoner-stripe Feb 17, 2023
015bc07
Merge pull request #123 from stripe-private-oss-forks/jeffschoner-WOF…
jeffschoner-stripe Feb 17, 2023
153a877
Dynamic Workflows
drewhoskins-stripe Feb 28, 2023
08e4ef1
Add terminate-if-running workflow id reuse policy mappings
jeffschoner-stripe Feb 28, 2023
bf3be07
Add integration test for terminate-if-running
jeffschoner-stripe Feb 28, 2023
9ef5d82
Move misplaced test
drewhoskins-stripe Mar 1, 2023
2cd974e
Feedback
drewhoskins-stripe Mar 1, 2023
154a068
Merge pull request #124 from stripe-private-oss-forks/drewhoskins_sch…
drewhoskins-stripe Mar 1, 2023
77ab242
Use terminate-if-running as policy for both invocations
jeffschoner-stripe Mar 1, 2023
6297ac0
Merge pull request #125 from stripe-private-oss-forks/jeffschoner-WOF…
jeffschoner-stripe Mar 1, 2023
58e17da
Merge remote-tracking branch 'origin/master' into jeffschoner-latest-…
jeffschoner-stripe Mar 1, 2023
5f2e396
Merge pull request #126 from stripe-private-oss-forks/jeffschoner-lat…
jeffschoner-stripe Mar 1, 2023
9e8fadb
added payload codecs
calum-stripe Mar 20, 2023
47556d8
added search attribute payload methods
calum-stripe Mar 20, 2023
8eaf5e7
fixed tests
calum-stripe Mar 21, 2023
cea8ad2
added codec tests
calum-stripe Mar 21, 2023
9eec6af
added chain tests
calum-stripe Mar 21, 2023
d8a42d8
updated nits
calum-stripe Mar 23, 2023
145290c
Merge branch 'master' into calum/adding-payload-codecs
calum-stripe Mar 28, 2023
6ca7458
Revert "Merge branch 'master' into calum/adding-payload-codecs"
calum-stripe Mar 28, 2023
1d90708
Merge branch 'public-master' into calum/adding-payload-codecs
calum-stripe Mar 28, 2023
2d6a92b
fixed tests
calum-stripe Mar 28, 2023
5f02284
fixed
calum-stripe Mar 29, 2023
1aa6ba1
examples/lib/crypt_payload_codec.rb
calum-stripe Mar 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions examples/bin/worker
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env ruby
require_relative '../init'
require_relative '../lib/cryptconverter'
require_relative '../lib/crypt_payload_codec'

require 'temporal/worker'

Expand All @@ -11,8 +11,10 @@ Dir[File.expand_path('../middleware/*.rb', __dir__)].each { |f| require f }
if !ENV['USE_ENCRYPTION'].nil?
Temporal.configure do |config|
config.task_queue = 'crypt'
config.converter = Temporal::CryptConverter.new(
payload_converter: Temporal::Configuration::DEFAULT_CONVERTER
config.payload_codec = Temporal::Connection::Converter::Codec::Chain.new(
payload_codecs: [
Temporal::CryptPayloadCodec.new
]
)
end
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
require 'openssl'
require 'temporal/connection/converter/codec/base'

module Temporal
class CryptConverter < Temporal::Connection::Converter::Base
class CryptPayloadCodec < Temporal::Connection::Converter::Codec::Base
CIPHER = 'aes-256-gcm'.freeze
GCM_NONCE_SIZE = 12
GCM_TAG_SIZE = 16
Expand All @@ -10,26 +11,23 @@ class CryptConverter < Temporal::Connection::Converter::Base
METADATA_ENCODING_KEY = 'encoding'.freeze
METADATA_ENCODING = 'binary/encrypted'.freeze

def to_payloads(data)
def encode(payload)
return nil if payload.nil?

key_id = get_key_id
key = get_key(key_id)

payloads = super(data)

Temporalio::Api::Common::V1::Payloads.new(
payloads: payloads.payloads.map { |payload| encrypt_payload(payload, key_id, key) }
)
encrypt_payload(payload, key_id, key)
end

def decode(payload)
return nil if payload.nil?

def from_payloads(payloads)
return nil if payloads.nil?

payloads.payloads.map do |payload|
if payload.metadata[METADATA_ENCODING_KEY] == METADATA_ENCODING
payload = decrypt_payload(payload)
end
from_payload(payload)
if payload.metadata[METADATA_ENCODING_KEY] == METADATA_ENCODING
payload = decrypt_payload(payload)
end

payload
end

private
Expand Down
12 changes: 7 additions & 5 deletions examples/spec/integration/converter_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'workflows/hello_world_workflow'
require 'lib/cryptconverter'
require 'lib/crypt_payload_codec'
require 'grpc/errors'

describe 'Converter', :integration do
Expand All @@ -8,8 +8,10 @@

Temporal.configure do |config|
config.task_queue = 'crypt'
config.converter = Temporal::CryptConverter.new(
payload_converter: Temporal::Configuration::DEFAULT_CONVERTER
config.payload_codec = Temporal::Connection::Converter::Codec::Chain.new(
payload_codecs: [
Temporal::CryptPayloadCodec.new
]
)
end

Expand Down Expand Up @@ -65,8 +67,8 @@
completion_event = events[:EVENT_TYPE_WORKFLOW_EXECUTION_COMPLETED].first
result = completion_event.workflow_execution_completed_event_attributes.result

converter = Temporal.configuration.converter
payload_codec = Temporal.configuration.payload_codec

expect(converter.from_payloads(result)&.first).to eq('Hello World, Tom')
expect(payload_codec.decodes(result).payloads.first.data).to eq('"Hello World, Tom"')
end
end
23 changes: 21 additions & 2 deletions lib/temporal/concerns/payloads.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@ module Temporal
module Concerns
module Payloads
def from_payloads(payloads)
payloads = payload_codec.decodes(payloads)
payload_converter.from_payloads(payloads)
end

def from_payload(payload)
payload = payload_codec.decode(payload)
payload_converter.from_payload(payload)
end

def from_payload_map_without_codec(payload_map)
payload_map.map { |key, value| [key, payload_converter.from_payload(value)] }.to_h
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The abstraction is seeping through here a bit. Should this be named something like from_payload_map_without_codec? The call on search attributes would then be made outside of this file which is specific to performing various kinds of encoding.

end

def from_result_payloads(payloads)
from_payloads(payloads)&.first
end
Expand All @@ -30,11 +36,20 @@ def from_payload_map(payload_map)
end

def to_payloads(data)
payload_converter.to_payloads(data)
payloads = payload_converter.to_payloads(data)
payload_codec.encodes(payloads)
end

def to_payload(data)
payload_converter.to_payload(data)
payload = payload_converter.to_payload(data)
payload_codec.encode(payload)
end

def to_payload_map_without_codec(data)
# skips the payload_codec step because search attributes don't use this pipeline
data.transform_values do |value|
payload_converter.to_payload(value)
end
end

def to_result_payloads(data)
Expand Down Expand Up @@ -62,6 +77,10 @@ def to_payload_map(data)
def payload_converter
Temporal.configuration.converter
end

def payload_codec
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A comment at the top of this file or on this method explaining the difference between payload converters and payload codecs would be worthwhile. Or actually probably in configuration.rb where a user would see it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added to the configuration.rb, let me know what you think

Temporal.configuration.payload_codec
end
end
end
end
12 changes: 11 additions & 1 deletion lib/temporal/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
require 'temporal/connection/converter/payload/json'
require 'temporal/connection/converter/payload/proto_json'
require 'temporal/connection/converter/composite'
require 'temporal/connection/converter/codec/chain'

module Temporal
class Configuration
Connection = Struct.new(:type, :host, :port, :credentials, :identity, keyword_init: true)
Execution = Struct.new(:namespace, :task_queue, :timeouts, :headers, :search_attributes, keyword_init: true)

attr_reader :timeouts, :error_handlers
attr_accessor :connection_type, :converter, :use_error_serialization_v2, :host, :port, :credentials, :identity, :logger, :metrics_adapter, :namespace, :task_queue, :headers, :search_attributes, :header_propagators
attr_accessor :connection_type, :converter, :use_error_serialization_v2, :host, :port, :credentials, :identity, :logger, :metrics_adapter, :namespace, :task_queue, :headers, :search_attributes, :header_propagators, :payload_codec

# See https://docs.temporal.io/blog/activity-timeouts/ for general docs.
# We want an infinite execution timeout for cron schedules and other perpetual workflows.
Expand Down Expand Up @@ -45,6 +46,14 @@ class Configuration
Temporal::Connection::Converter::Payload::JSON.new
]
).freeze

# The Payload Codec is an optional step that happens between the wire and the Payload Converter:
# Temporal Server <--> Wire <--> Payload Codec <--> Payload Converter <--> User code
# which can be useful for transformations such as compression and encryption
# more info at https://docs.temporal.io/security#payload-codec
DEFAULT_PAYLOAD_CODEC = Temporal::Connection::Converter::Codec::Chain.new(
payload_codecs: []
).freeze

def initialize
@connection_type = :grpc
Expand All @@ -55,6 +64,7 @@ def initialize
@task_queue = DEFAULT_TASK_QUEUE
@headers = DEFAULT_HEADERS
@converter = DEFAULT_CONVERTER
@payload_codec = DEFAULT_PAYLOAD_CODEC
@use_error_serialization_v2 = false
@error_handlers = []
@credentials = :this_channel_is_insecure
Expand Down
35 changes: 35 additions & 0 deletions lib/temporal/connection/converter/codec/base.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
module Temporal
module Connection
module Converter
module Codec
class Base
def encodes(payloads)
return nil if payloads.nil?

Temporalio::Api::Common::V1::Payloads.new(
payloads: payloads.payloads.map(&method(:encode))
)
end

def decodes(payloads)
return nil if payloads.nil?

Temporalio::Api::Common::V1::Payloads.new(
payloads: payloads.payloads.map(&method(:decode))
)
end
Comment on lines +6 to +20
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would these be overridden by someone extending this class? Why not move these into payloads.rb?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they can be, I just was following the same pattern as in payloads.rb which seems to be define the same thing (from_payloads and to_payloads with logic then from_payload and to_payload are empty and required)

You probably are going to only override encode or decode but you have the option to override all for if the use case needs it.


def encode(payload)
# should return Temporalio::Api::Common::V1::Payload
raise NotImplementedError, 'codec converter needs to implement encode'
end

def decode(payload)
# should return Temporalio::Api::Common::V1::Payload
raise NotImplementedError, 'codec converter needs to implement decode'
end
end
end
end
end
end
36 changes: 36 additions & 0 deletions lib/temporal/connection/converter/codec/chain.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
require 'temporal/connection/converter/codec/base'

module Temporal
module Connection
module Converter
module Codec
# Performs encoding/decoding on the payloads via the given payload codecs. When encoding
# the codecs are applied last to first meaning the earlier encodings wrap the later ones.
# When decoding, the codecs are applied first to last to reverse the effect.
class Chain < Base
def initialize(payload_codecs:)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: This might be more ergonomic with a splat or non-keyword argument instead

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i agree, i was just keeping the same pattern as

def initialize(payload_converters:)
, what do you think?

@payload_codecs = payload_codecs
end

def encode(payload)
payload_codecs.reverse_each do |payload_codec|
payload = payload_codec.encode(payload)
end
payload
end

def decode(payload)
payload_codecs.each do |payload_codec|
payload = payload_codec.decode(payload)
end
payload
end

private

attr_reader :payload_codecs
end
end
end
end
end
4 changes: 2 additions & 2 deletions lib/temporal/connection/grpc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def start_workflow_execution(
fields: to_payload_map(memo || {})
),
search_attributes: Temporalio::Api::Common::V1::SearchAttributes.new(
indexed_fields: to_payload_map(search_attributes || {})
indexed_fields: to_payload_map_without_codec(search_attributes || {})
),
)

Expand Down Expand Up @@ -401,7 +401,7 @@ def signal_with_start_workflow_execution(
fields: to_payload_map(memo || {})
),
search_attributes: Temporalio::Api::Common::V1::SearchAttributes.new(
indexed_fields: to_payload_map(search_attributes || {})
indexed_fields: to_payload_map_without_codec(search_attributes || {})
),
)

Expand Down
2 changes: 1 addition & 1 deletion lib/temporal/connection/serializer/continue_as_new.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def serialize_memo(memo)
def serialize_search_attributes(search_attributes)
return unless search_attributes

Temporalio::Api::Common::V1::SearchAttributes.new(indexed_fields: to_payload_map(search_attributes))
Temporalio::Api::Common::V1::SearchAttributes.new(indexed_fields: to_payload_map_without_codec(search_attributes))
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/temporal/connection/serializer/start_child_workflow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def serialize_parent_close_policy(parent_close_policy)
def serialize_search_attributes(search_attributes)
return unless search_attributes

Temporalio::Api::Common::V1::SearchAttributes.new(indexed_fields: to_payload_map(search_attributes))
Temporalio::Api::Common::V1::SearchAttributes.new(indexed_fields: to_payload_map_without_codec(search_attributes))
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def to_proto
upsert_workflow_search_attributes_command_attributes:
Temporalio::Api::Command::V1::UpsertWorkflowSearchAttributesCommandAttributes.new(
search_attributes: Temporalio::Api::Common::V1::SearchAttributes.new(
indexed_fields: to_payload_map(object.search_attributes || {})
indexed_fields: to_payload_map_without_codec(object.search_attributes || {})
),
)
)
Expand Down
11 changes: 6 additions & 5 deletions lib/temporal/workflow/execution_info.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

module Temporal
class Workflow
class ExecutionInfo < Struct.new(:workflow, :workflow_id, :run_id, :start_time, :close_time, :status, :history_length, :memo, :search_attributes, keyword_init: true)
class ExecutionInfo < Struct.new(:workflow, :workflow_id, :run_id, :start_time, :close_time, :status,
:history_length, :memo, :search_attributes, keyword_init: true)
extend Concerns::Payloads

STATUSES = [
Expand All @@ -13,11 +14,11 @@ class ExecutionInfo < Struct.new(:workflow, :workflow_id, :run_id, :start_time,
Temporal::Workflow::Status::CANCELED,
Temporal::Workflow::Status::TERMINATED,
Temporal::Workflow::Status::CONTINUED_AS_NEW,
Temporal::Workflow::Status::TIMED_OUT,
Temporal::Workflow::Status::TIMED_OUT
]

def self.generate_from(response)
search_attributes = response.search_attributes.nil? ? {} : self.from_payload_map(response.search_attributes.indexed_fields)
search_attributes = response.search_attributes.nil? ? {} : from_payload_map_without_codec(response.search_attributes.indexed_fields)
new(
workflow: response.type.name,
workflow_id: response.execution.workflow_id,
Expand All @@ -26,8 +27,8 @@ def self.generate_from(response)
close_time: response.close_time&.to_time,
status: Temporal::Workflow::Status::API_STATUS_MAP.fetch(response.status),
history_length: response.history_length,
memo: self.from_payload_map(response.memo.fields),
search_attributes: search_attributes,
memo: from_payload_map(response.memo.fields),
search_attributes: search_attributes
).freeze
end

Expand Down
2 changes: 1 addition & 1 deletion proto
Submodule proto updated 45 files
+9 −2 .buildkite/Dockerfile
+1 −1 .buildkite/pipeline.yml
+1 −1 .github/CODEOWNERS
+6 −2 .github/PULL_REQUEST_TEMPLATE.md
+0 −29 .github/workflows/trigger-api-go-update.yml
+1 −2 .gitignore
+13 −15 Makefile
+0 −2 api-linter.yaml
+9 −6 buf.yaml
+0 −7 build/go.mod
+0 −5 build/go.sum
+0 −29 build/tools.go
+0 −6 go.mod
+0 −89 temporal/api/batch/v1/message.proto
+16 −72 temporal/api/command/v1/message.proto
+3 −21 temporal/api/common/v1/message.proto
+0 −47 temporal/api/enums/v1/batch_operation.proto
+2 −4 temporal/api/enums/v1/command_type.proto
+3 −4 temporal/api/enums/v1/common.proto
+2 −18 temporal/api/enums/v1/event_type.proto
+2 −51 temporal/api/enums/v1/failed_cause.proto
+2 −8 temporal/api/enums/v1/namespace.proto
+2 −2 temporal/api/enums/v1/query.proto
+0 −41 temporal/api/enums/v1/reset.proto
+0 −60 temporal/api/enums/v1/schedule.proto
+2 −15 temporal/api/enums/v1/task_queue.proto
+0 −56 temporal/api/enums/v1/update.proto
+9 −25 temporal/api/enums/v1/workflow.proto
+6 −44 temporal/api/errordetails/v1/message.proto
+2 −20 temporal/api/failure/v1/message.proto
+2 −2 temporal/api/filter/v1/message.proto
+23 −325 temporal/api/history/v1/message.proto
+2 −23 temporal/api/namespace/v1/message.proto
+0 −124 temporal/api/operatorservice/v1/request_response.proto
+0 −80 temporal/api/operatorservice/v1/service.proto
+0 −57 temporal/api/protocol/v1/message.proto
+2 −13 temporal/api/query/v1/message.proto
+2 −16 temporal/api/replication/v1/message.proto
+0 −379 temporal/api/schedule/v1/message.proto
+2 −28 temporal/api/taskqueue/v1/message.proto
+0 −111 temporal/api/update/v1/message.proto
+2 −2 temporal/api/version/v1/message.proto
+2 −42 temporal/api/workflow/v1/message.proto
+9 −593 temporal/api/workflowservice/v1/request_response.proto
+104 −235 temporal/api/workflowservice/v1/service.proto
Loading