Skip to main content
Version: v1

Diffy

The Diffy channel starts a visual regression run against the newly deployed environment, through the shipped GitHub Actions workflow.

This page is for the lead or DevOps engineer who runs Diffy visual regression tests after deployments. It covers how the channel hands off to the workflow, the setup steps, and every variable the channel reads.

The channel never calls Diffy itself. It sends your repository a GitHub repository_dispatch event, and the test-vr.yml workflow runs the Diffy comparison and posts the result back to the pull request. The dispatch succeeds only when GitHub answers with HTTP 204; any other status fails the channel.

Setup​

To set up Diffy notifications, complete these steps:

  1. Enable visual regression during installation (or ship test-vr.yml manually). See Visual regression.
  2. Add a GitHub token with repo scope as VORTEX_NOTIFY_DIFFY_TOKEN to the hosting environment (falls back to VORTEX_NOTIFY_GITHUB_TOKEN, then GITHUB_TOKEN).
  3. Add the repository, in owner/repo format, as VORTEX_NOTIFY_DIFFY_REPOSITORY to the hosting environment (falls back to VORTEX_NOTIFY_GITHUB_REPOSITORY).
  4. Add diffy to the comma-separated VORTEX_NOTIFY_CHANNELS list in your .env file, for example VORTEX_NOTIFY_CHANNELS=email,diffy. The installer doesn't add it for you, even when you enable visual regression.

Confirm that the next deployment started a run. The deployment output on your hosting platform shows [ OK ] Finished Diffy notification., and the repository's Actions tab lists a Test - Visual regression run.

Environment variables​

See the Notifications overview for the router, what a failed channel stops, the shared VORTEX_NOTIFY_* variables, and the Location column. The following table lists the variables that the Diffy channel reads:

VariableRequiredDefaultLocationDescription
VORTEX_NOTIFY_DIFFY_TOKENYes, unless VORTEX_NOTIFY_GITHUB_TOKEN or GITHUB_TOKEN is setVORTEX_NOTIFY_GITHUB_TOKEN, then GITHUB_TOKENHostingGitHub token with repo scope used to call repository_dispatch
VORTEX_NOTIFY_DIFFY_REPOSITORYYes, unless VORTEX_NOTIFY_GITHUB_REPOSITORY is setVORTEX_NOTIFY_GITHUB_REPOSITORYHostingRepository in owner/repo format (an HTTPS repository URL works too)
VORTEX_NOTIFY_DIFFY_SOURCE_ENVNoproduction.envDiffy source environment used as the baseline (production, staging, development)
VORTEX_NOTIFY_DIFFY_EVENT_TYPENovr_run.envrepository_dispatch event type the workflow listens for
VORTEX_NOTIFY_DIFFY_BRANCHESNoNone.envExact branch names to dispatch for (comma-separated). When empty, every deployment dispatches and the workflow decides whether to compare
VORTEX_NOTIFY_DIFFY_BRANCHNoVORTEX_NOTIFY_BRANCHHostingBranch sent to the workflow and checked against VORTEX_NOTIFY_DIFFY_BRANCHES
VORTEX_NOTIFY_DIFFY_ENVIRONMENT_URLNoVORTEX_NOTIFY_ENVIRONMENT_URLHostingDeployed environment to compare against the source environment
VORTEX_NOTIFY_DIFFY_LABELNoVORTEX_NOTIFY_LABELHostingDiff name shown in the Diffy UI
VORTEX_NOTIFY_DIFFY_EVENTNoVORTEX_NOTIFY_EVENTHostingDeployment event; pre_deployment dispatches nothing

The workflow treats a deployment whose URL contains pr-<number> as a pull request deployment. By default, it compares one only when the pull request carries the VR label or its head branch matches deps/*. It compares any other deployment only when its branch matches VR_DIFFY_BRANCHES. Automatic on deployments covers these settings.

Event behavior​

The channel skips pre_deployment, because the target environment isn't ready for comparison yet. Any other event, post_deployment included, dispatches the run.