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

feat: Add name filters for workflow list (exact/prefix/pattern) #13160

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

Adrien-D
Copy link
Contributor

Fixes #12161 1/2 (I'll make a PR for filtering archived/non-archived workflows on a seperate PR)

Motivation

We used to have name/prefix filtering for archived workflows before unifying APIs. We need to implement it back.

Modifications

API :

  • Name filtering was already implemented
  • I plugged back the NamePrefix to make it work
  • I added NamePattern the same way prefix is implemented

UI :

  • As its three way of filtering, and no reason to have those three at the same time, I made UX choice with a picker on the label. This is inspired from grafana's UI.

Screenshot 2024-06-10 at 14 40 15
Screenshot 2024-06-10 at 14 40 22

Verification

I tested the feature locally and I added tests for the API.

Copy link
Member

@agilgur5 agilgur5 left a comment

Choose a reason for hiding this comment

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

Left several suggestions, simplifications, style fixes, etc in-line below.

Might have a few more after that, particularly on the UI component and CSS changes that I did not check closely on this pass

persist/sqldb/selector.go Outdated Show resolved Hide resolved
server/utils/list_options.go Outdated Show resolved Hide resolved
ui/src/app/shared/utils.ts Outdated Show resolved Hide resolved
pkg/apiclient/workflow/workflow.proto Outdated Show resolved Hide resolved
ui/src/app/shared/utils.ts Outdated Show resolved Hide resolved
server/artifacts/artifact_server.go Outdated Show resolved Hide resolved
@agilgur5 agilgur5 added this to the v3.5.x patches milestone Jun 10, 2024
@agilgur5 agilgur5 changed the title feat: Add name filtering for workflows (exact/prefix/pattern) feat: Add name filters for workflow list (exact/prefix/pattern) Jun 10, 2024
pkg/apiclient/workflow/workflow.proto Outdated Show resolved Hide resolved
@Adrien-D
Copy link
Contributor Author

I fixed my PR with your suggestions. Please note that I updated argo-ui package to last merged commit to be able to remove autoHighlight (one of my other fixed issue) on this particular autocomplete component

@agilgur5
Copy link
Member

Please note that I updated argo-ui package to last merged commit to be able to remove autoHighlight (one of my other fixed issue) on this particular autocomplete component

Mmm I wouldn't include that as part of this PR since it is independent. Like we'd probably want to cherry-pick the argo-ui update/fixes into 3.4, which this PR will ofc not make it into.

Also there isn't an autocomplete component used in this PR?

@Adrien-D
Copy link
Contributor Author

Adrien-D commented Jun 12, 2024

Also there isn't an autocomplete component used in this PR?

There is, it's the component behind InputFilter used for filtering

But I get your point, we can merge this PR without it and I'll make two other PR to update the argo-ui package, and fix the behavior here

Copy link
Member

@agilgur5 agilgur5 left a comment

Choose a reason for hiding this comment

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

A few more comments on the filters below.

I haven't had time to take a look at the "contains" wording or CSS since I'm on vacation for the rest of the week and not at my computer

// Return workflows having this name prefix
string namePrefix = 4;
// Return workflows with name containing this value
string namePattern = 5;
Copy link
Member

@agilgur5 agilgur5 Jun 13, 2024

Choose a reason for hiding this comment

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

I'm wondering if we should make the API match the UI actually; name as a string and nameFilter as an enum that defaults to "Exact"

Right now, it's not clear that these are mutually exclusive. We could add that in the comments, but having it only allow one at a time feels much more explicit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I like that idea, so we could have nameFilter as Exact | Contains | Prefix, and then nameValue as string

I'm not familiar with the use case, but does it make more sense to have Exact as default instead of Contains ?

Copy link
Member

@agilgur5 agilgur5 Jun 14, 2024

Choose a reason for hiding this comment

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

Exact as default would be backward compatible, since previously it was the only usage of name.

We don't have to keep that default in the UI, but it would be necessary in the API for backward compat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api Argo Server API area/ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI: 3.5 missing name + name prefix filters for archived workflows
3 participants