[Bug][Tempo] GET /connections/{id}/teams always fails to decode the teams page, and remote scope search only sees the first 50 teams
维护者通常 2 天内回复
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 25/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- go
调研方向
Start with backend/plugins/tempo/api/connection.go (GetTeams) and api/remote.go (searchTempoRemoteTeams); compare their requests with listTempoRemoteTeams and the collectors, which already follow metadata.next. Add coverage using a fake API client for multiple response pages. Done means GetTeams returns every team and remote scope search considers all matching teams; linked PR #9321 is already open.
由索引模型根据 Issue 内容生成。
描述
Search before asking
- I had searched in the issues and found no similar issues.
What happened
GET /plugins/tempo/connections/{connectionId}/teams (GetTeams in backend/plugins/tempo/api/connection.go) always fails with failed to unmarshal teams response.
It decodes the GET /4/teams response into []models.TempoTeamResponse, but Tempo v4 returns a page object (PageableTeam: self, metadata, results), not an array. On main (84e3707), decoding such a body with api.UnmarshalResponse into []models.TempoTeamResponse fails with error decoding response from https://api.tempo.io/4/teams: raw response: {"self":...,"metadata":{...},"results":[...]}. Even if it decoded, it would only return the first page (Tempo's default limit is 50).
The remote scope search (searchTempoRemoteTeams in api/remote.go, behind search-remote-scopes) has the same single-request issue. It sends one GET /4/teams?name=... without offset/limit, so it only looks at the first 50 teams the API returns. Its own page/pageSize paging then works on that list, so if more than 50 teams match, the later ones can't be found.
What do you expect to happen
GET /plugins/tempo/connections/{id}/teams returns every team of the Tempo instance, and the remote scope search looks at every matching team. Both should follow metadata.next like listTempoRemoteTeams and the collectors do since #9307.
How to reproduce
- Create a Tempo connection.
curl http://localhost:8080/plugins/tempo/connections/1/teams: the request fails withfailed to unmarshal teams response.
Anything else
Proposed fix (I have a PR ready): add a listAllTempoTeams helper in api/remote.go that pages through GET /4/teams with offset/limit until metadata.next is absent. Use it in GetTeams and in searchTempoRemoteTeams, and add unit tests with a fake API client.
Version
main
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
- 主要语言
- Go
- 星标
- 3.2k
- 派生
- 832
- 平均合并
- 1 天 21 小时
- 30 天内合并 PR
- 78
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/devlake 的其他 Issue
-
[Bug][Testmo] Runs, milestones and automation runs: only the first 100 are collected可能已有人在做 @ShivamSharma43 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复
-
[Bug][Tempo] Worklog domain ids lack the connection id, so connections with the same worklog id overwrite each other可能已有人在做 @ShivamSharma43 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复
-
[Bug][linker] LinkPrToIssue never matches lowercase issue keys (e.g. in branch names)可能已有人在做 @VictorColomb 于 4 天前认领。 未关闭type/bug
难度 2/5 1-3 小时 新手友好度 78/100
apache/devlake#9283 · 1 条评论 · 1 个 reaction · 已指派 1 人 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 60/100
维护者通常 2 天内回复
-
type/bug
难度 4/5 3-5 天 新手友好度 51/100
维护者通常 2 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
-
blocked-needs-validation bug
难度 1/5 1 小时以内 新手友好度 78/100
projectcapsule/capsule#2280 ·
维护者通常 1 天内回复
-
bug ready-for-agent
难度 2/5 1-3 小时 新手友好度 86/100
kerti/balances-v2#801 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
[BUG] AdvancedCronJob validating webhook reports incorrect field paths for concurrencyPolicy and pod templates可能已有人在做 @bhuvan-somisetty 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
openkruise/kruise#2650 ·
维护者通常 1 天内回复