Uploaded image for project: 'Bitbucket Cloud'
  1. Bitbucket Cloud
  2. BCLOUD-20910

"Next" URL response for repository variables and deployments endpoints are incorrect

XMLWordPrintable

      Issue Summary

      When querying for repository variables and deployments on a repository wit additional results, you will get a pagination with a next URL to query the remaining results.

      However, for repository variables endpoint, it is providing an incorrect URL such as:

      OR

      Although the URL endpoint is clearly incorrect, using it throws the following error:
      {
      "error": {
      "data": {
      "arguments": {},
      "key": "rest-service.rest-service.unauthorized"
      },
      "detail": "No authorization provider header specified.",
      "message": "Unauthorized"
      }
      }

      Steps to Reproduce

      Repository variables:

      1. Create more than 10 repository variables on a repository
      2. Run the GET API for /pipelines_config/variables/
      3. Check the "Next" URL given by the above API

      Deployments

      1. Create multiple deployments in a repository
      2. User the GET method on the /2.0/repositories/workspace/repos_slug/deployments/ endpoint
      3. Check the "Next" URL given by the above API

      Expected Results

      The next URL would be given for the /pipelines_config/variables/ or /deployments/ endpoints.

      Actual Results

      The next URL is given for /rest/1.0/accounts/ or /rest/2.0/accounts/ endpoints.

      Workaround

      The workaround is to add a larger pagelen to get the results without the use of the "Next" URL.
      Example:

      curl -X GET -u $USERNAME:$APP_PASSWORD "https://api.bitbucket.org/2.0/repositories/$WORKSPACE_ID/$REPO__SLUG/pipelines_config/variables/?pagelen=100"
      

              Unassigned Unassigned
              fstefanelli@atlassian.com Felipe S. (Inactive)
              Votes:
              17 Vote for this issue
              Watchers:
              14 Start watching this issue

                Created:
                Updated:
                Resolved: