Required Builds Merge Check searches builds status and streams PR commits before evaluating if any conditions apply

XMLWordPrintable

    • 1
    • Severity 3 - Minor
    • 6

      Issue Summary

      The bundled Bitbucket Required Builds merge check performs build status lookup and streams pull request commits before checking whether any Required Builds conditions apply to the pull request.

      Steps to Reproduce

      1. Enable profile logging for Bitbucket
      2. Create a PR for a sample repo
      3. Open the PR or call PR mergeability API for a pull request, for example:
        GET /rest/api/1.0/projects/{projectKey}/repos/{repoSlug}/pull-requests/{prId}/merge
        
      4. Observe that the Required Builds merge check still performs build-status search and PR commit streaming from the profiler logs

      Example profiler pattern:

        com.atlassian.bitbucket.server.bitbucket-build:specificRequiredBuildMergeCheck#preUpdate
          void com.atlassian.bitbucket.pull.PullRequestService.streamCommits(...)
            void com.atlassian.stash.internal.scm.git.mesh.RpcPullRequestClient.getCommits(...)
      

      Expected Results

      If no Required Builds conditions apply to the repository or pull request, the Required Builds merge check should not call build status search and stream PR commits.

      Actual Results

      The Required Builds merge check calls build status search first even when no Required Builds conditions are configured for a repo, performing unnecessary operations related to build status search and streaming commits.

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

              Assignee:
              Ben Humphreys
              Reporter:
              JP Mariano
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: