Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,294,621
Community Members
 
Community Events
165
Community Groups

Builds not appearing in pull requests

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 Sep 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.

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
Mark C Atlassian Team Aug 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

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 Aug 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

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,158 views 2 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you