Repository navigation
PB-15775: Let the six bounded enumerates filter and sort - #477
Merged
Merged
Conversation
Five resource-centric enumerates embed EnumerateOptions because their collections grow with the fleet. The other six were left without it on the argument that an SLA Policy or a Placement Rule is bounded by how many an administrator writes, so it needs no paging. That reasoning was about SIZE and it held. It said nothing about sort or search, which are not size questions: a list of thirty policies still wants a search box and a sortable column, and every older object in this API gets both from the server. The result was an inconsistency with no stated reason. labels survived on SLAPolicy and PlacementRule and vanished from the other four, and name_filter and sort_option vanished from all six. - name_filter and sort_option on all six - labels on the four that lacked it NOT the whole EnumerateOptions. It carries eighteen fields, most of them backup-specific - vm_volume_name, exclude_failed_resource, backup_object_type - and embedding it to obtain three would repeat what ResourceCatalog already shows as a cost: it takes EnumerateOptions AND a ResourceFilter, so a caller has two places to express one filter. The field names and meanings are EnumerateOptions', so the server reads them into datastore.FilterValue exactly as backup.go does.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Five resource-centric enumerates embed EnumerateOptions because their collections grow with the fleet. The other six were left without it on the argument that an SLA Policy or a Placement Rule is bounded by how many an administrator writes, so it needs no paging.
That reasoning was about SIZE and it held. It said nothing about sort or search, which are not size questions: a list of thirty policies still wants a search box and a sortable column, and every older object in this API gets both from the server.
The result was an inconsistency with no stated reason. labels survived on SLAPolicy and PlacementRule and vanished from the other four, and name_filter and sort_option vanished from all six.
NOT the whole EnumerateOptions. It carries eighteen fields, most of them backup-specific - vm_volume_name, exclude_failed_resource, backup_object_type - and embedding it to obtain three would repeat what ResourceCatalog already shows as a cost: it takes EnumerateOptions AND a ResourceFilter, so a caller has two places to express one filter.
The field names and meanings are EnumerateOptions', so the server reads them into datastore.FilterValue exactly as backup.go does.
What this PR does / why we need it:
Which issue(s) this PR fixes (optional)
Closes #
Special notes for your reviewer: