ListEvents can exceed page size after label filtering
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
- #7086 @rootp1 による — マージされずにクローズ
評価
調査の方向性
pkg/app/server/grpcapi/web_api.go の WebAPI.ListEvents とそのラベルでフィルタリングされたページネーションループから開始し、同等の ListDeployments パスと比較します。ラベル結果が密な場合、疎な場合、0 件の場合のテストを追加または更新し、カーソルによる継続でイベントの重複や欠落がなく、レスポンスが PageSize を守ることを確認します。
索引モデルが issue の本文から書いたものです。
説明
What happened:
WebAPI.ListEvents applies label filtering after fetching datastore pages, then keeps appending matching events while scanning additional pages until it has at least PageSize matches. If the final scanned page contains multiple matching events after the threshold is crossed, the response can exceed the requested logical page size. The handler then returns the datastore cursor from the final scanned page, which makes filtered pagination unstable for event timelines.
Summary
ListEvents can return an oversized filtered response when label matches are spread across multiple datastore pages.
Affected Area
pkg/app/server/grpcapi/web_api.go, specifically WebAPI.ListEvents and its label-filtered pagination path.
What you expected to happen:
ListEvents should return one logical filtered page, no larger than the requested PageSize, and provide a cursor suitable for continuing to the next filtered page without duplicates or dropped events.
Expected Behaviour
The API should enforce a stable logical page size after label filtering and return a cursor for the next filtered page.
How to reproduce it:
- Seed or mock multiple datastore pages of events with label matches spread across pages.
- Call
WebAPI.ListEventswithOptions.Labelsand aPageSizesmaller than the total matching events. - Make the first page contain fewer matching events than
PageSize, and a later fetched page contain enough matches to cross the threshold by more than one event. - Observe that the response includes more than
PageSizeevents because every matching event from the final scanned page is appended.
Actual Behaviour
The endpoint can return an uncapped list of matched events encountered during the scan, exceeding the requested page size.
Technical Evidence
ListEvents builds datastore ListOptions with Limit: pageSize, fetches one page, filters by labels in memory, then repeats while len(filtered) < pageSize. Inside the repeat loop, every matching event from the newly fetched datastore page is appended. There is currently a TODO noting the overflow risk immediately before returning the response:
pkg/app/server/grpcapi/web_api.go:// TODO: Think about possibility that the response of ListEvents exceeds the page size
This mirrors the same post-filter pagination risk that exists in ListDeployments.
Suspected Root Cause
Label filtering happens after datastore pagination, but the filtered slice is never capped back to the requested logical page size before the response is returned. The returned cursor is the datastore cursor from the final scanned page.
Proposed Direction
Refactor the filtered pagination path so ListEvents only returns up to PageSize filtered events. If possible, share the helper with the equivalent ListDeployments path so both handlers use consistent cursor semantics.
Acceptance Criteria
ListEventsenforces a stable logical page size after label filtering.- Cursor-based continuation yields no duplicate or dropped events.
- Tests cover dense matches, sparse matches, and zero-match scenarios.
Environment:
pipedversion: Not applicable; this is a control-plane WebAPI handler issue.control-planeversion: Current upstreammasteras of 2026-07-24.- Others: Not applicable.
- 主要言語
- Go
- スター
- 1.4k
- フォーク
- 391
- 平均マージ
- 4日 1時間
- マージ済み PR(30日)
- 58
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pipe-cd/pipecd のほかの issue
-
Applications at the repository root are not triggered by new commits対応中かも @Daksha1611 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 2 日以内に返信
-
pipedv1 kubernetes plugins ignore trafficRouting.istio.host in K8S_TRAFFIC_ROUTING対応中かも @Dhirenderchoudhary が今日担当しました。 オープン
難易度 2/5 半日 初心者へのやさしさ 74/100
pipe-cd/pipecd#7626 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 2 日以内に返信
-
pipectl transfer restore application drops backed-up labels対応中かも @bhavishyajain545 が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
pipe-cd/pipecd#7622 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 2 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
docker-compose: postgres healthcheck should probe TCP (pg_isready -h localhost)対応中かも @zezo-mohamed22 が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
OneBusAway/watchdog#305 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
self-care self-care:agent-discoverability
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
githubnext/gh-cao#20928 ·
メンテナーはふだん 1 日以内に返信
-
automation documentation
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
SocialGouv/iterion#3287 ·
メンテナーはふだん 1 日以内に返信