We were having issues getting bitbucket tags to trigger a build. We were adding them to our commits from bitbuckets website, but it didn’t trigger a build until we tried the command line git to push a tag. Is that expected? (Email support asked me to raise here)
Thanks for reporting @alan_haverty - I already created an internal ticket for this, we’ll try to investigate it ASAP!
In the meantime if you have the time, could you please describe where you created the tag on the Bitbucket UI? Also, did you try to create the same tag on Bitbucket UI and then in git, or did you create different ones? (in which case it might be related to your tag trigger pattern)
Hey @alan_haverty!
Just started to test this, and I’ve encountered the following:
- I created a fresh repo
- Created and committed a README.md
- I’ve added
testtag
tag to this commit / There I’ve seen no build triggered at all
(anyway… I continued the discovery) - I’ve created and committed a file
test
with the contenttest
-> then I’ve noticed that bitbucket created a branch with the nametesttag
and mytest
file committed there - Then I wanted to merge
testtag
(with the filetest
) branch tomaster
(with the file README.md) - Merge failed well enough because now I have a master branch tagged with
testtag
WITHOUT the test file and it’s commit and I’ve losttesttag
branch as well. So I lost a file within a small couple of seconds test.
It seems like bitbucket does something very differently when you want to create a tag online.
I keep trying to find your issue, but for now Bitbucket seems to be the issue itself.
Thanks @tamaspapik @viktorbenei,
I’m new to tags to be honest, and if I can get away with using UI over CLI these days I do.
However, the Git tag command works well, and is probably the smarter solution anyway.
Thanks for testing!
Issue discovered!
When a tag added online, Bitbucket’s request doesn’t send changes[]
{
"push": {
"changes": [] <---
},
"repository": {
...
From git command:
{
"push": {
"changes": [
{
"forced": false,
"old": null,
"links": {
"commits": {
...
Thank you for the report @alan_haverty
Checked around, we don’t have anything to fix in this case. Simply Bitbucket sends 0 trigger information to Bitrise.
To get notified when the issue is resolved, please follow the following Bitbucket issue:
https://bitbucket.org/site/master/issues/13865/creating-tags-from-the-ui-sends-two-empty
Hope they will fix it asap!
Just to be precise, not just to Bitrise: the Bitbucket webhook sent to any service does not include any “change” info when the tag is created on the Bitbucket.org UI.
Which means that we have to ignore that webhook request, because there actually is no info in the webhook what changed / what happened. It’s just an empty “changes” array.
It looks like tags aren’t triggering bitrise via CLI created tags anymore now either. I’m assuming it’s bitbucket being bitbucket, but just an FYI in case it’s not.
@alan_haverty can you please check the webhook history on bitbucket to see if bitbucket sent any webhook for the event (I’d suggest you to open the webhook history there, then create a new tag and see if there’s a new item in the history)? The response from bitrise.io should be there too, stating the reason why it did not start a build in case it would not start a build. Further webhook related troubleshooting (guide): http://devcenter.bitrise.io/webhooks/troubleshooting/
Hi @viktorbenei Just want to confirm it was the webhook that was off. Tagging items via Bitbucket website is also triggering Bitrise builds, so the original issue is resolved. Thanks for the help
Awesome, thanks for reporting @alan_haverty!