Dharmik Gupta created NIFI-16040:
------------------------------------

             Summary: BitbucketRepositoryClient#getBranchesCloud only returns 
first page of branches from Bitbucket Cloud
                 Key: NIFI-16040
                 URL: https://issues.apache.org/jira/browse/NIFI-16040
             Project: Apache NiFi
          Issue Type: Bug
          Components: Extensions
    Affects Versions: 2.10.0, 2.9.0, 2.8.0
         Environment: 1. Apache NiFi 2.8.0
2. Bitbucket Cloud
3. BitbucketFlowRegistryClient
4. Repository contains 15 branches
            Reporter: Dharmik Gupta


When selecting a branch in the Version Control dialog, only the first 10 
branches are displayed.

The branches shown appear to be the first page returned by the Bitbucket Cloud 
API and are ordered alphabetically. Additional branches that exist in Bitbucket 
Cloud are not available for selection in NiFi.

*Steps to Reproduce*
 # Create a Bitbucket Cloud repository with more than 10 branches.
 # Configure a BitbucketFlowRegistryClient.
 # Open Version Control or Change Version in NiFi.
 # Observe that only the first 10 branches are available.

*Expected Behavior:* All branches should be listed.

*Actual Behavior:* Only the first page of branches is listed.

*Root Cause:*

The implementation of BitbucketRepositoryClient#getBranchesCloud()
 performs a single request to:
{code:java}
/2.0/repositories/{workspace}/{repo}/refs/branches{code}
and processes only the _*"values"*_ array.

The method does not follow the Bitbucket Cloud pagination field "next".

Other methods in the same class already support pagination through 
getPagedResponseValues(), but getBranchesCloud() does not use it.

*Proposed Fix:*

Update getBranchesCloud() to use getPagedResponseValues()
 or otherwise follow the "next" pagination links returned by Bitbucket Cloud.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to