fix(catalog): forward pagination cursor for planes and pipelines - #765
Open
InduwaraSMPN wants to merge 2 commits into
Open
fix(catalog): forward pagination cursor for planes and pipelines#765InduwaraSMPN wants to merge 2 commits into
InduwaraSMPN wants to merge 2 commits into
Conversation
added 2 commits
August 23, 2026 07:21
…r guards fetchAllPages gains an optional options bag without changing behaviour for existing single-argument callers: - timeoutMs: wall-clock budget for the entire run. Defaults to 60s; 0 disables the budget. One deadline, one setTimeout raced per page, cleared in finally. - signal: AbortSignal cancellation, checked at entry and between pages; the once-listener is removed in finally so it never leaks. - maxPages: opt-in hard cap on pages fetched. Exceeding it throws with the collected item count - it never silently truncates, since a truncated catalog sync looks like a successful one. - Malformed-page guards: a null/undefined page or a page without an items array throws naming the page index and cursor instead of surfacing as a bare TypeError. - Stuck-cursor guard: a server echoing the request cursor back as nextCursor throws instead of looping forever. One guard only. - nextCursor of null or empty string is treated as terminal, matching undefined. Also exports PaginatedResponse and FetchAllPagesOptions from the package barrel. Statement coverage of pagination-utils.ts is 100%; the seven pre-existing tests pass unmodified. Signed-off-by: Induwara <induwara@induwara.com>
Three fetchAllPages closures in OpenChoreoEntityProvider (workflowplanes, observabilityplanes, deploymentpipelines) were written as () => instead of cursor => and omitted the limit query parameter, so those resource types silently ingested only the first server-default page per namespace. Forward the cursor and pass limit: 100 like every other list call in the provider. Note: the four limit: 1000 sites in ci-backend/workflows-backend/ observability POST bodies are NOT changed - the observability query API documents maximum: 1000 for its limit, unlike the OpenChoreo API's cursor-paginated list endpoints which cap at 100. Signed-off-by: Induwara <induwara@induwara.com>
InduwaraSMPN
requested review from
Mirage20,
kaviththiranga,
sameerajayasoma and
stefinie123
as code owners
August 25, 2026 10:24
|
Warning Review limit reachedNext included review available in 59 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #764 (merge that first; this PR's diff then shows only its own commit).
Three
fetchAllPagesclosures in the scheduledOpenChoreoEntityProviderwere written() =>instead ofcursor =>and omitted thelimitquery parameter, so workflowplanes, observabilityplanes and deploymentpipelines silently ingested only the first server-default page per namespace. Every other list call in the provider passescursorandlimit: 100— these three now do too.Notes for reviewers: the four
limit: 1000sites sometimes mentioned alongside these (WorkflowService.ts:532,675,GenericWorkflowService.ts:583,ObservabilityApi.ts:423) are not bugs — they are POST bodies to the observability query API (/api/v1/logs/query,/api/v1/events/query), whose own spec documentsmaximum: 1000forlimit. The max-100LimitParambelongs to the OpenChoreo API's cursor-paginated list endpoints; the two APIs have different ceilings. Left untouched.Found while auditing every
fetchAllPagescall site for #764; kept out of that PR to keep it at exactly four files.