Skip to content

native_apps_summary.go: fold custom param parser onto canonical V3 pagination helpers #5375

Description

@nabramovitz

Surfaced during the V3 pagination-params end-to-end verification (see #4360).

Observation

All 39 native handlers in src/jetstream/plugins/cloudfoundry/ use V3 params on the wire. 38 of them share the canonical helper chain in stratos_paging.go (parsePerPageAndPage, applyPagingParams, BuildPaginationMeta).

native_apps_summary.go is the one outlier: it rolls its own parseSummaryQueryParams at L62-104 — same param names (per_page / page / order_by), same BuildPaginationMeta output, but duplicates the helper logic and contributes one extra concern (Stratos-shape direction field folded into the V3 order_by minus-prefix combine) plus filter passthrough.

What to change

Fold the apps-summary parser onto the canonical helpers:

  • Call parsePerPageAndPage / applyPagingParams directly
  • Layer the directionorder_by minus-prefix folding on top
  • Layer the filter-map passthrough on top

Behavioural delta to fix at the same time

Today parseSummaryQueryParams always emits per_page and page upstream because it applies defaults at L65 and L72 before forwarding. The canonical helper uses a "present" flag so absent params let V3 apply server defaults. Folding onto the helper restores that passthrough — minor, but converges behaviour with the other 38 handlers.

Scope

Refactor only — no wire-shape change, no API surface change. Tests should continue to pass with the same fixtures.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions