Skip to content

fix: add /applications/grouped endpoint to reduce initial page load API calls#3034

Merged
dcharles525 merged 2 commits into
1.14.0from
fix/application-pagination
May 20, 2026
Merged

fix: add /applications/grouped endpoint to reduce initial page load API calls#3034
dcharles525 merged 2 commits into
1.14.0from
fix/application-pagination

Conversation

@dcharles525

@dcharles525 dcharles525 commented May 19, 2026

Copy link
Copy Markdown
Member

PR Checklist

  • Linting Test is passing
  • New Unit and Acceptance tests written for the context of the PR
  • Unit Tests are passing
  • Acceptance Tests are passing
  • Code is well documented
  • If applicable, a PR in the epinio/docs repository has been opened

Summary

Fixes the N+1 API call problem on the app list page. Each namespace had its own paginated table, causing one HTTP call per namespace on initial load. This adds a single endpoint that fans out server-side and returns all namespaces in one response.

Pairs with epinio/ui#580.

Occurred changes and/or fixed issues

  • Added GET /api/v1/applications/grouped returning map[namespace]PaginatedResponse[App]
  • Added ListPaginatedByNamespace in internal/application/ using errgroup to fan out ListPaginated calls concurrently across all namespaces
  • Registered route in router.go and added AllAppsGrouped action to auth/actions.yaml
  • Added unit tests covering empty namespace list and error propagation
  • Added acceptance tests covering namespace keys, app placement, pagination metadata, out-of-range pages, RBAC, and search filtering

Technical notes summary

Latency is now bounded by the slowest namespace rather than the sum of all namespaces. Auth filtering (auth.FilterResources) is applied per namespace in the handler before building the response, consistent with other list endpoints.

Areas or cases that should be tested

  • Grouped endpoint returns one key per accessible namespace
  • Apps appear in the correct namespace bucket
  • Pagination metadata (page, pageSize, totalItems, totalPages) is correct per namespace
  • A user without namespace access gets an empty map, not a 403
  • Search param filters apps within each namespace

Areas which could experience regressions

  • App list endpoint behavior
  • Namespace-scoped application listing (/namespaces/:ns/applications)

@dcharles525 dcharles525 changed the title fix(Add grouped endpoint for initial applications page load): fix: add /applications/grouped endpoint to reduce initial page load API calls May 19, 2026
@dcharles525 dcharles525 marked this pull request as ready for review May 19, 2026 20:45
@dcharles525 dcharles525 requested a review from a team as a code owner May 19, 2026 20:45
…ked around defaults while still supporting server side pagination
@dcharles525 dcharles525 merged commit 00ae71b into 1.14.0 May 20, 2026
2 checks passed
@dcharles525 dcharles525 deleted the fix/application-pagination branch May 20, 2026 15:20
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.

2 participants