Skip to content
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

Workflow update client API refactor #1489

Merged

Conversation

Quinn-With-Two-Ns
Copy link
Contributor

@Quinn-With-Two-Ns Quinn-With-Two-Ns commented May 24, 2024

This PR makes multiple changes to the client experience around update:

  • Merge UpdateWorkflowWithOptions and UpdateWorkflow to a single api
  • Makes WaitForStage a required parameter in update
  • Create a Go SDK enum for update lifecyle
  • Updated start update polling to poll until stage reached or ACCEPTED. If more polling needed, switches to result polling.

closes #1414
closes #1449
closes #1411

since this has multiple breaking changes feature tests are expected to fail until I make a separate branch

@Quinn-With-Two-Ns Quinn-With-Two-Ns changed the title Update refactor Update client API refactor May 24, 2024
@Quinn-With-Two-Ns Quinn-With-Two-Ns changed the title Update client API refactor Workflow update client API refactor May 24, 2024
@Quinn-With-Two-Ns Quinn-With-Two-Ns marked this pull request as ready for review May 24, 2024 05:02
@Quinn-With-Two-Ns Quinn-With-Two-Ns requested a review from a team as a code owner May 24, 2024 05:02
client/client.go Outdated
// directly from this function call.
// NOTE: Experimental
UpdateWorkflowWithOptions(ctx context.Context, request *UpdateWorkflowWithOptionsRequest) (WorkflowUpdateHandle, error)
UpdateWorkflow(ctx context.Context, request *UpdateWorkflowOptionsRequest) (WorkflowUpdateHandle, error)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
UpdateWorkflow(ctx context.Context, request *UpdateWorkflowOptionsRequest) (WorkflowUpdateHandle, error)
UpdateWorkflow(ctx context.Context, options UpdateWorkflowOptions) (WorkflowUpdateHandle, error)

Wonder if it is a "request" or "options", and since it will always be required, probably not value in accepting a pointer (I know we are inconsistent here). Even if it is a "request", then can probably remove the word "Options" from within. I don't have strong opinions here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah i think we used request since that is what QueryWorkflowWithOptions did. I can change it to not take a pointer.

Copy link
Member

Choose a reason for hiding this comment

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

👍 I can see arguments for both Request and Options for the value of X in UpdateWorkflowX, but probably don't need both. (I have no strong opinion on which, I kinda like "options" but it's a very weak preference, your choice)

internal/internal_workflow_client.go Outdated Show resolved Hide resolved
@Quinn-With-Two-Ns Quinn-With-Two-Ns merged commit bcfa85a into temporalio:master May 28, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants