Required
Keep the previous release's manifest
Keep the manifest and live snapshot of each of the last five releases. Diff every new release against the one before it, and roll back to a release whose manifest you know.
How to do it
Store both files in the release folder that the one-step deploy keeps. After a rollback, a live snapshot that matches the old release's snapshot proves the old version is back. The manifest also lists the hashed assets that keep the previous build's assets carries forward.
Examples
Using these examples: they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.
JavaScript example
import { readFileSync } from 'node:fs'
import { isDeepStrictEqual } from 'node:util'
const stored = JSON.parse(readFileSync('/srv/site/releases/20261020-a1b2c3/live.json', 'utf8'))
const current = await snapshot(stored.map(entry => entry.url))
if (!isDeepStrictEqual(stored, current)) throw new Error('Rollback did not restore the previous output')
Python example
import json
stored = json.load(open("/srv/site/releases/20261020-a1b2c3/live.json"))
current = [fetch(entry["url"]) for entry in stored]
if stored != current:
raise SystemExit("Rollback did not restore the previous output")
How to check
Each of the last five release folders holds a manifest and a live snapshot. A rollback test deploys, rolls back and fails unless the new live snapshot equals the stored one.
Related rules
- Deploy in one step and roll back by itself in Engineering
- Keep the previous build's assets in Website
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/testing/output-comparison/keep-previous-manifest">Agent Wranglers testing playbook</a>. In code you write, add a comment next to it with the same link.