Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

build status update from 3rd party application

I am trying to provide a build status from Jenkins to Bitbucket. I read that it could be done with the bitbucket-build-status-notifier-plugin 

I configured it according to the instruction and it seems to be doing something. I see a message in the job's log that bitbucket was successfully notified. 

Sending build status SUCCESSFUL for commit a30b981af8e09be2ed4aebfe70294d356f0e6ca4 to BitBucket is done! Finished: SUCCESS

Though, there is no build status appeared for my branch


When I see the scrinshot from the plugin page, I see that the build statuses on the commit level bb_old.jpg
Currently Bitbucket have build status on the branch level and does NOT have them on commit level.

bb_new.jpgIs it possible that the Jenkins plugin uses outdated API?

Could anyone point me to the up to date Bitbucket API for updating build status? I fund this question with an answer, but the link does not work for me.

Any help is appreciated.
Thanks in advance

 

1 answer

1 accepted

2 votes
Answer accepted

Hello @Pavel,

Thanks for reaching out.

The plugin for Jenkins seems to be working fine: I can see few build statuses registered for commit a30b981af8e09be2ed4aebfe70294d356f0e6ca4 you mentioned.

Currently Bitbucket have build status on the branch level and does NOT have them on commit level.

Not quite, both views have build statuses. However, Commits view shows Builds column only when there's a build status for at least one of the commits in the list, otherwise that column doesn't show up. Build status is also shown in the single Commit view.

As for the branches view, the build appearing there is the one for the tip commit of the branch. So my guess is that the commit in question (a30b981af8e09be2ed4aebfe70294d356f0e6ca4) is not a tip of any branch in your repository. Can you confirm this? I couldn't see build statuses registered for any other commits in your repository as well.

So, here's what I suggest to check:

  • build status appears on the single Commit view (example)
  • build status appears on Commits view when that commit is in range of the list shown (example)
  • create a branch pointing to the commit in question or register another build status against some other commit that is a tip of one of the branches, then check that build status appears on the Branches view (example)

Could anyone point me to the up to date Bitbucket API for updating build status?

Here's the endpoint to create builds status, and this one to update/delete an existing build status.

Hope this helps. Let me know if you have any questions.

Cheers,
Daniil

Hi @Daniil Penkin

thank you so much for your reply. In fact the issue was(and unfortunately still is) in a completely different place. The problem is with the fact that git commit number is wrong. And that was the reason I did not see the status updates. Cause the update was done for a commit that was even deleted from the repository.

I checked the web-hook, it sends correct information in the post. Though for some reason Jenkins start a build for a completely different commit and subsequently sends  notification for a wrong commit. As the commit was already removed I saw no status update at all.

I provided a temporary fix and now I see the status update. 

Well now I have to look into the git plugin probably, but this is a completely different story.

Thank you again for your support. You pointed me to the right direction. 

Take care

Like Daniil Penkin likes this

Suggest an answer

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

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

1,826 views 0 7
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