-
Notifications
You must be signed in to change notification settings - Fork 266
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
Add server-side pagination to cluster explorer lists #11672
Add server-side pagination to cluster explorer lists #11672
Conversation
@richard-cox Is this for 2.10? |
- Functional Changes - SSP now works after vue3 bump - Home Page Clusters list now uses server-side pagination - Side Bar clusters list now uses server-side pagination - Wire in now supported sorting / filtering by id and name used for table columns - Allow pagination to be enabled given a specific context - Call findPage without persisting to store - New Pagination Tools - PaginatedResourceTable - Convenience Component, wraps ResourceTable with pagination specific props - PaginationWrapper - Convenience class to handle requests for resources and updates to them (avoiding store) - Regressions - Side Nav menu ready state was `mgmtCluster.isReady && !pCluster?.hasError`, now ???
…would incorrectly fetch all resources anyway - convert reminaing storage lists
840f93f
to
006debb
Compare
- Functional Changes - SSP now works after vue3 bump - Home Page Clusters list now uses server-side pagination - Side Bar clusters list now uses server-side pagination - Wire in now supported sorting / filtering by id and name used for table columns - Allow pagination to be enabled given a specific context - Call findPage without persisting to store - New Pagination Tools - PaginatedResourceTable - Convenience Component, wraps ResourceTable with pagination specific props - PaginationWrapper - Convenience class to handle requests for resources and updates to them (avoiding store) - Regressions - Side Nav menu ready state was `mgmtCluster.isReady && !pCluster?.hasError`, now ???
- caused by shell/scripts/test-plugins-build.sh importing list/catalog.cattle.io.clusterrepo.vue - the component had been updated to a TS component - check-plugin build outputs TS errors for a component file imports - vs code shows no errors for imported file
cy.get('@consoleError').should('not.be.called'); // See error lot | ||
cy.get('@consoleWarn').should('not.be.called'); // See warning log (there will be some....) |
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.
Can this go back in? Are we avoiding warnings and errors or is it just not necessary anymore?
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 was erroneously added in the previous PR https://github.com/rancher/dashboard/pull/11663/files#diff-2e0d69f6ba95f5b63f312a8b8d2001db4b2a63ad3499de89103564b933df32bd
// If the custom component contains the paginated resource table it'll control the fetching | ||
if (component?.components?.['PaginatedResourceTable']) { | ||
this.componentWillFetch = true; | ||
} |
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.
What is this resolving? This looks like a gotcha waiting to happen, I also don't like how we're adding more implicit logic which will cause more effort when we try to de-tangle and make things more composable.
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 ResourceList component will either
- fetch the resources and display them in a list
- not fetch the resources and let the custom list component do it all (fetch and display)
For the second point the ResourceList then needs to know if it should not fetch the resources. It already does this if the custom list component contains a fetch
method (then sets componentWillFetch = true). This change does the same but if the custom list component contains a PaginatedResourceTable
component.
I've combined this logic to be neater and clearer.
In the future the fetch
method one will go away and we should then i guess do something neater than checking if the custom list has a specific component
enabled: [ | ||
NODE, EVENT, | ||
WORKLOAD_TYPES.CRON_JOB, WORKLOAD_TYPES.DAEMON_SET, WORKLOAD_TYPES.DEPLOYMENT, WORKLOAD_TYPES.JOB, WORKLOAD_TYPES.STATEFUL_SET, POD, | ||
CATALOG.APP, CATALOG.CLUSTER_REPO, CATALOG.OPERATION, | ||
HPA, INGRESS, SERVICE, | ||
PV, CONFIG_MAP, STORAGE_CLASS, PVC, SECRET, | ||
WORKLOAD_TYPES.REPLICA_SET, WORKLOAD_TYPES.REPLICATION_CONTROLLER | ||
], |
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.
Is there anything on the backend roadmap to enable caching for all resources? It seems like pagination is going to have limited use for extensions and apps if we have to enable each one separately.
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 and the resource updates were the two mahoosive discussion points when they designed the solution.
Unfortunately anything that is sorted/filtered does so on a db indexed field and matching go code... so needs to be known up front. Think the code part was why just a sql alter table can't be used.
It was agreed they would (promptly) manually add them at dev time for us.
For extensions we agreed that extension owners that work with CRDs should ensure they contain additional printer columns. Those will be returned in the rancher schema as attributes.columns (which the dashboard will show as columns in lists) which reference the resources metadata.fields array. The metadata.fields array is indexed, so lists will automatically enable sort/filter on them.
deployments atttributes.columns
{
"name": "Containers",
"type": "string",
"format": "",
"description": "Names of each container in the template.",
"priority": 1,
"field": "$.metadata.fields[5]"
},
deployment metadata.fields
[
...,
...,
...,
...,
...,
"fleet-controller,fleet-cleanup,fleet-agentmanagement",
...,
...,
],
Extension developers though that wish to sort/filter on resources where they don't own the CRD ... are blocked. We would need to come back with real use cases for that one
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.
Overall simple changes. I think once the todos and the tests pass we'll be fine to merge.
- Remove final todo's - includes fix for service type clusterip/headless overlap - Removed ununused ENDPOINT column (note ENDPOINT formatter used in other columns) - Testing freshly added index fields
@@ -320,15 +326,6 @@ export const POD_RESTARTS = { | |||
liveUpdates: true | |||
}; | |||
|
|||
export const ENDPOINTS = { |
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.
Not used (though other columns will use the Endpoints formatter)
7acff6b
to
745ec3b
Compare
df685b0
to
a17f1d9
Compare
- fix cluster dashboard events test - fix and greatly improve flaky events test - fix hpa test - functional fixes - fix sorting/filtering events by object type - fix hpa columns
a17f1d9
to
457f117
Compare
Blocked on
No Longer Blocked on
services
cache fails to be created, blocking other resources rancher#48384Impacted by
Type
does not update the values in the type column #12982Outstanding (separate PR)
Working around rancher/rancher#40773
Summary
Fixes #9546
Fixes #12555
Occurred changes and/or fixed issues
list/namespace.vue
instead of the now TS filelist/catalog.cattle.io.clusterrepo.vue
. The later has TS build errorsTechnical notes summary
Areas or cases that should be tested
Areas which could experience regressions
Screenshot/Video
Checklist