I'm having TeamCity connected to Bitbucket Server and for some reason some of build statuses haven't been visible. After some investigation with wireshark and postman I've found out that commit-status-publisher pushes to bitbucket information about branch (https://docs.atlassian.com/bitbucket-server/rest/7.4.0/bitbucket-rest.html#idp219). In our project we use full gitflow with forks so pull requests to upstream are made from forks. So in our case commit-status-publisher pushes to bitbucket information about build status with wrong ref:
"ref": "refs/pull-requests/<PR number>/from"
In this case it really is the branch that was builded but Bitbucket itself don't show status of this build based on this branch but based on original branch (from someone's fork). If you just remove this one line from message body and push commit status again it works as intended.
Second thing I've noticed is that as build key in bitbucket api you always use build configuration key form teamcity which means that if you've builded 1 pull request 3 times after each change, in bitbucket you see only one (latest) build status because you are overwriting same build status over and over.
So I thought that waiting for someone to replicate my problem and fixing it will take much longer than solving it by myself. In the end it turns out I was wrong. I've found code responsible for this issue. Fixed that (2 line fix) and wanted to compile it...
And here comes the nightmare part. Since I'm .Net dev I have no knowledge about java environment and IDE. I've followed instructions in:
And to be honest each of them gives me different errors and non of them works as intended. Is there any up to date documentation that can be followed to compile this plugin?