Webhooks and rebuilds

When using the releases feature, it is important to review the services which are subscribed to webhooks from Uniform so as to best ensure that these services are triggered at the most appropriate moments. Without care, every edit inside a release can fan out into webhook events and cause unnecessary rebuilds of production sites that should only ever rebuild on launch.

The events which trigger certain webhooks can be seen in the illustration below:

releases-webhook-diagram

In order to prevent unnecessary rebuilds of a production website when using the releases feature, we recommend following these tips:

  • Filter out release-scoped events. Ensure that release-scoped events from content objects are not triggering rebuilds. These events are denoted by the .release part in the event name – such as entry.release or composition.release.
  • Take note of the trigger property in non-release-scoped content events. When content is launched and moved into the "base" of the project, Uniform will emit individual events for content objects such as compositions and entries. This can cause a lot of events to appear in quick succession. These events can be filtered out by looking for the presence of the trigger property in the webhook payload, which should include information about the type of trigger (release) and the ID of the release.
  • Leverage the release.launched event for rebuilds after releases. The release.launched webhook fires after all of the contents of a release have been moved into the base, and the launch process has ended. As such, we recommend using this webhook to initiate site rebuilds.
    • For partial rebuilding of websites, you can also use the release ID from this event to make a call to the release contents API, which will provide details around the entities that were launched as part of the release.

To learn more about the webhook events available and the expected payloads, check out our webhook catalog.

  • Preview release content – preview release content end-to-end before it is launched, so that the rebuild that follows release.launched only ships content you have already validated.
  • Launch a release – understand when release.launched fires for manual versus scheduled launches.