Skip to content

Matching GitHub webhook events by ref might match PRs in wrong repositories

Created by: mrnugget

Currently we don't take the repository ID of a StatusEvent into account when looking up the changesets with that ref:

https://github.com/sourcegraph/sourcegraph/blob/b56550a2b38de7e03711b40c71501e6e9791f9d2/enterprise/internal/campaigns/webhooks.go#L354-L366

Since https://github.com/sourcegraph/sourcegraph/pull/9004 that won't necessarily lead to bugs, because we then look up the repository/changeset and drop events that don't match.

But we should still make this proper in order to not have to iterate over long lists of prs that have the same branch (.e.g "fix-typo").

cc @ryanslade