feat(activity): Standalone Activities operator commands - #2400
feat(activity): Standalone Activities operator commands#2400maciejdudko wants to merge 4 commits into
Conversation
| * | ||
| * Returns current options after applying the update. | ||
| */ | ||
| updateOptions(options?: ActivityOptionsUpdate): Promise<ActivityOptionsUpdate>; |
There was a problem hiding this comment.
this says the options are optional but line 302 requires them
|
|
||
| const originalOptions = await handle.restoreOriginalOptions(); | ||
| t.is(originalOptions.taskQueue, 'original-task-queue'); | ||
| t.is(updatedOptions.scheduleToCloseTimeout, undefined); |
There was a problem hiding this comment.
should updatedOptions be originalOptions here?
| }); | ||
| return activityOptionsUpdateFromProto(resp.activityOptions); | ||
| } catch (err) { | ||
| this.rethrowGrpcError(err, 'Failed to request activity cancellation'); |
There was a problem hiding this comment.
I don't think this is the correct error message... maybe something like "failed to restore activity options?"
| }); | ||
| return activityOptionsUpdateFromProto(resp.activityOptions); | ||
| } catch (err) { | ||
| this.rethrowGrpcError(err, 'Failed to request activity cancellation'); |
There was a problem hiding this comment.
I don't think this is the correct error message... maybe something like "failed to update activity options?"
| * Specifies activity options to change in {@link ActivityHandle.updateOptions} operation. | ||
| * | ||
| * If a field is assigned non-null value, the option will be set to that value. | ||
| * If a field is explicitly assigned null, the option will be cleared. | ||
| * If a field is undefined, the option will be left unchanged. | ||
| * | ||
| * In a return value, currently unset fields are undefined. | ||
| * | ||
| * @experimental Standalone Activities are experimental. APIs may be subject to change. | ||
| */ | ||
| export interface ActivityOptionsUpdate { |
There was a problem hiding this comment.
This is also the return type for the calls that update the options which makes things a little unclear to me. Does an undefined in the return type mean the option was left unchanged or that it is actually undefined? I think the doc comment might be misleading for this when it is being used as a return type. How do you feel about separating the input and return type into two different types?
What was changed
Added operator commands
pause,unpause,updateOptionsandrestoreOriginalOptionstoActivityHandle.Why?
Feature request: temporalio/features#822
Checklist
Closes [Feature Request] Implement operator commands for Standalone Activities #2061
How was this tested:
New tests in
test-standalone-activities.cloud-pending.ts