Skip to content

Commit 9bd998b

Browse files
committed
CQI Add official (or sound similar to) documentation found about how to value refname in build statuses for Bitbucket Cloud.
1 parent 7d026be commit 9bd998b

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/main/java/com/cloudbees/jenkins/plugins/bitbucket/impl/notifier/BitbucketBuildStatusNotifications.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketApi;
3535
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketBuildStatus;
3636
import com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient;
37+
import com.cloudbees.jenkins.plugins.bitbucket.impl.util.BitbucketApiUtils;
3738
import edu.umd.cs.findbugs.annotations.CheckForNull;
3839
import edu.umd.cs.findbugs.annotations.NonNull;
3940
import edu.umd.cs.findbugs.annotations.Nullable;
@@ -219,16 +220,12 @@ private static void sendNotifications(BitbucketSCMSource source, Run<?, ?> build
219220
PullRequestSCMHead head = (PullRequestSCMHead) rev.getHead();
220221
key = getBuildKey(build, head.getOriginName(), shareBuildKeyBetweenBranchAndPR);
221222
/*
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()) ??
230227
*/
231-
refName = null; // "refs/pull-requests/" + head.getBranchName();
228+
refName = null;
232229
bitbucket = source.buildBitbucketClient(head);
233230
} else {
234231
listener.getLogger().println("[Bitbucket] Notifying commit build result");

0 commit comments

Comments
 (0)