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

Want to create pre-commit (pre-receive) validation hook for BitBucket cloud

madkins-igt October 5, 2017

We have had several issues due to users editing configuration files in BitBucket (interavctively) and leaving malformed results. We would like to install some sort of validation for these files to prevent them from being accepted. The libraries that would do the validation are easily available in Java but would have to be duplicated from scratch for a non-JVM language.

I spent several days constructing a hook according to available documentation. I tested it by downloading a copy of BitBucket onto my development host and it failed immediately. After sorting out the small amount of accurate documentation from the vast amount of incorrect and/or outdated documentation I finally got it working.

At this point I passed it on to our BitBucket administrator for installation. Of course it didn't work because we are using BitBucket in the cloud which is vastly different from the version I downloaded. It has no place to upload a JAR and apparently wants webhooks, so now I'm figuring I must spin up a server to do something that actually takes two dozen lines of Java.

Worse yet, I'm not seeing any documentation on using webhooks for pre-commit validation. From some other things I've read online it seems like these hooks are designed to notify another application that something has changed. The only "example code" I can find written in Java is two years old.


Is this even possible? If so, is there some example code somewhere, preferably in Java?

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events