-
Notifications
You must be signed in to change notification settings - Fork 5
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
Set `State["PreviousStateGuid"] in StateHistory #208
Conversation
9b7c8a4
to
1ca465c
Compare
lib/floe/workflow.rb
Outdated
|
||
return unless context.next_state | ||
|
||
next_state = {"Name" => context.next_state, "PreviousStateGuid" => context.state["Guid"]} |
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.
Nice. Introducing next_state
removes that restore_values
which was a little confusing.
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.
Do you want to have Guid
a Workflow
concept?
diff --git a/lib/floe/workflow.rb b/lib/floe/workflow.rb
index c7d5b37..68ee848 100644
--- a/lib/floe/workflow.rb
+++ b/lib/floe/workflow.rb
@@ -167,2 +167,3 @@ module Floe
context.state["Input"] = context.execution["Input"].dup
+ context.state["Guid"] = SecureRandom.uuid
context.execution["StartTime"] = Time.now.utc.iso8601
@@ -180,3 +181,3 @@ module Floe
def step!
- next_state = {"Name" => context.next_state, "PreviousStateGuid" => context.state["Guid"]}
+ next_state = {"Name" => context.next_state, "Guid" => SecureRandom.uuid, "PreviousStateGuid" => context.state["Guid"]}
diff --git a/lib/floe/workflow/state.rb b/lib/floe/workflow/state.rb
index a44b584..c757f97 100644
--- a/lib/floe/workflow/state.rb
+++ b/lib/floe/workflow/state.rb
@@ -55,3 +55,2 @@ module Floe
def start(_input)
- context.state["Guid"] = SecureRandom.uuid
context.state["EnteredTime"] = Time.now.utc.iso8601
This will work great after #211 |
1ca465c
to
eeb0592
Compare
7d16a4b
to
d603530
Compare
d603530
to
03140e1
Compare
Checked commits agrare/floe@ab26e1d~...03140e1 with ruby 2.7.8, rubocop 1.56.3, haml-lint 0.51.0, and yamllint |
Fixed - ResultPath=$ replaces complete output (#199) - Fix retrier backoff values (#200) - Fix Retry issues (#202) - Add Apache-2.0 license (#217) Changed - Update gemspec summary (#205) - Simpler State#long_name (#204) - State only modifies Context#state - prep for Map/Parallel (#206) - Set StateHistory in Workflow not State (#211) - Make Runner#wait optional (#190) - Pass credentials around with context (#203) - Pass context to State without workflow (#216) - Move the guts of the CLI into a class for easy testing (#220) Added - Set State PreviousStateGuid in StateHistory (#208) - Add a codeclimate config file (#224) - Add an Execution unique ID to Context (#226)
Make the state history more obvious by including the exact previous state Guid in the StateHistory