-
Notifications
You must be signed in to change notification settings - Fork 51
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
Adding support for transform functions #79
Conversation
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 see any tests that uses a TransformFunc. Can that be added so we have some confidence that we're calling SetTransform, etc?
865f465
to
1292d08
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.
Agreed with @tomleb: this is good to merge as soon as at least one test touches the newly added parameter.
@tomleb / @moio I'll see what I can do. Right now the tests are a bit mock-reliant, and since we can't test functions for equality (see issues like: golang/mock#324) there may be a limit to what I can do. |
@moio / @tomleb I gave it a try. I had to do a few sub-optimal/hacky things:
Please take a look and let me know if you have some other ideas (or if you would prefer that I not add the tests in favor of the first version of the code). |
Adds support for a transform function, which will edit an object before it is stored in the cache. Used primarily to add abitrary new fields that can be filtered/sorted on.
50d91c3
to
7fdf582
Compare
This includes various fixes to the UI Server-Side Pagination experimental feature: https://ranchermanager.docs.rancher.com/how-to-guides/advanced-user-guides/enable-experimental-features/ui-server-side-pagination - rancher/lasso#86 - rancher/lasso#90 - rancher/lasso#85 - rancher/lasso#92 - rancher/lasso#79 - rancher/lasso#97 - rancher/lasso#94 - rancher/lasso#98 - rancher/lasso#108 - rancher/lasso#99 It also includes improvements to code collecting metrics: - rancher/lasso#89 - rancher/lasso#95 And to test code: - rancher/lasso#100 - rancher/lasso#101 Signed-off-by: Silvio Moioli <silvio@moioli.net>
Related to one of the tasks from rancher/rancher#45635. Adds the option for a
TransformFunc
which will be can be passed in when the Cache is created.