Skip to content

[JENKINS-75083] Build statuses do not appear in list of pull requests in Bitbucket Server #954

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,20 @@
* Poor documentation for bitbucket cloud at:
* https://community.atlassian.com/t5/Bitbucket-questions/Re-Builds-not-appearing-in-pull-requests/qaq-p/1805991/comment-id/65864#M65864
* that means refName null or valued with only head.getBranchName()
* For bitbucket server refName set to null or ... (refs/heads/ + head.getBranchName()) ??
*
* For Bitbucket Server, refName should be "refs/heads/" + the name
* of the source branch of the pull request, and the build status
* should be posted to the repository that contains that branch.
* If refName is null, then Bitbucket Server does not show the
* build status in the list of pull requests, but still shows it
* on the web page of the individual pull request.
*/
refName = null;
bitbucket = source.buildBitbucketClient(head);
if (BitbucketApiUtils.isCloud(bitbucket)) {
refName = null;
} else {
refName = "refs/heads/" + head.getBranchName();

Check warning on line 238 in src/main/java/com/cloudbees/jenkins/plugins/bitbucket/impl/notifier/BitbucketBuildStatusNotifications.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 235-238 are not covered by tests
}
} else {
listener.getLogger().println("[Bitbucket] Notifying commit build result");
SCMHead head = rev.getHead();
Expand Down