-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
chore: Introduce WorkflowPhase
#4856
Conversation
Signed-off-by: Alex Collins <alex_collins@intuit.com>
Signed-off-by: Alex Collins <alex_collins@intuit.com>
Signed-off-by: Alex Collins <alex_collins@intuit.com>
Signed-off-by: Alex Collins <alex_collins@intuit.com>
Signed-off-by: Alex Collins <alex_collins@intuit.com>
Signed-off-by: Alex Collins <alex_collins@intuit.com>
WorkflowError WorkflowPhase = "Error" | ||
) | ||
|
||
func (p WorkflowPhase) Completed() bool { |
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.
Should this be fulfilled?
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.
I'm not sure either fulfilled or complete should apply to the workflows phase at all. The source of truth is the label. Phase and conditions are just copies of this information.
Signed-off-by: Alex Collins <alex_collins@intuit.com>
Signed-off-by: Alex Collins <alex_collins@intuit.com>
Signed-off-by: Alex Collins <alex_collins@intuit.com>
|
||
export const WorkflowPhases: NodePhase[] = ['Pending', 'Running', 'Succeeded', 'Failed', 'Error']; | ||
export type NodePhase = '' | 'Pending' | 'Running' | 'Succeeded' | 'Skipped' | 'Failed' | 'Error' | 'Omitted'; |
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, update was needed here
workflowStatus := map[wfv1.NodePhase]wfv1.WorkflowPhase{ | ||
wfv1.NodePending: wfv1.WorkflowPending, | ||
wfv1.NodeRunning: wfv1.WorkflowRunning, | ||
wfv1.NodeSucceeded: wfv1.WorkflowSucceeded, | ||
wfv1.NodeSkipped: wfv1.WorkflowSucceeded, | ||
wfv1.NodeFailed: wfv1.WorkflowFailed, | ||
wfv1.NodeError: wfv1.WorkflowError, | ||
wfv1.NodeOmitted: wfv1.WorkflowSucceeded, | ||
}[node.Phase] |
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.
Perhaps extract this to a function? Could potentially be useful elsewhere
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.
I will do that - I can add a test then
Signed-off-by: Alex Collins <alex_collins@intuit.com>
Signed-off-by: Alex Collins <alex_collins@intuit.com>
Signed-off-by: Alex Collins <alex_collins@intuit.com>
Signed-off-by: Alex Collins alex_collins@intuit.com
Checklist: