# Chain the steps

Wait for a fix to merge, ship and reach your distro, with one blocker.

Real waits come in chains. Your patch can go once the PR merges, the fix ships in a tag, and nixpkgs picks up that tag. Three blockers would turn `bumpable` one by one, and none of them alone means the patch can go. One chain does.

`canibump.toml`

```toml
[[blocker]]
id = "libfoo-crash"
note = "drop the libfoo crash patch"

[[blocker.all]]
id = "merged"
state = "github:libfoo/libfoo#412"

[[blocker.all]]
id = "released"
reached = "github:libfoo/libfoo#412"
in = { tags = "v*" }

[[blocker.all]]
id = "packaged"
version = "repology:libfoo"
repo = "nix_unstable"
at-least = { step = "released" }
```

`[[blocker.all]]` holds when every step holds, checked in order. It stops at the first step that doesn’t and names it.

```
$ canibump
waiting   libfoo-crash  packaged: repology:libfoo in nix_unstable is at 2.4.0, waiting for v2.4.1
```

The `released` step found the tag, and `at-least = { step = "released" }` hands it to the next step. nixpkgs moves, and the whole chain holds.

```
$ canibump --refresh
bumpable  libfoo-crash  all 3 steps hold; repology:libfoo in nix_unstable is at 2.4.1, at least v2.4.1 (drop the libfoo crash patch)
```

## Rules

- `[[blocker.any]]` holds when one step does, for a fix that may ship two ways. Steps nest, so an `any` can sit inside an `all`.
- A step’s `id` names it in the output, and lets a later step read the tag it found.
- A `step` reference points at an earlier step of the same `all`, or of an enclosing one, since those surely held. An `any` may hold through another step, so canibump refuses a reference into it. Put both in one `all`.
- A dead or failed step never lets the chain read `bumpable`. In an `any`, a failed step beats a waiting one, and the whole `any` is dead only when every step is.
