ShivamSharma43 opened a new pull request, #9333: URL: https://github.com/apache/devlake/pull/9333
### Summary The Testmo `collectRuns`, `collectMilestones` and `collectAutomationRuns` subtasks only collected the first page (100 items) of a project. They use `GetTotalPagesFromResponse`, which read the page count from `meta.total_pages`. Testmo list responses have no `meta` object: per the Testmo REST API spec (`RunPage`, `MilestonePage`, `AutomationRunPage`), `page`, `prev_page`, `next_page`, `last_page`, `per_page` and `total` are top-level fields next to `result`. The plugin's remote scope API already reads them there (`ProjectPage` in `api/remote_api.go`). So the function always returned 1 and the `ApiCollector` never requested page 2. Changes: - `tasks/shared.go`: `GetTotalPagesFromResponse` reads the top-level `last_page`, and returns 1 when it is null or below 2. - `tasks/shared_test.go` (new): first page of three, a single page, and an empty result (`last_page: null`). `models.TestmoResponse` is no longer used by the collectors. I left it in place to keep the change small. ### Does this close any open issues? Closes #9332 ### Screenshots N/A ### Other Information - `go test ./plugins/testmo/...`: pass. The "first of several pages" case fails on `main` (expected 3, got 1). - `go vet`, `gofmt` and `golangci-lint run ./plugins/testmo/...`: clean. - No open PR touches the testmo plugin. - Suggested label: `pr-type/bug-fix`. - AI assistance disclosure: this change was prepared with the help of Claude Code (Claude Opus 5.5). I reviewed the diff and the Testmo API spec it relies on. The commit carries a `Generated-by:` trailer per the ASF generative tooling guidance. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
