[DO NOT MERGE] Implement operator commands for Standalone Activities - #543
[DO NOT MERGE] Implement operator commands for Standalone Activities#543GregoryTravis wants to merge 38 commits into
Conversation
…e + bridge updates) # Conflicts: # temporalio/ext/sdk-core # temporalio/lib/temporalio/api/enums/v1/failed_cause.rb # temporalio/lib/temporalio/api/namespace/v1/message.rb # temporalio/lib/temporalio/api/workflowservice/v1/request_response.rb # temporalio/sig/temporalio/api/enums/v1/failed_cause.rbs
…in + api overlay + api-adapter fixups), Cargo.lock regenerated, pin Ruby 3.3.11
|
SAA-OC-Tracking seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
1 similar comment
|
SAA-OC-Tracking seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
chris-olszewski
left a comment
There was a problem hiding this comment.
Largest concern is the update_options API
| @@ -0,0 +1 @@ | |||
| 3.3.11 | |||
There was a problem hiding this comment.
Removed; this was part of tracking upstream server changes (and working around a CI segfault) and should have been removed before the PR.
|
|
||
| See https://docs.temporal.io/standalone-activity for the cross-SDK feature overview. | ||
|
|
||
| #### Standalone Activity operator commands |
There was a problem hiding this comment.
This is in the wrong section of the changelog
There was a problem hiding this comment.
Was there a reason/need for updating the Rust lockfile? I don't see any bridge changes
There was a problem hiding this comment.
Removed; this was part of tracking upstream server changes (and working around a CI segfault) and should have been removed before the PR.
| def update_options( | ||
| task_queue: UNSET, | ||
| schedule_to_close_timeout: UNSET, | ||
| schedule_to_start_timeout: UNSET, | ||
| start_to_close_timeout: UNSET, | ||
| heartbeat_timeout: UNSET, | ||
| retry_policy: UNSET, | ||
| priority: UNSET, | ||
| start_delay: UNSET, | ||
| restore_original: false, | ||
| rpc_options: nil | ||
| ) |
There was a problem hiding this comment.
I'm really not sold on this approach to distinguishing clearing a value compared to not updating it. UNSET will be visible as the default for users, but not the declaration/existence in the YARD documentation. Also, to me UNSET reads as "unsetting" the value. I think either UNDEFINED or NOT_SET would be better along with making the value public.
There's a similar design problem for search attribute updates that we resolved by having an explicit Update class, but that doesn't map super well here since these are real attributes and not just user chosen names. We could get away with **kwargs inspection directly, but that might make for less useful docs/autocomplete. It is a pattern used by Rails for partial updates so not outlandish to use here.
There was a problem hiding this comment.
Used kwargs inspection.
There was a problem hiding this comment.
I think we need to provide signatures for update_options
There was a problem hiding this comment.
Added, and also added a bunch more missing types.
| # execution_time is populated by the server (api#807 + temporal#11017); without start_delay | ||
| # it should be at or near schedule_time. | ||
| refute_nil desc.execution_time | ||
| assert_in_delta desc.schedule_time.to_f, desc.execution_time.to_f, 1.0 |
There was a problem hiding this comment.
Would this assertion capture an SDK bug, isn't this server behavior?
There was a problem hiding this comment.
Yes, removed.
| # unpause carries the reason, jitter, and an auto-generated dedup request_id (api#844). | ||
| unpause_req = captured.fetch(:unpause) | ||
| assert_equal 'go', unpause_req.reason | ||
| assert_equal 5, unpause_req.jitter.seconds | ||
| assert_equal 0, unpause_req.jitter.nanos | ||
| refute_empty unpause_req.request_id | ||
|
|
||
| # reset carries jitter and an auto-generated dedup request_id (api#844). | ||
| reset_req = captured.fetch(:reset) | ||
| assert_equal 2, reset_req.jitter.seconds | ||
| assert_equal 0, reset_req.jitter.nanos | ||
| refute_empty reset_req.request_id | ||
|
|
||
| # update_options carries an auto-generated dedup request_id (api#844). |
There was a problem hiding this comment.
All of these references to the specific API PR that introduced these fields feels unnecessary
There was a problem hiding this comment.
Removed, the assertions are self-explanatory.
Implement operator commands for standalone activities
Adds pause, unpause, reset, and update-options to standalone activities, plus
the describe surface needed to observe their effects.
Standalone activities already supported start, result, describe, cancel, and
terminate. This adds the four operator commands the server exposes for them, so
an operator can hold, resume, restart, and retune a running activity without
going through a workflow.
Describe: payload fields are opt-in
DescribeActivityExecutionRequestgates four payload-bearing fields behindper-call flags (api#792). All four are now plumbed through
describeanddefault to false.