minder icon indicating copy to clipboard operation
minder copied to clipboard

Provider classes self-register webhooks

Open JAORMX opened this issue 1 year ago • 0 comments

Summary

This change makes provider classes self-register webhooks. This means that a provider class manager now has to implement a registration method as well as an HTTP handler for the webhook of the given provider.

general webhooks have the following path prefix: /api/v1/webhook/. And, with this change, we now formalize the /api/v1/webhook/github which we had already been using for webhooks for the github provider.

There is also a method of registering "other" handlers, which pertains to paths that are not the main webhook, but require handling anyway. GitHub registers two: ghapp and gh-marketplace. These have the /api/v1 prefix, which works with the same paths we already had.

Related-to: https://github.com/stacklok/minder/issues/3325

Change Type

Mark the type of change your PR introduces:

  • [ ] Bug fix (resolves an issue without affecting existing features)
  • [x] Feature (adds new functionality without breaking changes)
  • [ ] Breaking change (may impact existing functionalities or require documentation updates)
  • [ ] Documentation (updates or additions to documentation)
  • [ ] Refactoring or test improvements (no bug fixes or new functionality)

Testing

Review Checklist:

  • [x] Reviewed my own code for quality and clarity.
  • [ ] Added comments to complex or tricky code sections.
  • [ ] Updated any affected documentation.
  • [ ] Included tests that validate the fix or feature.
  • [ ] Checked that related changes are merged.

JAORMX avatar May 20 '24 11:05 JAORMX