Skip to content
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

Merged
merged 12 commits into from Jan 21, 2021
Merged

chore: Introduce WorkflowPhase #4856

merged 12 commits into from Jan 21, 2021

Conversation

alexec
Copy link
Contributor

@alexec alexec commented Jan 11, 2021

Signed-off-by: Alex Collins alex_collins@intuit.com

Checklist:

Signed-off-by: Alex Collins <alex_collins@intuit.com>
@alexec alexec linked an issue Jan 11, 2021 that may be closed by this pull request
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>
@alexec alexec marked this pull request as ready for review January 11, 2021 20:36
WorkflowError WorkflowPhase = "Error"
)

func (p WorkflowPhase) Completed() bool {
Copy link
Member

Choose a reason for hiding this comment

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

Should this be fulfilled?

Copy link
Contributor Author

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.

@alexec alexec closed this Jan 14, 2021
@alexec alexec deleted the workflow-phase branch January 14, 2021 16:18
@alexec alexec restored the workflow-phase branch January 14, 2021 16:22
@alexec alexec reopened this Jan 14, 2021
@alexec alexec marked this pull request as draft January 14, 2021 16:45
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>
@alexec alexec marked this pull request as ready for review January 19, 2021 20:28
@simster7 simster7 self-assigned this Jan 20, 2021

export const WorkflowPhases: NodePhase[] = ['Pending', 'Running', 'Succeeded', 'Failed', 'Error'];
export type NodePhase = '' | 'Pending' | 'Running' | 'Succeeded' | 'Skipped' | 'Failed' | 'Error' | 'Omitted';
Copy link
Member

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

Comment on lines +363 to +371
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]
Copy link
Member

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

Copy link
Contributor Author

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>
@alexec alexec merged commit 957ef67 into argoproj:master Jan 21, 2021
@alexec alexec deleted the workflow-phase branch January 21, 2021 01:49
This was referenced Jan 25, 2021
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.

techdebt: Introduced wfv1.WorkflowPhase
2 participants