At the moment we write this article, Bitbucket Server (former Stash) does not provide webhooks natively.
Without hooks, Codacy will have to fetch for updates on regular time intervals. This is not recommended if you want fast analysis and integration with the git flow.
Currently, there are some plugins available on Atlassian marketplace to allow webhooks: https://marketplace.atlassian.com/plugins/app/bitbucket/popular?category=Repository+hooks
For faster analysis, we suggest that you install a plugin that allows hooks to be sent on Commit and PR changes.
Most users recommend these two plugins:
- For Commit Hooks: https://marketplace.atlassian.com/plugins/de.aeffle.stash.plugin.stash-http-get-post-receive-hook/server/overview
- For PR Hooks: https://marketplace.atlassian.com/plugins/se.bjurr.prnfs.pull-request-notifier-for-stash/server/overview
Since the plugins do not provide API access to this setup, this will have to be done manually by following the steps bellow:
- Gather the hooks information by going on Codacy > Project settings > Integrations > 'Post-Commit Hook'. You can also check the docs for more details https://support.codacy.com/hc/en-us/articles/214085885#manual-setup-of-post-commit-hook (*)
- Install the plugins and configure them to send hooks to Codacy.
(*) There's an automatic setup toggle button. Try to click it. It will fail and will show a URL that you can use to setup hooks manually on your plugin.