Skip to content

Conversation

dandavison
Copy link
Contributor

@dandavison dandavison commented Jul 11, 2024

Fixes #778

  • Previously, core was truncating commands received from lang at the first terminal command.
  • With this PR, if there are terminal commands, we remove them all and replace the first one at the end of the command sequence.

Evidence this is correct

  • unit tests added for new and old logic
  • TODO: add tests of replay / flag logic to core
  • Honor all non-completion commands sdk-python#569 uses these changes and contains tests demonstrating that update completions are now honored, even when after workflow completion.

@dandavison dandavison force-pushed the reorder-commands branch 2 times, most recently from 581ee86 to f8af5e7 Compare July 15, 2024 11:07
@dandavison dandavison changed the title WIP: process all non-terminal commands Honor all non-terminal commands Jul 15, 2024
@dandavison dandavison force-pushed the reorder-commands branch 4 times, most recently from 7de4dfd to 1d2cfc0 Compare July 15, 2024 13:41
@dandavison dandavison marked this pull request as ready for review July 15, 2024 20:06
@dandavison dandavison requested a review from a team as a code owner July 15, 2024 20:06
Copy link
Member

@Sushisource Sushisource left a comment

Choose a reason for hiding this comment

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

Looking good to me. Just needs the unit tests to test dealing with flag being present or not in old history, and integ test like you said.

@dandavison dandavison force-pushed the reorder-commands branch 6 times, most recently from f333634 to 87ac411 Compare July 17, 2024 23:09
Copy link
Member

@Sushisource Sushisource left a comment

Choose a reason for hiding this comment

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

Thanks Dan!

async fn _do_post_terminal_commands_test(
commands_sent_by_lang: Vec<workflow_command::Variant>,
response_types: impl IntoIterator<Item = impl Into<ResponseType>>,
expected_command_types: Option<Vec<CommandType>>,
Copy link
Member

Choose a reason for hiding this comment

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

nit: Doesn't need to be an option, can just be empty vec when None

Copy link
Contributor Author

@dandavison dandavison Jul 21, 2024

Choose a reason for hiding this comment

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

I think option is a reasonable choice: None is being used to mean the concept of expected commands is irrelevant, since the worker is purely replaying all history and will never emit a WFT task response; that's as opposed to Some(empty_vec) which would mean SDK did a non-replay WFT but replied without any commands (e.g. all coroutines are blocked on a workflow condition; also WFT fail might be represented like that). But lmk if that doesn't make sense; happy to change if so.

@dandavison dandavison force-pushed the reorder-commands branch 2 times, most recently from 8ba0fd7 to 24d23a8 Compare July 21, 2024 11:59
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.

Honor all non-terminal commands

2 participants