Skip to content

Limit filtered deployment pages to request size - #7075

Open
rootp1 wants to merge 1 commit into
pipe-cd:masterfrom
rootp1:fix/listdeployments-filtered-pagination
Open

Limit filtered deployment pages to request size#7075
rootp1 wants to merge 1 commit into
pipe-cd:masterfrom
rootp1:fix/listdeployments-filtered-pagination

Conversation

@rootp1

@rootp1 rootp1 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

What this PR does:

  • limits ListDeployments responses to the requested filtered page size when label filters are applied
  • returns a resume cursor that can continue from the middle of a datastore page without skipping matching deployments
  • adds regression tests for mid-page resume and exact datastore page-boundary behavior

Why we need it:

  • the current handler can return more than one logical page of filtered deployments in a single response
  • the returned datastore cursor alone is not a stable resume point when the filtered page ends in the middle of a fetched datastore page

Which issue(s) this PR fixes:

Fixes #7074

Does this PR introduce a user-facing change?:

  • How are users affected by this change: filtered deployment pagination now respects the requested page size and follow-up requests continue without duplicates or gaps
  • Is this breaking change: no
  • How to migrate (if breaking change): not applicable

Summary

  • enforce the requested logical page size after label filtering in WebAPI.ListDeployments
  • encode an internal resume cursor only when a filtered page ends mid-datastore-page
  • cover the new cursor behavior with focused grpcapi regression tests

Linked Issue

Fixes #7074

What Changed

  • added a private cursor format for ListDeployments filtered pagination resumes
  • stopped appending matches once the filtered page reaches PageSize
  • added tests for stable filtered pagination across multiple datastore pages

Verification

  • go test ./pkg/app/server/grpcapi -run 'TestListDeploymentsWithLabels' — passed
  • cd pkg/app/server/grpcapi && /Users/rootp1/go/bin/golangci-lint run -v --config /Users/rootp1/Documents/repos/n/new/pipecd-issue2/.golangci.yml ./... — passed
  • make update/web-deps — passed
  • make check — failed: repository-pinned golangci-lint image is built with Go 1.25.0 while this repo targets Go 1.26.2, so lint aborts before analysis
  • /Users/rootp1/go/bin/golangci-lint run -v --config .golangci.yml across repo modules — failed: unrelated existing goheader issue in web/node_modules/flatted/golang/pkg/flatted/flatted.go after installing web dependencies
  • make check/gen/code — passed
  • make check/dco — failed: existing upstream commit 25ae69937e55e8330bff96c34346718f3e5e7148 is missing a Signed-off-by line
  • make test — not completed: root go test -failfast -race ./pkg/... ./cmd/... remained running without further output for several minutes on this machine and was stopped after targeted checks had already passed

Scope

  • only pkg/app/server/grpcapi/web_api.go and pkg/app/server/grpcapi/web_api_test.go were changed for this fix

Signed-off-by: rootp1 <arnav.iitr@gmail.com>
@rootp1
rootp1 requested a review from a team as a code owner July 22, 2026 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ListDeployments returns unbounded filtered pages with an unstable cursor

1 participant