sourcegraph / sourcegraph-public-snapshot

Code AI platform with Code Search & Cody
https://sourcegraph.com
Other
10.11k stars 1.29k forks source link

BitBucket Server Incoming Webhooks Not Updating Batch Changes #57401

Open alexAtSourcegraph opened 1 year ago

alexAtSourcegraph commented 1 year ago

Bitbucket Server v8.9.4 Bitbucket Plugin: v2.0

Steps to reproduce:

  1. Setup Incoming Webhooks as described here be sure to also add the events pr:merged, pr:declined, pr:deleted

    Your completed list of Events should be as follows:

    pr:participant:status pr:merged pr:activity:event pr:activity:reviewers pr:declined pr:deleted repo:build_status pr:activity:status pr:activity:merge pr:activity:rescope pr:activity:comment

  2. Verify that the incoming webhook has communicated with Sourcegraph with a 200 Status.

  3. Create a Batch Change on a repo that the code host incoming webhook has been setup for.

  4. Merge the generated pull request.

  5. Check the status of the created batch change changesets and wait for an update.

  6. Check the incoming webhook for the event.

  7. Delete the generated pull request.

  8. Check the status of the created batch change changesets and wait for an update.

  9. Check the incoming webhook for the event.

Expected behavior:

The status of the created batch change changeset would update after both the merge and closed pull request events without a manual synchronization from Sourcegraph. Incoming webhook events are registered in the Sourcegraph UI.

Actual behavior:

The status of the batch change changeset does not change in response to incoming webhooks events. Incoming webhook events are not registered in the Sourcegraph logging in the UI.

/cc @sourcegraph/source

github-actions[bot] commented 1 year ago

Hey, @sourcegraph/code-search - Batch Changes has been mentioned. Let's take a look.

alexAtSourcegraph commented 1 year ago

Present at the following: https://github.com/sourcegraph/accounts/issues/7485

BolajiOlajide commented 1 year ago

It seems bitbucket has changed the keys for their webhook events and that's why this happens. There's no documented list anywhere on the internet but I'm working on a fix using the test bitbucket instance...

BolajiOlajide commented 1 year ago

@alexAtSourcegraph Can you confirm if the customer is using the Bitbucket server plugin?

alexAtSourcegraph commented 1 year ago

Yes. The customer was using the BitBucket server plugin. The customer reported following the instructions for setting up the Incoming Webhooks as described in our documentation. The first step is to download the server plugin. Unless there is a way to configure this without the server plugin @BolajiOlajide ?

BolajiOlajide commented 1 year ago

Oh thanks for confirming.

I initially tried reproducing without using the plugin, as I didn't know about it until a few hours before my message. I'm working on reproducing using the plugin - however, I'll need to make some modifications to the code to make it work without the plugin. Still, I'm a bit hesitant about that without first understanding the historical context of the plugin, hence, the need for me to reproduce using the plugin and fix whatever is wrong.