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
direction → order_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.
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 instratos_paging.go(parsePerPageAndPage,applyPagingParams,BuildPaginationMeta).native_apps_summary.gois the one outlier: it rolls its ownparseSummaryQueryParamsat L62-104 — same param names (per_page/page/order_by), sameBuildPaginationMetaoutput, but duplicates the helper logic and contributes one extra concern (Stratos-shapedirectionfield folded into the V3order_byminus-prefix combine) plus filter passthrough.What to change
Fold the apps-summary parser onto the canonical helpers:
parsePerPageAndPage/applyPagingParamsdirectlydirection→order_byminus-prefix folding on topBehavioural delta to fix at the same time
Today
parseSummaryQueryParamsalways emitsper_pageandpageupstream 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.