-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Update-with-Start returns closed workflow's Outcome #7656
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
Conversation
baa817e
to
f6062ca
Compare
f6062ca
to
5a6112c
Compare
&historyservice.StartWorkflowExecutionResponse{ | ||
RunId: workflowKey.RunID, | ||
Started: false, // set explicitly for emphasis | ||
// TODO: Running: false, |
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.
This requires an API change.
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 guess you need to rename it to status
here too but as soon as it is just a comment it doesn't really matter.
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'll save the planet by not pushing the comment update now; and will fix it in the next PR.
return runningWorkflowLease, nil | ||
} | ||
|
||
func (mo *multiOp) allowUpdateWorkflow( | ||
ctx context.Context, |
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.
Unused.
5a6112c
to
8a7be4d
Compare
s.NoError(uwsRes.err) | ||
startResp := uwsRes.response.Responses[0].GetStartWorkflow() | ||
updateRep := uwsRes.response.Responses[1].GetUpdateWorkflow() | ||
s.False(startResp.Started) |
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.
Don't forget to assert on new status
field here after you add it.
&historyservice.StartWorkflowExecutionResponse{ | ||
RunId: workflowKey.RunID, | ||
Started: false, // set explicitly for emphasis | ||
// TODO: Running: false, |
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 guess you need to rename it to status
here too but as soon as it is just a comment it doesn't really matter.
_**READ BEFORE MERGING:** All PRs require approval by both Server AND SDK teams before merging! This is why the number of required approvals is "2" and not "1"--two reviewers from the same team is NOT sufficient. If your PR is not approved by someone in BOTH teams, it may be summarily reverted._ <!-- Describe what has changed in this PR --> **What changed?** Added field `WorkflowExecutionStatus status` to `StartWorkflowExecutionResponse`. <!-- Tell your future self why have you made these changes --> **Why?** To align Update-with-Start's behavior with a regular Update. A regular Update returns its outcome from a closed Workflow, to make Update-with-Start do the same thing, it needs to returns a successful response in that case. But that would tell the user that a running Workflow exists. To help the user distinguish whether UwS operated on a closed or running workflow, this field is introduced. <!-- Are there any breaking changes on binary or code level? --> **Breaking changes** No. <!-- If this breaks the Server, please provide the Server PR to merge right after this PR was merged. --> **Server PR** temporalio/temporal#7656
_**READ BEFORE MERGING:** All PRs require approval by both Server AND SDK teams before merging! This is why the number of required approvals is "2" and not "1"--two reviewers from the same team is NOT sufficient. If your PR is not approved by someone in BOTH teams, it may be summarily reverted._ <!-- Describe what has changed in this PR --> **What changed?** Added field `WorkflowExecutionStatus status` to `StartWorkflowExecutionResponse`. <!-- Tell your future self why have you made these changes --> **Why?** To align Update-with-Start's behavior with a regular Update. A regular Update returns its outcome from a closed Workflow, to make Update-with-Start do the same thing, it needs to returns a successful response in that case. But that would tell the user that a running Workflow exists. To help the user distinguish whether UwS operated on a closed or running workflow, this field is introduced. <!-- Are there any breaking changes on binary or code level? --> **Breaking changes** No. <!-- If this breaks the Server, please provide the Server PR to merge right after this PR was merged. --> **Server PR** temporalio/temporal#7656
StartWorkflowExecutionResponse
API needs to have a new fieldRunning
added to it.What changed?
When UwS is applied to a closes Workflow where the requested Update (identified by its Update ID) has already been completed, return the Update outcome.
Note that this only applies to the current execution; not any previous execution.
Why?
Align UwS behavior with Update; a regular Update also returns its outcome from a closed Workflow.
How did you test it?
New tests.
Potential risks
Documentation
Is hotfix candidate?