-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add command for workflow update #200
Add command for workflow update #200
Conversation
FlagUpdateHandlerName = "Update handler Name" | ||
FlagUpdateHandlerInput = "Args for the Update handler. Formatted in JSON." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gofmt
reformatted the whole file; these are the new additions.
workflow/workflow.go
Outdated
{ | ||
Name: "update", | ||
Usage: common.UpdateWorkflowDefinition, | ||
UsageText: common.WorkflowUpdateUsageText, | ||
Flags: append(common.FlagsForExecution, | ||
&cli.StringFlag{ | ||
Name: common.FlagUpdateWaitPolicy, | ||
Usage: "Wait policy determines how long the client should wait for a return value from the server:" + strings.Join(mapKeysToArray(updateWaitPolicyMap), ", "), | ||
Category: common.CategoryMain, | ||
Required: true, | ||
}, | ||
&cli.StringFlag{ | ||
Name: common.FlagName, | ||
Usage: common.FlagUpdateHandlerName, | ||
Required: true, | ||
Category: common.CategoryMain, | ||
}, | ||
&cli.StringFlag{ | ||
Name: common.FlagInput, | ||
Aliases: common.FlagInputAlias, | ||
Usage: common.FlagUpdateHandlerInput, | ||
Category: common.CategoryMain, | ||
}, | ||
&cli.StringFlag{ | ||
Name: common.FlagUpdateFirstExecutionRunID, | ||
Usage: "Do not run update if workflow exectuion (--run-id or if not set, latest workflow execution) is not part of the same execution chain as this id.", | ||
Category: common.CategoryMain, | ||
}, | ||
), | ||
Action: func(c *cli.Context) error { | ||
return UpdateWorkflow(c) | ||
}, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gofmt
reformatted the file, here is the new addition.
a4af667
to
f68dcdf
Compare
Co-authored-by: Roey Berman <roey.berman@gmail.com>
Co-authored-by: Roey Berman <roey.berman@gmail.com>
c5f5ba6
to
60f35e8
Compare
Co-authored-by: Michael Snowden <MichaelSnowden@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM pending comments
//TODO: remove this flag when update workflow is enabled in the server by default | ||
"--dynamic-config-value", "frontend.enableUpdateWorkflowExecution=true", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this should be enabled here. Let it rely on default value.
What was changed
Added 'workflow update' command to update workflows.
Why?
There is a new feature to update workflows synchronously: temporalio/temporal#3822
This change adds a command to the client to call that API.
Checklist
How was this tested:
Tested locally.
Any docs updates needed?
The "workflow" section of CLI doc should be updated: https://docs.temporal.io/cli/workflow