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

Performing filtering against the /2.0/repositories API using full commit hash fails for PR builds

    XMLWordPrintable

Details

    Description

      Issue Summary

      • When performing an API filtering query such as the one below against a PR build using the full commit hash, the API call fails to retrieve results:
        https://api.bitbucket.org/2.0/repositories/{workspaceID}/{reposlug}/pipelines?target.commit.hash={fullcommithash} 
        
      • If the same query is performed using the full commit hash against a build that is unrelated to a PR, results are successfully returned
      • To retrieve results for a PR build, the short version of the hash (12 characters) must be used which is inconsistent with other builds - it is not possible to use one type of commit hash across all types of Pipelines builds
      • The root cause of this is that Pipelines uses the PR API to calculate commit hash value, which is shorter
      • This is something that will need to be fixed due to future concerns about potential hash collisions

      Steps to Reproduce

      1. Use the full commit hash when querying a PR build, the query fails to return results
      2. Using the short hash instead when querying a PR build, the query returns results

      Expected Results

      • It should not matter what kind of hash is used, results should be returned regardless of build type

      Actual Results

      • There is inconsistency when querying the API due to differences in hash calculation between build types

      Workaround

      • Currently, the only way to return results is to use long hash for non-PR builds and short hash for PR builds

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              57b7f67f3625 Ben
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: