Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-13673

Build status not displayed on the Pull Request list page when the new build API does not include a ref

    XMLWordPrintable

Details

    Description

      Issue Summary

      Build status is not displayed on the Pull Request list page when the new build API does not include a ref (from branch)
      This is reproducible on Data Center: yes

      Steps to Reproduce

      1. Create a pull request
      2. A build is fired associated with a commit in the PR
      3. The notification back to BB Server uses the new build API
        /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/builds
        

        and the body does not include a ref (such as refs/heads/branch)

        {
            "key": "TEST-3",
            "state": "SUCCESSFUL",
            "url": "https://bamboo.url/browse/TEST-3",
            "buildNumber": "3",
            "description": "test without ref",
            "duration": 1500000,
            "name": "build without a ref",
            "parent": "TEST",
            "testResults": {
                "failed": 0,
                "skipped": 0,
                "successful": 1
            }
        }
        

      Expected Results

      The build is shown on the PR Overview, PR builds, and PR list pages

      Actual Results

      The build is shown on the PR Overview, PR builds but NOT on the PR list page

      Workaround

      One would need to add the ref on the body of the notification

      {
          "key": "TEST-2",
          "state": "SUCCESSFUL",
          "url": "https://bamboo.url/browse/TEST-2",
          "buildNumber": "2",
          "description": "test without ref",
          "duration": 1500000,
          "name": "build with a ref",
          "parent": "TEST",
          "ref": "refs/heads/branch2",
          "testResults": {
              "failed": 0,
              "skipped": 0,
              "successful": 1
          }
      }
      

      Note: This affects only BB 7+versions. This behavior is not exhibited in BB 8+

      Attachments

        1. PR builds.png
          PR builds.png
          47 kB
        2. PR list.png
          PR list.png
          30 kB

        Issue Links

          Activity

            People

              c95a692b3157 Stanley Su
              tathanassiadou Themis
              Votes:
              3 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: