# Mocco events

Besides forwarding Sentry, Vercel and GitHub, Mocco posts its own deploy governance events. They
need no source: add a rule to a channel and they start arriving.

| Event | When | The message shows |
|---|---|---|
| `gate.pending` | A run reached a gate and waits for approval. | Repository, pipeline, short commit, who triggered the run, the gate, and what it needs (for example "2 × deployer"), with a link to the run. |
| `gate.resumed` | Someone with the right role resumed the gate. | The same run details and the roles that resumed it. |
| `gate.rejected` | Someone rejected the gate. | The same run details and the reason given. |
| `run.failed` | A run failed. | The run details, the step that failed and a link to its logs, when known. |
| `run.succeeded` | A run finished successfully. | The run details. |

Every message links back to the run in Mocco.

## The Mocco preset

On a channel's **Rules**, choose the **Mocco** preset and click **Apply**. It adds `gate.pending`,
`gate.resumed`, `gate.rejected` and `run.failed`; the OTA events `ota.promotion.requested`,
`ota.promotion.approved`, `ota.promotion.rejected` and `ota.emergency_launch.spike`; and the
feature-flag events `flags.changeset.requested`, `flags.changeset.applied`,
`flags.changeset.rejected`, `flags.flag.killed` and `flags.stale.digest`; and the messenger events
`messenger.conversation.created` and `messenger.message.received`; and the feedback event
`feedback.ship.suggested`. It leaves out
`run.succeeded`, which is often noisy, and `messenger.conversation.unassigned` (a new conversation
nobody in the inbox rotation was available for), which repeats a created message; add them by
hand if you want them. You can also use `gate.*` or `run.*` to get a whole family.

`feedback.ship.suggested` tells your team that a release shipped posts on a feedback board that wait
to be marked shipped: how many, which ones, the release's commit, the gates that approved it, and a
link to the board's inbox. It arrives once per board and release, and not at all for a board that
marks posts shipped without asking. Filter it to one board with `board=<the board's slug>`. See
[Mark posts shipped when they release](https://www.mocco.club/docs/en/articles/zp45zj-public-board#mark-posts-shipped-when-they-release).

Mocco events never come from a source, so a rule limited with **Only from source** never matches
them.

## Filter keys

| Event | Keys |
|---|---|
| `run.*` | `repo` (`acme/web`), `pipeline` (the `pipeline` name in `.mocco.yml`) |
| `gate.*` | `repo`, `pipeline`, `gate` (the gate's name) |

For example, to send only production approvals to `#deploys`, add a rule on `gate.pending` with
the filter `gate=production`.

## In Activity

Mocco events appear in the **Activity** tab with the source **Mocco** when at least one channel got
a message for them. Their details show the delivery to each channel, the same as for events from a
source. See [Troubleshooting](https://www.mocco.club/docs/en/articles/pmzrkr-troubleshooting) for what each status means.
