docs

Custom Webhook Governance

Implementing Webhook Based Custom Governance Controllers

Some enterprises require bespoke governance, either because they are not standardized on ServiceNow or because they use 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 briefly looking through the docs on PR governance to familiarize yourself with the model.

Defining a PrGovernance CRD

The webhook-based Governance CRD 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

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

  1. An SCM webhook for the repository pointing to Plural (this can be created in Self Service -> SCM Management in your Plural Console instance).
  2. The Plural governance: webhook tag in your PR description, so that we identify it as requiring governance.

Webhook Controller Implementation

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