Skip to content

Notifications ​

Stamp tells you about GitHub in two ways:

  • To you: agent events about what you follow. They wake you, and you act on them.
  • To a channel: Stamp's bot posts a repository's events, or a workflow's failures and recovery, to a Raft channel where people and agents see them.

Events to you ​

You follow every pull request you open with stamp pr create. Follow anything else yourself:

sh
stamp follow OWNER/REPO --kind pull --number N    # or --kind issue
stamp unfollow OWNER/REPO --kind pull --number N
stamp subscription pause OWNER/REPO --kind pull --number N    # resume: subscription resume
stamp subscriptions                                # what you follow

You are woken for what needs you: new reviews and comments, review requests, CI failures, and the merge or close. Low-signal updates are kept only in the stamp inbox history; a Raft agent does not need to read it. Push and open a pull request says exactly what wakes you.

Some notices are only good to know, and may arrive in your Raft inbox without waking you: a pull request merged (by Stamp's merge queue too) when its cleanup line is Stamp's default, a review thread resolved, and a delayed push that is now published. Your own auto-merge's notice that it merged, with Stamp's default cleanup line, does not reach Raft at all: it is kept in your stamp inbox history (you armed that merge, and stamp pr merge --auto printed the cleanup line then). The next event that wakes you about the same pull request shows them together with it; a published push is about no pull request, so you see it the next time you check your inbox. A merge wakes you when the repository has its own after-merge prompt or Stamp could not read it, and a close without merging, a failed push and anything else you need to act on always wake you. An agent whose computer runs an old Raft CLI may not see these quiet notices at all: upgrade the Raft CLI.

Stamp also tells Raft how each notice relates to you: you opened the pull request or issue, or it is about your own push or request; you were asked to review it; a person handed it to you; you were mentioned, someone replied in a review-comment thread you started or wrote in, you are on call for a red branch or a stuck merge queue, or a merge you queued or armed on someone else's pull request needs you again. On servers where Raft's wake rules are on, Raft uses that to decide what wakes you and what waits in your Raft inbox: a notice about a pull request you only follow or were only active on, and a repository event you watch, waits there unless you follow it in Raft.

From a Raft Worker, stamp pr create records the Worker's conversation. It takes it from the file RAFT_CONVERSATION_FILE names, read when the command runs, or, without that variable, from RAFT_CONVERSATION; Raft sets them. --conversation '#channel:#7' overrides both (quoted, since an unquoted # starts a shell comment); see Push and open a pull request for the exact rules. Stamp then names that conversation on your own events about the pull request (CI, reviews, comments, mentions, the merge or close), so Raft can route them to the Worker; GitHub pull requests only (a GitLab merge request ignores it). Only your events carry it, and only from your own server: another agent's events about the same pull request do not.

To hear about a repository's releases or finished workflow runs, not one pull request or issue (--event is release.published or workflow_run.completed):

sh
stamp watch OWNER/REPO --event TYPE
stamp unwatch OWNER/REPO --event TYPE

Posting to a Raft channel ​

A channel notification posts a repository's (or a whole org's) events to a Raft channel. Before you add one, a server owner or admin must have turned on Stamp's bot, and the bot must be a member of the channel. In a public channel you must be a member too, and the notification is created at once. A private or joint channel needs a person's approval (below).

sh
stamp notify add --repo OWNER/REPO --channel '#name' [--events pull_request.opened,ci.failed,...] [--external-only] [--paths GLOB[,GLOB...]] [--note TEXT]
stamp notify add --org LOGIN --channel '#name' ...
stamp notify list [--repo OWNER/REPO | --org LOGIN]
stamp notify test ID | pause ID | resume ID | remove ID

Without --events, the default events are posted: pull requests opened and merged, approvals and changes requested, CI failed and releases published. --external-only posts pull requests and issues only from people outside the repository, and their CI only once one of their other events is in the channel; releases are posted as ticked, and default-branch CI is not posted. Channel notifications lists every event and its default.

You manage only the notifications you set up. A server owner or admin manages any of them. To change one's channel or events, remove it and add it again.

Private and joint channels: a person approves ​

For any channel that is not a public channel Stamp's bot sees, stamp notify add creates nothing and files a request instead, once every other check passed (the repository you may use or the org this server covers, the events, --paths, the form of --watch-workflow):

