-
Notifications
You must be signed in to change notification settings - Fork 163
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
Improve performance of showing partial Pipelines and runs #1452
Conversation
Hi @uidoyen. Thanks for your PR. I'm waiting for a opendatahub-io member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@uidoyen I think there is linting error, can you fix it? |
/ok-to-test |
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 think you are missing the point of the change.
The issue describes that we need to filter the pipelines k8s call but I think part of the goal of this issue is to improve performance by not fetching all the calls right?
frontend/src/concepts/pipelines/content/tables/pipeline/PipelinesTable.tsx
Outdated
Show resolved
Hide resolved
@uidoyen Can you rebase to get latest changes, there's a bug fix for an issue present in this PR (was in our codebase before) |
166f12b
to
6ce0c3a
Compare
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.
There are three views here:
- Projects Pipelines
- Global Pipelines
- Global Runs (scheduled and triggered)
There are two types of changes needed:
- Project Pipelines needs to limit to "5" because we fetching 20 has no value since we only want to show 5
- Project Pipelines & Global Pipelines show the last 5 runs inside the expanded section -- but fetch 20 and truncate client side
So we need to handle this truncation via API on the Project Pipelines for Pipelines & Runs. Global Pipelines we need to truncate via API for the expanded row's runs. Global Runs does not need to be changed for this issue.
We want to improve our fetching so we can get the "latest" from the API without having to fetch 15 more than we need. We can fetch 6 instead of 5 that we show if that's the easiest way to show the related "show more" links that take you to the Global Pipelines or Global Runs page (depending on what link you click on).
This effort is to just limit fetching in some cases for some resources. We want our Global pages to show as much as it can for that given type.
Hope this all makes sense, let me know if you have any questions.
frontend/src/concepts/pipelines/content/tables/pipeline/PipelinesTableRow.tsx
Outdated
Show resolved
Hide resolved
frontend/src/pages/pipelines/global/pipelines/PipelinesView.tsx
Outdated
Show resolved
Hide resolved
frontend/src/concepts/pipelines/content/tables/pipelineRun/PipelineRunTable.tsx
Outdated
Show resolved
Hide resolved
@uidoyen Can you fix up your screenshots in your description? |
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.
Couple notes
frontend/src/concepts/pipelines/content/tables/pipeline/PipelinesTableExpandedRow.tsx
Outdated
Show resolved
Hide resolved
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.
Looks good code-wise and screenshot wise -- I have not tested it.
/lgtm
@pnaik1 @manaswinidas Can you guys test it please? |
Okay @uidoyen |
/lgtm |
Im gonna trigger again the checks and review it. Let's see if this time it doesn't fail |
But im gonna approve it anyways cause code looks great. |
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.
/lgtm
I'm sorry @uidoyen I think you need to rebase interactively your PR to squash all the commits beforehand, we need to do this for ever pr for now own, please do that before merging |
dfee18b
to
9093881
Compare
/lgtm |
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.
The changes work fine for me.
/lgtm
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.
/approve
I'm going to add the approval label because the code works. But we should clean up the implementation so it's accurately representing the component in question -- see my comment below.
Get any review from anyone else after you adjust the prop stuff. No need to wait on me unless you feel there are more questions.
data={pipelines} | ||
enablePagination | ||
{...tableProps} |
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.
Two things here...
First, spreads usually are always first unless you're looking to have "defaults" that are overridden by the spread values.
<Component
// defaults -- usually not done in most cases
{...data} // other values that are not likely in here, or optionals for overriding defaults
// explicit values -- will override anything passed in `data`
/>
We want to make sure nothing that we "want" is before a spread -- it will override that state.
Second, enablePagination
here is also not ideal -- this table is shared by two callers:
- Global Pipelines
- Project Pipelines
Global Pipelines wants to be enabled, and is if you look at PipelinesView
Project Pipelines does not want to paginate -- since we are truncating the values to less than the default page limit, it won't ever trigger, but this is not great.
Changes needed
- Please remove the
enablePagination
from this shared component, let the spread handle that if the caller wants it. - Move spread back to the top, there is no need to try and override these values (
data
&enablePagination
-- which you are removing)
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andrewballantyne, lucferbux, manaswinidas The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Closes #1248
Description
Improve performance of showing partial Pipelines / associated Pipeline Runs by enabling pagination and limit the items. Also sort the pipelines and runs by
created_at
.How Has This Been Tested?
Test Impact
Project Pipelines & Project Pipelines' Runs
Global Pipelines:
Global Pipeline scheduled runs:
Global Pipeline triggered runs(zoomed out):
Request review criteria: