Skip to content

Commit

Permalink
statemachine: purge unused state, fix statemachine docs
Browse files Browse the repository at this point in the history
  • Loading branch information
joelrebel committed May 4, 2023
1 parent 342794f commit fd345f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion internal/statemachine/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const (
// state for failed actions
StateActionFailed sw.State = model.StateFailed

// transition for completed actions
// transition for successful actions
TransitionTypeActionSuccess sw.TransitionType = "succeeded"
// transition for failed actions
TransitionTypeActionFailed sw.TransitionType = "failed"
Expand Down
15 changes: 5 additions & 10 deletions internal/statemachine/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,8 @@ func NewTaskStateMachine(handler TaskTransitioner) (*TaskStateMachine, error) {

func (m *TaskStateMachine) addDocumentation() {
m.sm.DescribeState(model.StatePending, sw.StateDoc{
Name: "Requested",
Description: "In this state the task has been requested (this is done outside of the state machine).",
})

m.sm.DescribeState(model.StatePending, sw.StateDoc{
Name: "Queued",
Description: "In this state the task is being initialized (this is done outside of the state machine).",
Name: "Pending",
Description: "In this state the task is being initialized.",
})

m.sm.DescribeState(model.StateActive, sw.StateDoc{
Expand All @@ -248,7 +243,7 @@ func (m *TaskStateMachine) addDocumentation() {
})

m.sm.DescribeState(model.StateSucceeded, sw.StateDoc{
Name: "Success",
Name: "Succeeded",
Description: "In this state the task execution has completed successfully.",
})

Expand All @@ -269,12 +264,12 @@ func (m *TaskStateMachine) addDocumentation() {

m.sm.DescribeTransitionType(TransitionTypeTaskFail, sw.TransitionTypeDoc{
Name: string(TransitionTypeTaskFail),
Description: "In this transition the task has failed and any post failure steps are being executed.",
Description: "In this transition the task has failed and any post-failure steps are being executed.",
})

m.sm.DescribeTransitionType(TransitionTypeTaskSuccess, sw.TransitionTypeDoc{
Name: string(TransitionTypeTaskSuccess),
Description: "In this transition the task has completed successfully and any post failure steps are being executed.",
Description: "In this transition the task has completed successfully and any post-success steps are executed.",
})
}

Expand Down

0 comments on commit fd345f1

Please sign in to comment.