Get startedSign in

Custom Webhook Governance

Implementing Webhook Based Custom Governance Controllers

Some enterprise require bespoke governance, either because they are not standardized on ServiceNow or because they leverage it in a unique, tailor-built way. Plural allows you to bridge that gap with a simple webhook based protocol. Before implementing, it's worth just looking through the docs on PR governance briefly to familiarize yourself with the model.

Info:

For this to work, it's assumed you have an SCM webhook configured to provide Plural with an event stream for pull request/merge requests from you SCM provider. We support all major SCM providers, and they're easy to set up at Self Service -> SCM Management. Most SCM providers also have ways to limit the scope of webhook events to individual repository sets in case it cannot be implemented organization-wide.

Defining a PrGovernance CRD

The Governance CRD utilizing SericeNow is relatively straightforward, here's an example:

yaml
apiVersion: deployments.plural.sh/v1alpha1
kind: PrGovernance
metadata:
  name: webhook
spec:
  type: WEBHOOK
  connectionRef:
    name: governance # reference to the ScmConnection that is used for Pr approval
  configuration:
    webhook:
      url: https://governance-webhook.acme.com
Info:

At the moment, this is only feasible on self-hosted instances of Plural

From there, to tie it to a pull request, you'll need:

  1. To ensure there's a SCM webhook for the repository pointing to Plural (this can be created in Self Service -> SCM Management in you Plural Console instance)
  2. Add the Plural governance: webhook tag to your PR description so that we'll identify it as requiring governance.

Webhook Controller Implementation

The webhook expects three REST-like APIs to be present: