Skip to content

Add configuration option to disable automatic creation of Bitbucket Server webhooks

Created by: mrnugget

cc @sourcegraph/campaigns-core

Background (see Slack thread): user wants to create Bitbucket Server webhooks manually, because they don't want to give the Bitbucket Server token they use on Sourcegraph's side side admin rights (which we require for interaction with the webhooks API.

But when they create the webhook manually through the Bitbucket Server admin UI and then updating the Bitbucket Server connection configuration in Sourcegraph we try to automatically create a webhook that matches this configuration.

That fails with error messages because the token doesn't have enough permission.

We should fix the error message and allow the manual creation of webhooks.

One idea I had was to add a "automaticCreation": false option to the "webhooks" config to disable the auto-creation. That would stop the errors.

But there might be better options to solve this.