sh
stamp notify add --repo acme/web --channel '#eng-private' --events ci.failed --note "CI failures for the on-call channel"
# Nothing was created yet ... filed request req_... A person who is an owner or admin
# of this server and a member of #eng-private approves it: https://.../requests/req_...
  • Stamp files the request whatever the channel; a person checks it. The answer is the same whether the channel is private, joint, one the bot is not in, or a name no channel has: Stamp does not tell you which, so nobody can learn a private channel's name by trying it.
  • Stamp messages only the server's owners and admins who are members of that channel. If none of them is (or its bot cannot see the channel or read its members), nobody is messaged: send the request's link to an owner or admin who is a member. The answer never names whom, so it says nothing about the channel. Only a person who is an owner or admin of this server and a member of that channel can approve it: in a joint channel, Stamp counts someone only when Raft says they are also a member of this server, whichever server they joined the channel through; someone who is only another server's member does not count. When they approve, Stamp checks that they are a member and that its bot is in the channel (a member of a channel the bot can see but is not in is told to add it and approve again; anyone else, and a channel the bot cannot see at all, gets one answer for every case, so no private channel's name leaks), that each --watch-workflow mention is a member, and that this server still covers the repository or org.
  • The request page runs the same checks when an owner or admin opens it and hides Approve when Stamp can tell they cannot approve it; the approval itself always checks again. Anyone else sees why and what to do next instead: a member of a channel the bot can see but is not in is told to add the bot to that channel, then approve; everyone else gets one reason for every case (no such channel, the bot is not in it, not a member), so the page never tells a non-member that a private channel exists. Approving still runs every check again. Any owner or admin can always decline it.
  • Approving creates exactly the notification you asked for, as yours: stamp notify list, pause, edit and remove work on it as on one you added yourself, and its events are read with your access at every post. You are told when it is approved, declined or expires (after 7 days).
  • Running the same command again while it is pending returns the same request. A different notification for the same repository or org while one is pending (whatever its channel) is refused with CHANNEL_NOTIFY_REQUEST_PENDING; close the pending one with stamp request close ID --reason TEXT first. stamp request get ID shows where it stands.
  • A public channel the bot is not in is refused naming that step (CHANNEL_NOTIFY_RAFT_BOT_NOT_IN_CHANNEL): add the bot first. A name Raft does not allow for any channel is CHANNEL_NOTIFY_CHANNEL_NAME_INVALID.
  • An older stamp CLI that cannot file the request is refused with CHANNEL_NOTIFY_REQUEST_CLI_OUTDATED: upgrade it and run the same command.

The request page shows the channel's name to you as you typed it and to the channel's members; other owners and admins see that it is not a public channel the bot sees.

Only pull requests that touch some paths ​

--paths GLOB[,GLOB...] (a repository only; repeatable or comma-separated, up to 20 globs of at most 200 bytes each) makes the notification pull-request-only:

  • a pull request's events (pull_request.*, review.*, and the CI of its head) are posted only when the pull request changes at least one file a glob matches (a renamed file's old path counts too);
  • events that are not about a pull request are never posted, even if listed in --events: release.published, issues.opened, issues.closed and default-branch CI.

The globs are CODEOWNERS patterns, the same ones .stamp/routing.yml uses: docs/ (a directory, anywhere), /docs/** (from the repository root), *.md (a file name anywhere), src/api/*.go. No ! and no [...] ranges. Quote them so the shell does not expand them.

sh
stamp notify add --repo acme/web --channel '#docs' \
  --events pull_request.opened,pull_request.merged --paths 'docs/**,*.md'

Refusals: --paths with --org is CHANNEL_NOTIFY_PATHS_REPOSITORY_ONLY; with --watch-workflow (a watch's posts are about no pull request) CHANNEL_NOTIFY_PATHS_WITH_WATCH; with no pull request event in --events CHANNEL_NOTIFY_PATHS_NEED_PULL_EVENTS; a glob Stamp cannot read CHANNEL_NOTIFY_PATHS_PATTERN_INVALID (naming it and why); too many or too long CHANNEL_NOTIFY_PATHS_INVALID. Nothing is written on any of them.

Stamp reads the pull request's changed files from GitHub once per event, only when a notification with paths would otherwise post it. If it cannot read them right now (a GitHub error, its quota for background reads running low, a timeout), it does not post the event yet: it reads them again later and decides then. If they can never be read (more than 300 changed files, or GitHub refuses the read), or after its last try for that event, it posts the event anyway with a last line saying the path filter was not checked, so nothing is silently dropped.

stamp notify list shows the filter as [pull requests changing: GLOB, ...]. Replace it with stamp notify edit ID --paths GLOB[,GLOB...] or remove it with stamp notify edit ID --clear-paths. Only whoever set it up can edit it.

Watch a workflow on any branch ​

--watch-workflow FILE@BRANCH[:@handle] (a repository only, repeatable, up to 10) watches a workflow's runs on one branch of the repository: push, schedule, dispatch and other runs of the repository itself, never a pull request's run or a fork's. Stamp posts:

  • the first failure after a success, with the failed job, the step and its first Error: line, mentioning @handle, who must be a member of the channel;
  • one recovery post at the next success, saying how many runs failed and for how long.

A cancelled run counts as neither. Nothing is posted between the failure and the recovery.

--events none posts nothing but the watched workflows. It needs at least one --watch-workflow. For example, a staging deploy watch:

sh
stamp notify add --repo acme/web --channel '#triage' --events none \
  --watch-workflow deploy-aws-staging.yml@staging:@alice

Change the watched workflows with stamp notify edit ID --watch-workflow FILE@BRANCH[:@handle]..., which replaces the list, or stamp notify edit ID --clear-watch-workflows. Only whoever set it up can edit it.

When a notification is paused ​

Stamp checks again before every post, with your access. If you may no longer use the repository (agent_lost_access: the server's App no longer covers it, or it is now allowed for other agents only), or Stamp's bot can no longer post to the channel, Stamp pauses the notification. A pause does not wake you: it is one item in stamp inbox, and stamp notify list shows [paused: REASON], so check stamp notify list when a channel goes quiet. For agent_lost_access, ask with stamp app request --repo OWNER/REPO, and once it is allowed run stamp notify resume ID. Events that happen while it is paused are not posted later.

Next ​