ListDeployments returns unbounded filtered pages with an unstable cursor
Maintainer thường phản hồi trong vòng 2 ngày
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 70/100
Hướng nghiên cứu
Bắt đầu trong pkg/app/server/grpcapi/web_api.go tại WebAPI.ListDeployments và vòng lặp lọc theo label, sau đó chạy hoặc kiểm tra các unit test tập trung cho handler này. Thêm kiểm thử hồi quy cho các kết quả khớp dày và thưa trên nhiều trang datastore; được xem là hoàn tất khi các response đã lọc tuân theo PageSize và các request tiếp theo tiếp tục mà không có bản sao hoặc khoảng trống.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happened:
WebAPI.ListDeployments can return more than one logical page of deployments when label filtering is used. The handler paginates in the datastore layer, applies label filtering in memory, and keeps appending matches from subsequent datastore pages until the scan stops. That means one response can grow beyond the requested PageSize while still returning only the last datastore cursor.
Summary
ListDeployments does not enforce a stable filtered page size after applying label filters.
Affected Area
pkg/app/server/grpcapi/web_api.goWebAPI.ListDeployments
Steps to Reproduce
- Arrange multiple
deploymentStore.Listpages where several deployments match the requestedlabels. - Call
WebAPI.ListDeploymentswith those label filters and aPageSizesmaller than the total number of matching deployments. - Observe that the response accumulates matching deployments across datastore pages into a single
Deploymentsarray. - Observe that the returned cursor is only the final datastore cursor rather than a cursor aligned to the filtered response boundary.
Actual Behaviour
One response can contain more than the intended logical page size when label filtering is applied, and the cursor does not describe a stable resume point for filtered pagination.
Technical Evidence
- The current implementation filters the first datastore page in memory and, if fewer than
PageSizeitems remain, continues fetching more datastore pages and appending every matching deployment. - The handler currently returns
filteredwithout truncating it toPageSizeand includes a TODO noting thatListDeploymentscan exceed the page size. - Relevant code:
pkg/app/server/grpcapi/web_api.goaround theListDeploymentslabel-filter loop.
Suspected Root Cause
Filtering happens after datastore pagination, but the filtered result set does not have its own page boundary or resume cursor.
Proposed Direction
- Keep fetching datastore pages until the filtered response reaches the requested logical page size.
- Stop at the exact filtered page boundary instead of returning every matched deployment gathered during the scan.
- Return a cursor that resumes from the correct datastore position for the next filtered page.
- Add regression tests that cover dense and sparse label matches across multiple datastore pages.
Acceptance Criteria
ListDeploymentsnever returns more than the requested logical page size when label filters are used.- A follow-up request using the returned cursor yields the next filtered page without duplicates or gaps.
- Regression tests cover multi-page filtered pagination.
What you expected to happen:
ListDeployments should honor a stable filtered page size and return a cursor that resumes exactly after the last item included in the filtered response.
How to reproduce it:
- Arrange or mock multiple
deploymentStore.Listpages containing deployments with matching labels. - Call
WebAPI.ListDeploymentswith label filters and aPageSizesmaller than the total filtered match count. - Inspect the response and verify that it currently returns more than one logical page of matches.
Environment:
pipedversion: Not applicablecontrol-planeversion:masteras of July 22, 2026- Others: Reproducible from the current
pkg/app/server/grpcapi/web_api.goimplementation and a focused unit test.
- Ngôn ngữ chính
- Go
- Star
- 1.4k
- Fork
- 391
- Merge trung bình
- 4 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 58
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của pipe-cd/pipecd
-
Applications at the repository root are not triggered by new commitsCó thể đã có người làm @Daksha1611 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 2 ngày
-
pipedv1 kubernetes plugins ignore trafficRouting.istio.host in K8S_TRAFFIC_ROUTINGCó thể đã có người làm @Dhirenderchoudhary đã nhận hôm nay. Đang mở
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 74/100
pipe-cd/pipecd#7626 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 2 ngày
-
pipectl transfer restore application drops backed-up labelsCó thể đã có người làm @bhavishyajain545 đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
pipe-cd/pipecd#7622 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của pipe-cd/pipecd
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
docker-compose: postgres healthcheck should probe TCP (pg_isready -h localhost)Có thể đã có người làm @zezo-mohamed22 đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
OneBusAway/watchdog#305 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
self-care self-care:agent-discoverability
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
githubnext/gh-cao#20928 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
automation documentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
SocialGouv/iterion#3287 ·
Maintainer thường phản hồi trong vòng 1 ngày