Skip to content

PB-15775: Let the six bounded enumerates filter and sort - #477

Merged
lalat-das merged 1 commit into
pb-15775-rcbfrom
pb-15775-enum-filters
Dec 5, 2026
Merged

lalat-das merged 1 commit into
pb-15775-rcbfrom
pb-15775-enum-filters

Conversation

@lalat-das

Copy link
Copy Markdown
Collaborator

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.

What this PR does / why we need it:

Which issue(s) this PR fixes (optional)
Closes #

Special notes for your reviewer:

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.
@lalat-das
lalat-das merged commit a3880ec into pb-15775-rcb Dec 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant