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?
Hi @Yak Hawkes
For commit statuses to show on the pull request page the following criteria needs to be met:
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.