A minimal cascade example whose purpose is to prove the repository_dispatch
rollback entry point live.
The manifest declares two environments (staging, then prod), one build, and
one deploy, and opts the generated rollback workflow into a repository_dispatch
trigger:
rollback:
repository_dispatch:
types: [rollback-requested]With that opt-in, cascade-rollback.yaml carries both the manual
(workflow_dispatch) and the external (repository_dispatch) entry points, and
each rollback parameter is read as
github.event.inputs.<key> || github.event.client_payload.<key> so an external
system can drive the same rollback by calling the dispatches API.
Rollback targets prod, the promoted-into environment. The first environment
(staging) tracks trunk and is never promoted into, so it carries no rollback
history and is reverted with a merge to trunk rather than a rollback. prod
gains its history from promotion, which is why the ring has two environments.
scenario-suite.yaml seeds staging on a merge and promotes it to prod,
advances staging and promotes a second version to prod (leaving the earlier
version in prod's deploy-history ring), then fires a real repository_dispatch
rollback:
gh api "repos/$REPO/dispatches" -X POST \
-f event_type=rollback-requested \
-f 'client_payload[environment]=prod' \
-F 'client_payload[dry_run]=false'It then asserts the real effect: prod reverts to the prior deploy's SHA and
version and is marked diverged (ref=rollback/prod). This is the only live
coverage of the client_payload coalesce path.
.github/manifest.yaml- the cascade manifest (staging then prod, rollback dispatch on)..github/workflows/orchestrate.yaml,promote.yaml,cascade-hotfix.yaml,cascade-rollback.yaml- generated bycascade generate-workflow; do not edit by hand..github/workflows/build-app.yaml,deploy-app.yaml- the build and deploy callbacks the pipeline drives..github/workflows/scenario-suite.yaml- the live validation driver.src/- the source of record a merge changes to drive orchestrate.
Regenerate the workflows after a manifest change:
cascade generate-workflow --config .github/manifest.yaml --force