Repository navigation
fix(bitbucket): follow next when collecting pull request commits - #9373
Open
ShivamSharma43 wants to merge 1 commit into
Open
ShivamSharma43 wants to merge 1 commit into
ShivamSharma43 wants to merge 1 commit into
Conversation
The PR commits query set a fields filter with only values.* keys. Bitbucket returns only the listed fields, so the response had no next, and GetNextPageCustomData ended the collection after the first page. Pull requests with more than 100 commits were cut off at 100. Add next to the fields list and move the query into getPrCommitsQuery with a unit test. Fixes apache#9372 Generated-by: Claude Code (Claude Opus 5.5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Shivam Sharma <192242476+ShivamSharma43@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Bitbucket Cloud
Collect PR Commitssubtask stopped after the first page of each pull request's commits.Its query sets
fieldsto a list ofvalues.*keys only. Bitbucket's partial response returns just the listed fields, so the response had no top-levelnext.GetNextPageCustomDataintasks/api_common.goreadsnextand returnsapi.ErrFinishCollectwhen 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=2on a PR with 6 commits): withfields=values.hashthe response is only{"values": [...]}; withfields=values.hash,nextit includes"next": ".../commits?pagelen=2&fields=values.hash%2Cnext&page=E8Ux". Details in #9372.Changes:
tasks/pr_commit_collector.go: addnextto thefieldslist. The query closure moves intogetPrCommitsQuery, 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 thatGetNextPageCustomDatareturns the next page token and that the next query sends it aspage. 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/,gofmtandgolangci-lint run ./plugins/bitbucket/tasks/...: clean. (go vet ./plugins/bitbucket/...needs the generated mockery mocks forplugins/bitbucket/api, which aren't in the tree.)pr-type/bug-fix.Generated-by:trailer per the ASF generative tooling guidance.🤖 Generated with Claude Code