ShivamSharma43 opened a new pull request, #9373:
URL: https://github.com/apache/devlake/pull/9373

   ### Summary
   
   The Bitbucket Cloud `Collect PR Commits` subtask stopped after the first 
page of each pull request's commits.
   
   Its query sets `fields` to a list of `values.*` keys only. Bitbucket's 
partial response returns just the listed fields, so the response had no 
top-level `next`. `GetNextPageCustomData` in `tasks/api_common.go` reads `next` 
and returns `api.ErrFinishCollect` when it is empty, so on a full first page 
(100 commits) the collection ended. Pull requests with more than 100 commits 
were cut off at 100.
   
   Checked against the public API (`pagelen=2` on a PR with 6 commits): with 
`fields=values.hash` the response is only `{"values": [...]}`; with 
`fields=values.hash,next` it includes `"next": 
".../commits?pagelen=2&fields=values.hash%2Cnext&page=E8Ux"`. Details in #9372.
   
   Changes:
   
   - `tasks/pr_commit_collector.go`: add `next` to the `fields` list. The query 
closure moves into `getPrCommitsQuery`, unchanged apart from that.
   - `tasks/pr_commit_collector_test.go` (new): builds the query, filters a 
sample response to the requested top-level fields the way Bitbucket does, and 
checks that `GetNextPageCustomData` returns the next page token and that the 
next query sends it as `page`. It fails without the fix.
   
   The raw table, extractor and converter are unchanged.
   
   ### Does this close any open issues?
   
   Fixes #9372
   
   ### Screenshots
   
   N/A
   
   ### Other Information
   
   - `go test ./plugins/bitbucket/tasks/`: pass.
   - `go vet ./plugins/bitbucket/tasks/ ./plugins/bitbucket/impl/`, `gofmt` and 
`golangci-lint run ./plugins/bitbucket/tasks/...`: clean. (`go vet 
./plugins/bitbucket/...` needs the generated mockery mocks for 
`plugins/bitbucket/api`, which aren't in the tree.)
   - No open PR or issue touches the Bitbucket PR commits collector.
   - Suggested label: `pr-type/bug-fix`.
   - AI assistance disclosure: this change was prepared with the help of Claude 
Code (Claude Opus 5.5), and I reviewed the diff. 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]

Reply via email to