ManageIQ / floe

Floe is a runner for Amazon States Language workflows
Apache License 2.0
0 stars 5 forks source link

Set `State["PreviousStateGuid"] in StateHistory #208

Closed agrare closed 2 months ago

agrare commented 3 months ago

Make the state history more obvious by including the exact previous state Guid in the StateHistory

[{"Name"=>"FirstState",
  "Input"=>{"foo"=>1},
  "Guid"=>"b0f264bb-663e-4b6a-9034-e79b9b9d0c5a",
  "EnteredTime"=>"2024-06-06T18:55:19Z",
  "Output"=>{"foo"=>1},
  "NextState"=>"ChoiceState",
  "FinishedTime"=>"2024-06-06T18:55:19Z",
  "Duration"=>0.416348275},
 {"Name"=>"ChoiceState",
  "PreviousStateGuid"=>"b0f264bb-663e-4b6a-9034-e79b9b9d0c5a",
  "Guid"=>"cf1d9b27-5453-4ef6-880e-3282ccb604d3",
  "Input"=>{"foo"=>1},
  "EnteredTime"=>"2024-06-06T18:55:19Z",
  "NextState"=>"FirstMatchState",
  "Output"=>{"foo"=>1},
  "FinishedTime"=>"2024-06-06T18:55:19Z",
  "Duration"=>0.487305373},
 {"Name"=>"FirstMatchState",
  "PreviousStateGuid"=>"cf1d9b27-5453-4ef6-880e-3282ccb604d3",
  "Guid"=>"6f9703ad-7ee2-43e1-b7f3-d4bd26c00055",
  "Input"=>{"foo"=>1},
  "EnteredTime"=>"2024-06-06T18:55:19Z",
  "Output"=>{"foo"=>1},
  "NextState"=>"PassState",
  "FinishedTime"=>"2024-06-06T18:55:19Z",
  "Duration"=>0.74080356}
kbrock commented 2 months ago

This will work great after #211 Or sneak into 211 - your choice.

miq-bot commented 2 months ago

Checked commits https://github.com/agrare/floe/compare/ab26e1dc7b03c9f77c47a2f16686d0cde4929ce0~...03140e149028eb4a56152687f51c8d4df9ecefe1 with ruby 2.7.8, rubocop 1.56.3, haml-lint 0.51.0, and yamllint 2 files checked, 0 offenses detected Everything looks fine. :star: