Skip to content
Rehearsev1.2.0

Announce what a change changes

An announcement names the scenarios a change means to change, each with one line saying why.

announce.yaml
changes:
- scenario: 'packages/api/items.hurl#The owner sees every item'
why: Prices are sent with two decimals.
- scenario: 'packages/report/*.rehearse.yaml'
why: The report writes prices with two decimals.
- scenario: 'packages/api/items.hurl#The shop names itself'
why: The shop is now called The Shop.
- scenario: 'packages/api/items.hurl#Nobody is let in without a token'
why: The refusal names the header it wants.

A comparison that reads it sorts what the announcement names apart from what slipped.

Terminal
$ rehearse compare --base main --announce announce.yaml
2 as on the base · 1 new · 4 changed and said so (3 announced, 1 edited) · 1 fails on the head · 1 gone
fails on the head:
The count is right (packages/api/items.hurl:26)
$.count: 3 → 2
line 30: jsonpath "$.count" == 3 · expected 3, got 2
changed and said so:
The shop names itself (packages/api/items.hurl:8) — announced: The shop is now called The Shop.
$.name: "Shop" → "The Shop"
The owner sees every item (packages/api/items.hurl:14) — announced: Prices are sent with two decimals.
$.items[*].price: 3.5 → "3.50" (3 places)
A member isn't told the admin page exists (packages/api/items.hurl:21) — its definition was edited
status: 404 → 403
$.error.code: "not_found" → "forbidden"
The weekly stock report lists every item with its price (packages/report/weekly.rehearse.yaml) — announced: The report writes prices with two decimals.
weekly.csv column 3 "price": "3.5" → "3.50" (2 places)
new:
The owner finds items by name (packages/api/items.hurl:33)
gone from the head:
The legacy ping answers (packages/api/items.hurl)
announced, but as on the base:
packages/api/items.hurl#Nobody is let in without a token — The refusal names the header it wants.

A change usually means to change a few things. An announcement names them, each with one line saying why. A comparison then splits what changed into what you said (changed and said so) and what slipped (changed without saying so). Without the announcement above, the same comparison had two changes nobody said.

  1. Write the announcement. By default Rehearse reads .rehearse/announce.yaml beside rehearse.yaml. Or keep it anywhere and pass --announce <file>. YAML or JSON.

  2. Name each scenario you mean to change, by its id or a glob over ids, with why: one line, what changes and why. Write it for the reviewer.

  3. Compare. rehearse compare --base main (or --announce <file>).

For one or two scenarios, say it on the command line instead. Each --said takes an id or a glob, and Rehearse gives it the line “Said on the command line.” as its why.

Terminal
rehearse compare --base main --said 'packages/api/items.hurl#The owner sees every item' --said 'packages/report/**'

Check an announcement before you rely on it, from a file or from stdin.

Terminal
$ rehearse validate announce announce.yaml
announce.yaml meets the announce schema.
$ printf 'changes:\n - scenario: x\n' | rehearse validate announce
✗ line 2: changes[0] needs “why”.
Glob Names
src/Badge.stories.tsx#* every story in that file
packages/report/*.rehearse.yaml every file scenario in that folder
packages/report/** every scenario under that folder
apps/api/**/*.hurl#* every call under apps/api

* stops at a /; ** doesn’t. A call with no comment is named by its method and URL, which holds a /: use ** after the # to name it with a glob, or write its id in full.

Where Shows
The text — announced: <why> beside the scenario; the line counts (3 announced, 1 edited)
The JSON "verdict": "said", "said": "announced", "why": "…"; counts.announced
The stage “Announced: …” under the verdict

In the comparison’s JSON, an announced scenario’s entry carries the why.

comparison.json
{
"verdict": "said",
"changed": true,
"said": "announced",
"edited": true,
"why": "The shop is now called The Shop."
}

That scenario was also edited. When a scenario is both announced and edited, announced wins: the why is what a reviewer wants to read. edited still says it was.

An announcement says what you expect to change. It never hides anything else:

  • A scenario that fails on the head is fails on the head, announced or not.
  • A scenario the base doesn’t have is new.
  • A scenario that didn’t change stays as on the base.

When every scenario an entry names came out as on the base, the comparison lists it apart.

Terminal
announced, but as on the base:
packages/api/items.hurl#Nobody is let in without a token — The refusal names the header it wants.

The JSON lists the same entry under announcedUnchanged.

comparison.json
"announcedUnchanged": [{ "scenario": "packages/api/items.hurl#Nobody is let in without a token", "why": "The refusal names the header it wants." }]

Either the change doesn’t do what it says, or the announcement is stale. It is a note: it doesn’t change the exit code.

An entry that names no scenario at all (none compared, gone or not run) is probably a typo. A comparison of every scenario lists it under not read, with the file it came from (--said for the command line).

Terminal
not read:
…/shop/.rehearse/announce.yaml (head): The announcement names packages/api/items.hurl#The owner sees every itme, which matches no scenario compared.

In the JSON it is an entry of refused, with side: "head". It doesn’t change the exit code either. Check the id with rehearse list. A comparison of a few scenarios doesn’t list such entries, since it compares only some.

Editing a scenario’s own definition says so too: the head changed what it expects, in the same change. The comparison shows — its definition was edited. That is decided per scenario: reformatting a file or adding a scenario beside another says nothing about the others. See said so.

A scenario read beside the manifest (./…) is the same file on both sides, so it is never edited. Only an announcement says it changed.