ShivamSharma43 opened a new issue, #9306: URL: https://github.com/apache/devlake/issues/9306
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/devlake/issues?q=is%3Aissue) and found no similar issues. ### What happened On a Tempo connection whose Tempo instance has more than 50 teams, only the first 50 teams can ever be reached: - **Data scope picker** (`GET /plugins/tempo/connections/{id}/remote-scopes`): the list shows the first 50 teams and never offers a next page, so team #51 onwards can't be selected by browsing (only by typing its name into search). - **`collect-teams` subtask**: collects only the first page (50 teams) on every run. Both places in `backend/plugins/tempo` compute the page count from `metadata.total`: - `api/remote.go` `listTempoRemoteTeams`: `if page.Offset+page.Limit < response.Metadata.Total { nextPage = ... }` - `tasks/team_collector.go` `GetTotalPages`: `(response.Metadata.Total + args.PageSize - 1) / args.PageSize` but `GET /4/teams` doesn't return a total. Per the official OpenAPI spec (`https://apidocs.tempo.io/tempo-openapi.yaml`), the response is `PageableTeam`, whose `metadata` is `PageableMetadata` = `count`, `limit`, `next`, `offset`, `previous`. `total` therefore unmarshals as 0: - in `listTempoRemoteTeams`, `offset + limit < 0` is never true → `nextPage` is always nil; - in `CollectTeams`, `GetTotalPages` returns 0 → the API collector fetches page 1 and stops. This is the same root cause as the worklog pagination in #9163 (fixed by #9164 for worklogs only). ### What do you expect to happen All teams are listed in the data scope picker (following `metadata.next`), and `collect-teams` collects every page. ### How to reproduce 1. Have a Tempo Cloud instance with more than 50 teams. 2. Create a Tempo connection and open "Add Data Scope" (or `GET /plugins/tempo/connections/1/remote-scopes`). 3. Only 50 teams are returned and `nextPageToken` is empty. 4. Run a blueprint with a Tempo team scope: `SELECT url FROM _raw_tempo_api_teams` shows a single request with `offset=0`, and `_raw_tempo_api_teams` has at most 50 rows. ### Anything else Proposed fix (I have a PR ready): - `listTempoRemoteTeams`: return a next page when `metadata.next` is set, instead of comparing against `total`. - `CollectTeams`: drop `GetTotalPages` so the collector uses the helper's undetermined mode and fetches pages until one comes back short, like the worklog collector after #9164. - Unit test for the remote listing pagination. ### Version main ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
