[Bug][Testmo] Runs, milestones and automation runs: only the first 100 are collected
维护者通常 2 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- go
调研方向
从 backend/plugins/testmo/tasks/shared.go 中的 GetTotalPagesFromResponse 开始,并将其分页解析方式与 backend/plugins/testmo/api/remote_api.go 中的 ProjectPage 进行比较。添加一个单元测试,使用 issue 中描述的顶层 last_page 响应,然后验证函数返回 3(并将 null 值处理为 1)。当 runs、milestones 和 automation runs 能够通过 last_page 请求页面时,工作即告完成。
由索引模型根据 Issue 内容生成。
描述
Search before asking
- I had searched in the issues and found no similar issues.
What happened
The Testmo collectRuns, collectMilestones and collectAutomationRuns subtasks only collect the first page (100 items) of a project.
They all use GetTotalPagesFromResponse in backend/plugins/testmo/tasks/shared.go, which reads the page count from meta.total_pages:
body := &models.TestmoResponse{} // data, links, meta, errors
...
if meta, ok := body.Meta.(map[string]interface{}); ok {
if totalPages, exists := meta["total_pages"]; exists { ... }
}
return 1, nil
Testmo list responses have no meta object. The pagination fields are at the top level of the body: the Testmo REST API spec (RunPage, MilestonePage, AutomationRunPage) lists page, prev_page, next_page, last_page, per_page, total and result. The plugin's own remote scope API already reads this format (ProjectPage in backend/plugins/testmo/api/remote_api.go follows next_page). So meta is always nil, the function always returns 1, and the ApiCollector never requests page 2.
What do you expect to happen
All runs, milestones and automation runs of the project are collected, i.e. the collectors fetch pages 2..last_page.
How to reproduce
- Add a Testmo project with more than 100 runs (or milestones / automation runs) as a data scope.
- Run the blueprint.
_raw_testmo_runs(and_tool_testmo_runs) hold only 100 rows for the project, while the project'srun_countis higher.
A unit test that passes {"page": 1, "next_page": 2, "last_page": 3, "per_page": 100, "total": 250, "result": [...]} to GetTotalPagesFromResponse gets 1 instead of 3.
Anything else
Proposed fix (I have a PR ready): read the top-level last_page in GetTotalPagesFromResponse (1 when it is null), plus a unit test.
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][Tempo] Worklog domain ids lack the connection id, so connections with the same worklog id overwrite each other可能已有人在做 @ShivamSharma43 今天认领。 未关闭
难度 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 天内回复
-
[Bug][JIRA Service API TOKEN] Jira API Gateway: saved service-account token truncated by varchar(255), causing Base64 errors and HTTP 500可能已有人在做 @RyoKusnadi 今天认领。 未关闭type/bug
难度 3/5 1-2 天 新手友好度 58/100
维护者通常 2 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 65/100
SAP/crossplane-provider-btp#1175 ·
维护者通常 1 天内回复
-
adk: stream concatenation errors bypass retry and failover可能已有人在做 @OUAO-FRANK 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
google/osv-scalibr#2586 ·
维护者通常 2 天内回复
-
needs-triage
难度 2/5 1-3 小时 新手友好度 72/100
stacklok/toolhive-catalog#1890 ·
维护者通常 1 天内回复
-
heap: pushing an item that is already queued corrupts the index可能已有人在做 @lbarrosby 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
kubernetes-sigs/kwok#1800 ·
维护者通常 1 天内回复