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

Proposal: Enhanced Time-based Workflow Filtering #3384

Closed
terrytangyuan opened this issue Jul 2, 2020 · 4 comments
Closed

Proposal: Enhanced Time-based Workflow Filtering #3384

terrytangyuan opened this issue Jul 2, 2020 · 4 comments
Labels
area/cli The `argo` CLI type/feature Feature request

Comments

@terrytangyuan
Copy link
Member

terrytangyuan commented Jul 2, 2020

Summary

Introducing additional flags for Argo CLI to enhance existing functionality of workflow filtering.

Motivation

Per discussions here, the current implementation of the following two flags --since and --older for argo list, when used jointly, can cause confusion and users might interpret it in different ways. Recall that --since represents the relative duration since the workflow is created and --older represents the relative duration after the workflow finishes. The current implementation of this when using both flags is filtering from the list workflows with the following WorkflowPredicate:

func(startTime time.Time, endTime time.Time) WorkflowPredicate {
	return func(wf Workflow) bool {
		return wf.ObjectMeta.CreationTimestamp.After(startTime) && !wf.Status.FinishedAt.IsZero() && wf.Status.FinishedAt.Time.Before(endTime)
	}
}

One can interpret this in multiple ways, as pointed out in the discussion, for example (using A and B to denote two time points):

  1. WorkflowStartedBetween - the workflow started between times A and B.
  2. WorkflowFinishedBetween - the workflow finished between times A and B.
  3. WorkflowRanBetween - the workflow was running between the two times - i.e. start time is before B and (not finished OR finished after time A).
  4. WorkflowWasBetween - the workflow was ran and finished between the two times - i.e. started after A and finished before B.

This will lead to confusion to users and we need to come up with a better way to distinguish between different use cases.

Proposal

We introduce two additional flags related to time:

  • --from-time
  • --until-time

and another two additional flags related to status:

  • --from-status
  • --until-status

where the status can be any one from workflow_types.NodePhase as well as "created" as an additional phase to distinguish from the other phases.

For example, if argo list --from-time 2h --from-status=created --until-time=10m --until-status=succeeded is executed, the user should expect a list of workflows that are created from 2 hours ago and succeeded 10 minutes ago.

Compatibility with Existing Flags

  1. When those four proposed flags are used, the existing flags --older and --since should not be used and will be overriden by the behavior of the added flags.
  2. If --completed and --running are also specified, they will be ignored.
  3. Additional selectors will apply after the list of workflows gets filtered based on the four proposed flags.

Message from the maintainers:

If you wish to see this enhancement implemented please add a 👍 reaction to this issue! We often sort issues this way to know what to prioritize.

@terrytangyuan terrytangyuan added the type/feature Feature request label Jul 2, 2020
@alexec
Copy link
Contributor

alexec commented Jul 2, 2020

what about --started-after --finished-before - i.e. mention the field

@terrytangyuan
Copy link
Member Author

@alexec It's an option but there will be more flags since there are several different phases to cover.

@alexec alexec added the area/cli The `argo` CLI label Feb 7, 2022
@alexec
Copy link
Contributor

alexec commented Feb 7, 2022

Should probably be consistent with git options.

@alexec alexec removed the help wanted label Feb 7, 2022
@terrytangyuan
Copy link
Member Author

Not much community interest. Closing for now.

@terrytangyuan terrytangyuan closed this as not planned Won't fix, can't repro, duplicate, stale Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli The `argo` CLI type/feature Feature request
Projects
None yet
Development

No branches or pull requests

2 participants