[Editor’s Note: We’re starting a new series on this blog, called Jixee Hotfix. It will feature real problems that our engineering team encounter on a weekly basis and the solutions they come up with to this it. Posts are written by the engineers encountering the problems. This post was written by our Sr. Engineer, John Sykes.]
This week we encountered an issue with one of our users concerning our Bitbucket integration. He was able to log in and integrate his account just fine, but things went wrong with the addition of certain repositories.
Our first suspicion was that the name was entered incorrectly. What we do at Jixee is utilize an owner / repository name to ensure unique values in our database. When Bitbucket was initially added, our best solution to unique data was this owner / repository name format. We knew that there could be multiple repositories that could have the same name in the world, but we found that Bitbucket does not allow duplicate repositories within the same account. So this was our key.
You’re probably thinking “just use an ID!”
The interesting thing about this was that Bitbucket did not supply a repository ID and at of the time we added this feature, there was no way to get it. This must of been a design/security decision by Atlassian OR something we somehow overlooked.
Our initial hotfix was to have better wording on our site to specify the type of format that is required for adding Bitbucket repositories.
We informed our customer of this fix and got a response back saying it didn’t work. We discovered with further investigation that the names were being entered correctly. The next solution was to check permissions and our error message that we are giving our users for this scenario. This is where we found the root to our issue.
Our error message was too generic. As part of our hotfix we had to better handle the permissions issues Bitbucket was telling us for these repository adds. The result was a clearer message as to why adding this repo has failed. The main reason? User permissions.
Jixee’s approach to Bitbucket integration is simplification for the user. When an account is integrated and a repository is added, Jixee will add a webhook for you to the repository and all pushes to that repo will now also forward to Jixee so we can integrate data to specific tasks related to code pushes. There is no copy/paste of a link that you need to worry about in your Bitbucket settings, we do it for you.
The root lesson of this post is that the account that you integrate with Jixee, is the account Jixee will use to aid in integration. That means if you are part of a repository but do not have permissions to add webhooks yourself, Jixee will also be unable to do so. With clearer UI and user feedback, we were able to improve our communication to the end user so any setbacks and ticket sending can be reduced.