Skip to content

Surface truncation for org/repo hierarchy listing when the 20-page backstop is hit #5436

Description

@julianmesa-gitkraken

Context

The org/repo hierarchy listing added in #5434 bounds each pagination loop to 20 pages as a backstop against an unbounded loop. When that cap is hit, the result is silently truncated with no signal a caller could use to detect incomplete results. The cap only trips well beyond any realistic single hierarchy (2000 repos for Azure per project and GitLab; 20 pages of orgs/groups), and there are no consumers of these APIs yet, so this is deferred follow-up rather than a blocker for #5434.

Affected sites

  • packages/plus/integrations/src/providers/azureDevOps.ts (getProviderRepositoriesForOrg, no-project per-project fan-out)
  • packages/plus/integrations/src/providers/gitlab.ts (getProviderRepositoriesForOrg, exhaust + namespace filter)
  • packages/plus/integrations/src/providers/providersApi.ts (getGithubOrgsForCurrentUser)
  • packages/plus/integrations/src/providers/providersApi.ts (getGitlabGroupsForCurrentUser)

Why it's not a trivial flag

A caller-detectable truncation signal only makes sense if it's actionable, i.e. resumable. None of these sites can provide a resumable cursor as written:

  • GitLab getProviderRepositoriesForOrg exhausts + filters getReposForCurrentUser internally and takes no cursor param.
  • The Azure no-project branch merges N independently-paginated per-project streams; there's no single cursor that could resume that merge.
  • getGithubOrgsForCurrentUser / getGitlabGroupsForCurrentUser return plain arrays with no metadata slot.

A bare paging.more = true with no resumable cursor is a broken contract, so surfacing truncation needs a real design pass, not a flag.

Proposed work

  • Decide the truncation/completeness contract for these APIs once a real paginating consumer exists (what "incomplete" means and how a caller resumes).
  • For the PagedResult-returning methods: add proper cursor plumbing so paging is honestly resumable, or keep exhausting but expose an explicit truncated/more indicator with a documented meaning.
  • For the org/group methods returning T[]: introduce a metadata-carrying return shape (or switch to PagedResult) so truncation can be represented at all.
  • Revisit whether 20 pages is the right backstop per site.

Follow-up from review feedback on #5434 (see #5434 (comment)).

Metadata

Metadata

Labels

area-integrationsIssues or features related to integrationsdebtTechnical debt

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions