Skip to content

Conversation

@gow
Copy link
Contributor

@gow gow commented May 6, 2025

What changed?

This PR adds PostResetOperation support to reset API. With this we will be performing certain operations after reset. In this PR

  • Added support for performing workflow options update.
  • Updated WorkflowResetter interface.
  • Added functional test

Why?

Developers/Operators often want to perform certain operations soon after resetting a workflow. Ex: updating worker version, sending signal to workflow etc. These operations need to be performed atomically along with the reset operation.

How did you test it?

  • built
  • run locally and tested manually
  • covered by existing tests
  • added new unit test(s)
  • added new functional test(s)

@gow gow requested a review from a team as a code owner May 6, 2025 23:01
@gow gow marked this pull request as draft May 6, 2025 23:01
@gow gow force-pushed the cg/reset_move_version branch 3 times, most recently from c059a09 to 580dc8a Compare May 8, 2025 19:00
@gow gow force-pushed the cg/reset_move_version branch from 580dc8a to 863ae65 Compare May 9, 2025 03:46
@gow gow marked this pull request as ready for review May 9, 2025 19:28
@gow gow requested review from carlydf and yycptt May 9, 2025 19:29
Copy link
Member

@yycptt yycptt left a comment

Choose a reason for hiding this comment

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

LGTM.

I think this only works with state based replication though, at least the atomicity part of it. cc @yux0 @xwduan

Ideally we should have a xdc test for this as well.

@gow
Copy link
Contributor Author

gow commented May 14, 2025

Merging this for now.

@gow gow merged commit 49f1797 into main May 14, 2025
53 checks passed
@gow gow deleted the cg/reset_move_version branch May 14, 2025 19:18
gow added a commit to temporalio/cli that referenced this pull request Jul 9, 2025
<!--- Note to EXTERNAL Contributors -->
<!-- Thanks for opening a PR! 
If it is a significant code change, please **make sure there is an open
issue** for this.
We work best with you when we have accepted the idea first before you
code. -->

<!--- For ALL Contributors 👇 -->

## What was changed
Added reset subcommands so that we can do reset + update version info
atomically in one operation. The server changes were made in
temporalio/temporal#7719. This is the CLI
counterpart.

To allow subcommands we added a new flag `subcommands-optional`. When
this flag is present a parent command can be run in isolation without
any subcommands (i.e subcommands will be optional)

## Why?
So that we can reset + update_version at the same time.

## Checklist
<!--- add/delete as needed --->

1. Closes: <!-- add issue number here --> N/A

2. How was this tested:
Added tests + manually tested

3. Any docs updates needed?
N/A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants