Open LawnGnome opened 2 years ago
@malomarrec Thoughts on the priority of webhook related work? Feels like it comes after strategic readiness, so backlog, but wanted to hear what you thought.
There's some active conversation around webhooks that Ryan Slade's driving here that may influence who/how/when we pick this up. I'd actually argue adequate automation around webhooks is incredibly important to strategic customers, for 2 reasons:
This is also effectively tackling the same problem and serving as a direct complement to https://github.com/sourcegraph/sourcegraph/issues/24312, which has been a long-standing fave item on our board.
Yeah, I'm going to take this off the board for now because Ryan and Alex are basically working on this already. This may come back later as a more tightly scoped ticket if I end up pitching in to help after outbound webhooks.
One of our biggest issues in Batch Changes is getting site admins to enable and configure webhooks. It's painful to do, since it has to be per-repo or (at best) per-org depending on the code host, and yet it's basically the difference between Batch Changes being usable and not much of the time. Anecdotally, it feels like we've seen an uptick in webhook-related support issues of late.
Our longer term plans for dealing with this have tended to be either eventually writing a GitHub App to fix this, or hoping that site-wide webhooks will do the job (which we've recently discovered they likely won't, because they don't get down to this level of granularity).
Meanwhile, it turns out that we got a rudimentary background worker to configure webhooks automatically in #39992 and #39833. (Who knew? Certainly not me. I stumbled across this while starting to build the same thing on a rainy Friday afternoon.)
This would be extremely useful for Batch Changes!
Unfortunately, it has a few drawbacks right now:
push
event type, which is useful for repo updates, but not for Batch Changes.github.V3Client
that probably shouldn't be, like the event types and the string to search for to consider a particular webhook a "Sourcegraph webhook".experimentalFeatures
site configuration flag.So, let's make it better so we can turn it on by default and our users can enjoy the benefits of having webhooks Just Work.
Rough plan of attack for GitHub:
internal/repos
and intocmd/worker/internal
. (This may include giving the job a slightly more descriptive name, since it's currently "webhook build" and that doesn't really describe what it actually does.) 1drepo
. (This needs to be encrypted if encryption is enabled.) 2dgithub.V3Client
to be less opinionated. 1d, assuming the VCR tests aren't too badFuture incremental work:
internal/webhooks/inbound/{code host name}
package structure, since I'm planninginternal/webhooks/outbound
for #38278.) dunno; probably something like 2d per code host kindNice to haves: