Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Builds not appearing in pull requests

Yak Hawkes August 13, 2021

I have setup a build system in Google Cloud Build which is triggered on Commit.

The status of the build is sent back to BitBucket using the API 
'https://api.bitbucket.org/2.0/repositories/${username}/${repo_slug}/commit/${commitSha}/statuses/build`

This is working great and I can see the status and link back to the builds from main repo page and the branches page. But when I create a Pull Request from the link on the branches page it always shows 0 builds. Including when pushing new commits to the branch, which do appear on the branches page.

In the same Workspace there were already repo configured to use Bamboo for builds.

Can there be a conflict between the repos even though Bamboo nor any pipelines have been configured on my repos?

3 answers

1 accepted

1 vote
Answer accepted
seanaty
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 15, 2021

Hi @Yak Hawkes

For commit statuses to show on the pull request page the following criteria needs to be met:

  • the commit has of the commit status matches the current commit has of the source PR branch
  • if the commit status refname is null or it matches the branch name of the source branch.

Double check that the refname you're using to create the commit status are either null or that if they are set, the match the branch names that the correspond to.

Yak Hawkes September 15, 2021

Yep, the script I was using was setting the refname to `buildTriggerId: ${message.buildTriggerId}`
As soon as I changed it to the branch name the build status appeared on the Pull Request :D 

0 votes
Yak Hawkes August 25, 2021 edited

.

0 votes
Mark C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 25, 2021

Hi @Yak Hawkes,

Thank you for reaching out to the community.

The API endpoint you've provided is updating your commit's build status.
For this, there shouldn't be a conflict when you update your commit's build status.
Because regardless of what you integrate into your repository (e.g. Bamboo, Pipelines, or Google Cloud Build) all statuses will be listed in your commit's status.

Would it be possible for you to check if you're successfully sending the API endpoint to update your Bitbucket Cloud's repository commit after creating a PR from the Branch page and making a commit?

Regards,
Mark C

Yak Hawkes August 25, 2021

Hi Mark,


I created a test branch with a commit and pushed that to one of our repositories. I could see the successful build in the branches page and on the list of commits on Create Pull Request page.


One the PR was created there are 0 builds shown to the right of the page and none in the list of commits.


I made another commit, push that to the same branch and can see the in-progress and successful build status appear on the repository's commits page.


But still on the test PR it show 0 builds on the right on the page and no build status in the list of commits (nor is there a heading for Builds in the commits list on the PR page.

 

Thanks for your help

Yak

Mark C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 25, 2021

Hi @Yak Hawkes

Thank you for that information.
For us to fully investigate and check the issue, I went ahead and created a support request on your behalf.
You should receive an email with this and we'll contact you to work on this case.

Please let me know if you have any questions.

Regards,
Mark C

sprenger_s
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 6, 2025

This problem also appears in our Bitbucket Cloud Version. The Builds from our Jenkins server are correct on the Commit or Branch page, but not on the pull request page they are empty. This happens first since some days before Christmas 2024.

Agnes Mueni
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 11, 2025

Facing the same issue with pull request not having any builds but push to branch has builds. We are using 2nd Gen repos with bitbucket cloud version.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events