oncall-engine/docs/sources
Michael Derynck b5a8b8b168
Add webhook presets (#2996)
# What this PR does
Add a system similar to how we select integrations when creating
webhooks so that the user has a description of what webhookds do and
does not have to write complex templates for common webhook use cases.
Presets allow us to create the contents of the webhooks in code and
define which fields are controlled by the preset. Some specifics:

- Newly created webhooks must choose between Simple, Advanced or another
predefined system
- Simple is always an escalation step and will post the entire payload
to the given URL
- Advanced is the same as no preset which is our current view where all
fields are available
- There are no changes for all existing webhooks with empty preset
fields
- Once a webhook is created with a preset the preset cannot be changed
- Fields in the webhook that are populated by code will give a
validation error if they are modified
- In the public API webhooks with presets are returned for viewing but
cannot be created or modified. This restriction is in place because the
Web UI provides the context for which fields to use with a preset. The
public API is for interacting with webhooks where all fields are
defined.

To define a preset create a file with metadata and an override function.
The metadata drives validation and what to display in the UI. There are
two functions one is connected to the pre_save hook of the Webhook model
for persistent changes, the other replaces parameters at execution time
for ephemeral changes. See the simple and advanced presets as an
example. The file must be listed in settings in
`INSTALLED_WEBHOOK_PRESETS` to be enabled at runtime..

## Which issue(s) this PR fixes

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)

---------

Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
2023-09-27 07:22:52 -06:00
..
escalation-chains-and-routes Update all links to use docs/reference style (#2456) 2023-07-13 14:38:35 +00:00
get-started Fix docs lint issues (#2699) 2023-07-31 17:07:19 -03:00
insights-and-metrics Add documentation about shift swap requests (#2719) 2023-08-17 10:47:16 -03:00
integrations remove some references to amixr (#2698) 2023-08-01 14:22:42 -04:00
jinja2-templating Refactor docs for the new integrations page (#2290) 2023-06-27 09:57:27 +08:00
migration-from-other-tools Docs restructure (#1703) 2023-05-24 14:11:21 +03:00
mobile-app Add documentation about shift swap requests (#2719) 2023-08-17 10:47:16 -03:00
notify fix docs linting errors 2023-07-31 10:03:54 +02:00
on-call-schedules Update Shift Swap Request Slack message formatting (#2918) 2023-09-01 07:53:27 +02:00
oncall-api-reference Add schedules enable_web_overrides option to public API (#3062) 2023-09-26 14:04:53 -03:00
open-source Telegram long polling (#2250) 2023-08-24 09:12:24 +02:00
outgoing-webhooks Add webhook presets (#2996) 2023-09-27 07:22:52 -06:00
user-and-team-management fix public docs iframe issue 2023-08-25 07:52:21 +02:00
_index.md adjust frontmatter weight and add menu title (#2484) 2023-07-10 16:54:28 +00:00