Skip to content

[Bug] PolicyFilter.Get ignores pagination and sorting parameters #1135

Closed

Description

@vedant21-ctr

The PolicyFilter.Get() implementation in models/meshmodel/registry/v1beta1/policy_filter.go defines Limit, Offset, OrderOn, and Sort fields, but does not apply these parameters to the GORM query.

The method builds the policy query, counts the matching records, and scans the results without applying SQL pagination or ordering.

Consequently, callers supplying pagination parameters cannot rely on this filter to limit or offset the returned policies. The results are also not ordered according to the requested sorting parameters.

Unlike the corresponding model and component filters, the policy filter does not apply finder.Limit(...) or finder.Offset(...) before retrieving the records.

Expected Behavior

  • Apply Limit and Offset to the policy query when the corresponding values are provided.
  • Apply ordering based on OrderOn and Sort, consistent with the registry's existing filter conventions.
  • Preserve the total count of matching records independently of pagination.
  • Maintain the existing behavior of returning all matching records when no limit is specified.

Affected Function

PolicyFilter.Get()

File: models/meshmodel/registry/v1beta1/policy_filter.go

Activity

  1. added
    kind/bug
    on Oct 27, 2026
  2. shukria-sultani commented on Oct 28, 2026

    @shukria-sultani

    I want to work on this issue, could you please assign this to me?

  3. naveen-cs50-cse commented on Oct 28, 2026

    @naveen-cs50-cse

    can i get assigned ?

  4. self-assigned this
    on Oct 29, 2026
  5. lekaf974 commented on Oct 29, 2026

    @lekaf974
    Contributor

    @vedant21-ctr taking a look on this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions