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

XMLWordPrintable

    • 1
    • Severity 3 - Minor

      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+

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

            Assignee:
            Stanley Su
            Reporter:
            Themis
            Votes:
            3 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: