-
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
fix: apply custom cursor pagination where workflows and archived workflows are merged #11761
fix: apply custom cursor pagination where workflows and archived workflows are merged #11761
Conversation
…flows are merged Signed-off-by: sunyeongchoi <sn0716@naver.com>
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.
This is great! Could you also look into adding some tests around cursorPaginationByResourceVersion
?
Sure! I'll write a test code and upload a commit tomorrow :) |
// Search whole with Limit 0. | ||
// Reset the Continue "" to prevent Kubernetes native pagination. |
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.
Would this approach require fetching the entire list every time user clicks another page?
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.
Yes, the entire list is fetched every time the page changed.
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 have written and uploaded test code for cursorPaginationByResourceVersion. 859c0b2
I am concerned about the potential performance impact of my implementation because it retrieves the entire dataset with each page change. However, I can't think of a better way to solve this problem on the server-side other than this method.
In my opinion, unless there's a better approach, the server should send the entire list to the front-end once, and then pagination can be handled on the front-end. However, one drawback of this approach is that the data won't be updated on the front-end without refreshing the page. To achieve real-time data updates, we might need to consider using websockets or polling.
Do you have any suggestions or better ideas on how to handle this?
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 don't have a better idea. I think correctness is important right now. Performance-wise, we should do something from the front-end like what you said to only refetch the whole list when refreshing. This can be something that's configurable.
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.
Then, after this PR, I will think about the front page pagination and give it a try.
Also, since I am curious about the performance of the currently implemented pagination, I will think about ways to test its performance.
I will share the test results later when they come out.
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.
Great!
8713736
to
bd50093
Compare
…ows function Signed-off-by: sunyeongchoi <sn0716@naver.com>
Signed-off-by: sunyeongchoi <sn0716@naver.com>
Co-authored-by: Yuan (Terry) Tang <terrytangyuan@gmail.com> Signed-off-by: happyso <sn0716@naver.com>
Signed-off-by: sunyeongchoi <sn0716@naver.com>
Signed-off-by: sunyeongchoi <sn0716@naver.com>
This looks good once the last comment and the conflicts are resolved. Great work! This should be included in the next RC #11381 |
…hived-workflows-pagination Signed-off-by: sunyeongchoi <sn0716@naver.com>
Head branch was pushed to by a user without write access
abfe950
to
f1318f6
Compare
…tMeta here Signed-off-by: sunyeongchoi <sn0716@naver.com>
Head branch was pushed to by a user without write access
Need to sort the imports |
Signed-off-by: sunyeongchoi <sn0716@naver.com>
Head branch was pushed to by a user without write access
@sunyeongchoi Looks like the test is flaky. See https://github.com/argoproj/argo-workflows/actions/runs/6166062084/job/16734921912 |
Oh no, I'll quickly post a PR fixing that test. sorry. |
I uploaded bugfix PR about this :) #11816 |
Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
Fixes #11715
Motivation
Workflows and archive workflows use different pagination logics.
However, in the current workflow page, if both workflows and archive workflows coexist, we want them to be retrieved together.
The issue arises from passing the pagination options used for workflows pagination directly to archive workflows, causing a mismatch between the types used in archive workflows and workflows, resulting in archive workflows not being retrieved.
Modifications
I have implemented the following logic to resolve this issue:
After contemplating on how to address this issue, I concluded that the conventional approach of paginating workflows and archived workflows separately would not easily resolve this problem. Therefore, I implemented it in this manner.
Verification