public PullRequest getPullRequest()

in commit-status-publisher-server/src/main/java/jetbrains/buildServer/commitPublisher/stash/StashPublisher.java [524:552]


    public PullRequest getPullRequest(BuildRevision revision, @NotNull String buildDescriptor) {
      AtomicReference<PullRequest> result = new AtomicReference<>(null);
      try {
        String url = getPullRequestEndpointUrl(revision);
        if (url == null) {
          LOG.warn("No endpoint URL is provided to get pull requests for revision " + revision.getRevision());
          return null;
        }
        LoggerUtil.logRequest(getId(), HttpMethod.GET, url, null);
        IOGuard.allowNetworkCall(() -> HttpHelper.get(url, getCredentials(revision.getRoot()), null, DEFAULT_CONNECTION_TIMEOUT, getSettings().trustStore(), new DefaultHttpResponseProcessor() {
          @Override
          public void processResponse(HttpHelper.HttpResponse response) throws HttpPublisherException, IOException {
            super.processResponse(response);
            final String json = response.getContent();
            if (null == json) {
              throw new HttpPublisherException("Stash publisher has received no response");
            }
            PullRequest pullRequest = myGson.fromJson(json, PullRequest.class);
            if (null == pullRequest) {
              throw new HttpPublisherException("Stash publisher has received a malformed response");
            }
            result.set(pullRequest);
          }
        }));
      } catch (Exception e) {
        myProblems.reportProblem("Can not get pull request", StashPublisher.this, buildDescriptor, null, e, LOG);
      }
      return result.get();
    }