Repository navigation
fix(tempo): paginate teams with metadata.next instead of a missing total - #9307
Merged
Merged
Conversation
Tempo v4 GET /4/teams returns PageableMetadata (count, limit, offset, next, previous) without a total, so metadata.total unmarshalled as 0: - listTempoRemoteTeams never returned a next page, so the data scope picker only listed the first 50 teams; follow metadata.next instead. - CollectTeams' GetTotalPages returned 0, so only the first page of teams was collected; drop it so the collector fetches pages until one comes back short, like the worklog collector. Closes apache#9306 Generated-by: Claude Code (Claude Opus 5.5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Shivam Sharma <192242476+ShivamSharma43@users.noreply.github.com>
klesh
approved these changes
Nov 3, 2026
klesh
left a comment
Contributor
There was a problem hiding this comment.
LGTM
Thanks for your contribution.
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.
Summary
Tempo team pagination read
metadata.total, butGET /4/teamsdoesn't return a total (itsmetadataisPageableMetadata=count,limit,next,offset,previousper the Tempo OpenAPI spec).totalunmarshalled as 0, so only the first 50 teams were ever reached. This is the same root cause as #9163, which #9164 fixed for worklogs only.Changes:
api/remote.golistTempoRemoteTeams: return a next page whenmetadata.nextis set, instead ofoffset + limit < total(always false). The data scope picker now lists teams beyond the first 50.tasks/team_collector.go: dropGetTotalPages(it returned 0, so the collector stopped after page 1). The collector now uses the helper's undetermined mode and fetches pages until one comes back short, like the worklog collector after fix(tempo): paginate worklog collection, honour the sync range, and emit ids that join jira #9164.api/remote_test.go: new unit test for the remote listing: followsnextwith the right offset, stops on the last page (nonext).No model, migration or API-surface changes (so no swagger regeneration).
Does this close any open issues?
Closes #9306
Screenshots
N/A
Other Information
go build/go vet/gofmtclean for./plugins/tempo/....go test ./plugins/tempo/api/ ./plugins/tempo/tasks/: pass. The new test fails onmain(nextPageis nil on the first page).plugins/tempo/e2eneeds a liveE2E_DB_URLdatabase, which I didn't run locally; the team extractor e2e is unaffected by this change (it only reads raw rows).pr-type/bug-fix.Generated-by:trailer per the ASF generative tooling guidance.🤖 Generated with Claude Code