|
34 | 34 | import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketApi;
|
35 | 35 | import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketBuildStatus;
|
36 | 36 | import com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient;
|
| 37 | +import com.cloudbees.jenkins.plugins.bitbucket.impl.util.BitbucketApiUtils; |
37 | 38 | import edu.umd.cs.findbugs.annotations.CheckForNull;
|
38 | 39 | import edu.umd.cs.findbugs.annotations.NonNull;
|
39 | 40 | import edu.umd.cs.findbugs.annotations.Nullable;
|
@@ -219,16 +220,12 @@ private static void sendNotifications(BitbucketSCMSource source, Run<?, ?> build
|
219 | 220 | PullRequestSCMHead head = (PullRequestSCMHead) rev.getHead();
|
220 | 221 | key = getBuildKey(build, head.getOriginName(), shareBuildKeyBetweenBranchAndPR);
|
221 | 222 | /*
|
222 |
| - * in case of pull request it's not clear at all how to value refname. The |
223 |
| - * bitbucket documentation does not help. Using values like |
224 |
| - * - refs/heads/PR-748; |
225 |
| - * - refs/pull-requests/748, |
226 |
| - * - refs/pull-requests/feature/test; |
227 |
| - * causes the build status disappear from the web page. |
228 |
| - * The only working value is null. If commit is used for two different |
229 |
| - * pull requests than you will get status doubled in both PRs |
| 223 | + * Poor documentation for bitbucket cloud at: |
| 224 | + * https://community.atlassian.com/t5/Bitbucket-questions/Re-Builds-not-appearing-in-pull-requests/qaq-p/1805991/comment-id/65864#M65864 |
| 225 | + * that means refName null or valued with only head.getBranchName() |
| 226 | + * For bitbucket server refName set to null or ... (refs/heads/ + head.getBranchName()) ?? |
230 | 227 | */
|
231 |
| - refName = null; // "refs/pull-requests/" + head.getBranchName(); |
| 228 | + refName = null; |
232 | 229 | bitbucket = source.buildBitbucketClient(head);
|
233 | 230 | } else {
|
234 | 231 | listener.getLogger().println("[Bitbucket] Notifying commit build result");
|
|
0 commit comments