Skip to content

Channel notifications ​

Stamp's bot can post a repository's GitHub events into a Raft channel: pull requests opened and merged, reviews, CI failures, releases, issues. You can set this up for one repository or for a whole GitHub org.

Each pull request, issue or release gets one thread. Its first event starts the thread, and every later event is a reply in it. CI on the default branch has no pull request, so each such result is a message of its own.

A thread starts like this:

text
🔀 acme/api — PR #42 opened
[Retry webhook deliveries on 5xx](https://stamp.build/s/acme/github/acme/api/pull/42)
by @build-bot · into main
Adds a bounded retry with backoff to the webhook sender.

The first line says where and what happened, the second is the title as a link, the third says who did it (and, for a pull request, its branches or reviewers), and the fourth, on a newly opened pull request or issue, is the start of its description. Because the title is the link, the channel shows no second card repeating it. Later events in the same thread have the same shape, without the title line (the thread's first post has it):

text
🐛 acme/api — issue #57 closed
by artin
text
👀 acme/api — PR #42 approved
by artin · into main
text
🔀 acme/api — PR #42 merged
by artin · retry-5xx → main

CI on a pull request's head keeps the link, since the thread's first post may be old:

text
❌ acme/api — PR #42 CI failed
[acme/api#42](https://stamp.build/s/acme/github/acme/api/pull/42)
test, lint (2/9)

CI on a default branch is a message of its own, with the workflow as the link:

text
❌ acme/api — CI failed on main
[Tests](https://github.com/acme/api/actions/runs/123456)
commit 3f9c2a1b7d4e

For a pull request or issue, the title's link opens its page in Stamp. For a release or default-branch CI, it opens GitHub.

Who acted is a GitHub login, or the Raft handle of the agent or person Stamp acted for: a person's handle in plain text (artin), an agent's with a full-width @ (@archer). That way a post never mentions anyone. The one exception is a watched workflow's failure and recovery, which mention the one channel member you name.

An agent of a federated server that approved or commented through its own server's Stamp is named with that server, for example by agent `archer` (server botiverse), so it is never mistaken for a same-named agent of your server.

When Stamp's GitHub App bot did it and your server has no record of which agent it was for (an agent of another Raft server, a bare atlantis plan comment), the post says an agent (through Stamp), never the bot's login. Another App's bot (dependabot[bot]) keeps its login.

Before you start ​

Two things have to be in place on Raft:

  1. A server owner or admin grants Stamp's bot. Installing Stamp does not do it. In Raft, they turn on the bot of the Stamp app (the app's Bot setting). Raft's docs: App Bot. Until then, the Notifications page says "Stamp's bot has no working key on this Raft server".
  2. Someone adds Stamp's bot to the channel, like any other member. Being granted does not put the bot in any channel. When the bot is in none of your channels, the Notifications page names its handle, so you know whom to add.

Who can set one up ​

Any person or Raft agent on the server can, if:

  • For a repository, a person: this server's GitHub App covers it, and your GitHub account can read it. This is the same check that decides whether you can open its pull requests in Stamp. Connect GitHub first in Settings › GitHub.
  • For a repository, an agent: this server's GitHub App covers it, and the agent may use it. If a person allowed the repository for named agents only, the agent must be one of them (otherwise CHANNEL_NOTIFY_REPOSITORY_AGENT_NOT_ALLOWED; stamp app request --repo OWNER/REPO asks for it). This is the same check as for an agent's other work on the repository. An act-as grant does not count here.
  • For an org: this server's GitHub App covers the account. An org subscription posts only the repositories its creator can read (a person) or use (an agent). Events of the others are skipped.
  • For the channel: you are a member of it, and so is Stamp's bot. An agent adds one directly only in a public channel it is in: an agent's stamp notify add naming anything but a public channel the bot sees creates nothing and files a request instead (the same answer whether the channel exists or the bot is in it), which a person who is an owner or admin of the server and a member of that channel approves on its request page (Stamp reads their membership then; see Requests). Approving creates exactly the notification the agent asked for, as the agent's own; if the bot is not in that channel, or no channel has that name, the approval is refused and the person declines the request. A CLI agent (stamp agent login) is not a Raft member, so it cannot add one.

Stamp checks again at every post, with the creator's own access, whether a person or an agent set it up. When GitHub's quota keeps Stamp from checking right now, the event is not posted yet: Stamp checks again after the quota's hourly window resets and decides then.

Who manages one: whoever set it up, a person or an agent, can test, pause, resume and delete it. A person who is a server owner or admin can do the same to any of them. An agent manages only its own, whatever its role.

Who edits one (its channel, its events, "Only from external contributors", its watched workflows, its path filter): only whoever set it up. Editing is on the Notifications pages only, so an agent removes its subscription and adds it again; the exceptions are the watched workflows and the path filter, which stamp notify edit changes (the path filter is set only from the command line). Stamp reads its events with the creator's access. An owner or admin who wants it changed asks its creator, or deletes it and adds their own.

Who sees a channel's name in the lists: anyone, for a public channel. For a private channel, only its members and whoever set it up. Everyone else sees "A private channel" ((private channel) in stamp notify list).

Set one up in Stamp ​

There are three Notifications pages:

  • Repository settings › Notifications, for one repository (/github/OWNER/REPO/settings/notifications).
  • Organization settings › Notifications, for every repository of a GitHub org (/organizations/ORG/settings/notifications).
  • Settings › Notifications, the server-wide list (/settings/notifications). Owners and admins see every channel notification on the server. Everyone else sees the ones they set up. You add new ones on a repository's or an org's page.

To add one:

  1. Open the repository's or the org's Notifications page.
  2. Under "Add a channel", pick the channel. The list shows only channels that both you and Stamp's bot are in. Stamp checks your membership in up to 50 of the bot's channels.
  3. Under "Events to post", tick the events. They are grouped by what they are about: pull requests, reviews, CI, releases and issues. The defaults are already ticked.
  4. Optionally tick "Only from external contributors" (see below). It is off by default.
  5. Choose "Add".
  6. Choose "Send test message" to check that the bot can post there. A subscription sends at most one test message every 30 seconds.

Events ​

EventName in the CLIPosted whenDefault
Pull request openedpull_request.openedA pull request is opened. Includes the start of its description.On
Pull request mergedpull_request.mergedIt is merged, by a person or Stamp's merge queue.On
Pull request closedpull_request.closedIt is closed without merging.Off
Pull request reopenedpull_request.reopenedIt is reopened.Off
Review requestedpull_request.review_requestedA review is requested from someone (or a team).Off
Review approvedreview.approvedA review approves it.On
Changes requestedreview.changes_requestedA review requests changes.On
CI failedci.failedChecks fail on the pull request's current head (up to 5 failed checks are named), or a workflow fails on the default branch.On
CI recoveredci.recoveredEvery check on the pull request's head passes (or the default-branch workflow passes), and this subscription's last CI post for it was a failure.Off
Release publishedrelease.publishedA release is published.On
Issue openedissues.openedAn issue is opened. Includes the start of its description.Off
Issue closedissues.closedAn issue is closed.Off

Reviews that only comment are not posted.

Only from external contributors ​

With "Only from external contributors" on, the subscription posts a pull request's or an issue's events only when its author is an external contributor. Stamp reads GitHub's author_association of the pull request or issue:

  • Internal: OWNER, MEMBER (of the org) and COLLABORATOR (invited to the repository). Their pull requests and issues are not posted.
  • External: everyone else: CONTRIBUTOR (had a pull request merged before), FIRST_TIME_CONTRIBUTOR, FIRST_TIMER, MANNEQUIN and NONE.

An external pull request's later events (reviews, review requests, merge, close, reopen) are posted too, as replies in its thread. An internal one's are not.

  • CI results carry no author. They are posted only for a pull request this subscription has already posted something about, which can only be an external one. So CI of an external pull request is posted once one of its other ticked events is in the channel. CI on the default branch is not posted.
  • Releases have no external author: their events are posted as ticked, the same as without the option.

The option is set when you add the subscription. To change it on the Notifications pages, delete the subscription and add it again. (Stamp's browser API can also edit a subscription in place: PATCH /api/web/settings/notifications/{id} with expected_version, the row's version, and any of channel, events and external_only. Only the person who set it up can; anyone else is refused with CHANNEL_NOTIFY_CREATOR_REQUIRED and nothing changes. A new channel gets the same checks as adding one.)

Watch a workflow on any branch ​

CI events cover pull requests and the default branch only. To hear about a workflow on another branch (a deploy to staging, say), a repository's notification can watch it: up to 10 entries, each a workflow file and an exact branch, and optionally one channel member to mention.

  • Workflow is the file: its path (.github/workflows/deploy-aws-staging.yml) or its file name (deploy-aws-staging.yml).
  • Branch is the exact branch name (staging).
  • Mention is the Raft handle of one member of the channel. Stamp checks that they are in it when you save.

For each watched workflow and branch, Stamp posts, whatever events are ticked:

  • The first failure after a success. A run that ends failure, timed_out or startup_failure is posted only when the last post for this workflow and branch was not already a failure. The post links the run and names the first failed job, its first failed step and the first line of that job's log that starts with Error: (for example Error: Service deployment rolled back because POST_TEST_TRAFFIC_SHIFT lifecycle hook(s) failed). If GitHub's quota keeps Stamp from reading the jobs right now, the post waits and goes once they can be read (after the quota's hourly window resets; meanwhile a later failed run is counted behind it). If a run of the workflow passes before then, only the recovery is posted (✅ acme/web — CI recovered on main), and the failure itself is never posted. If the jobs or the log cannot be read for another reason, the post goes without them.
  • One recovery. The next successful run posts that it recovered, how many runs failed in between and how long it lasted, from the first failure to that run.
  • Nothing for a cancelled run. A run that ends cancelled (a newer run superseded it), skipped, neutral or stale is neither a failure nor a recovery.
  • Only the repository's own branch, and no pull request runs. A watch takes push, schedule and dispatch runs of the branch in the repository itself. A run a pull request started (pull_request, pull_request_target), or one on a fork's branch of the same name, is ignored.
  • In order. A run older than the last one the watch already posted or counted (it arrived late) changes nothing.

These two posts start with @handle, the member you named: the only posts that mention anyone. If they have left the channel since, the handle is written without the @. Each is a message of its own, not in a thread. "Only from external contributors" does not apply to them.

text
@alice ❌ acme/web — CI failed on staging
[Deploy AWS Staging](https://github.com/acme/web/actions/runs/123456)
failure · deploy › Deploy to ECS
text
@alice ✅ acme/web — CI recovered on staging
[Deploy AWS Staging](https://github.com/acme/web/actions/runs/123470)
3 runs failed over 7h 12m

Add and remove watched workflows under Watched workflows on the repository's Notifications page (or in a row's Details on Settings › Notifications), or with stamp notify add --watch-workflow and stamp notify edit (below). Like any edit, only whoever set the notification up can change them. Stamp keeps its record of past posts for 14 days: a failure older than that with no success since is forgotten, and the next failure is posted again.

Only pull requests that touch some paths ​

A repository's notification can filter on paths, from the command line only (stamp notify add --paths, below): up to 20 globs in CODEOWNERS syntax (as in .stamp/routing.yml): docs/, /docs/**, *.md, src/api/*.go; no ! and no [...] ranges. With a path filter the notification is pull-request-only:

  • a pull request's events (opened, merged, closed, reopened, review requested, approvals, changes requested, and the CI of its head) are posted only when it changes at least one matching file (a renamed file's old path counts too);
  • events that are not about a pull request (releases, issues, default-branch CI) are never posted, even when ticked;
  • it cannot also watch workflows, and it needs at least one pull request event.

Stamp reads the pull request's changed files from GitHub once per event, only when a notification with paths would otherwise post it. When they cannot be read right now (a GitHub error, Stamp's quota for background reads running low, a timeout), Stamp does not post the event yet: it reads them again a little later and decides then, so an unrelated pull request is not posted by mistake. When they can never be read (more than 300 changed files, or GitHub refuses the read), or after Stamp's last try for that event, the event is posted anyway, with a last line saying the path filter was not checked. The row's Details on the Notifications pages list the globs.

From the command line ​

People and agents can use stamp notify after stamp login:

sh
stamp notify list [--repo OWNER/REPO | --org LOGIN]
stamp notify add (--repo OWNER/REPO | --org LOGIN) --channel '#name' [--events pull_request.opened,ci.failed,...] [--external-only] [--watch-workflow FILE@BRANCH[:@handle]]... [--paths GLOB[,GLOB...]]...
stamp notify edit ID [--watch-workflow FILE@BRANCH[:@handle]... | --clear-watch-workflows] [--paths GLOB[,GLOB...]... | --clear-paths]
stamp notify pause ID
stamp notify resume ID
stamp notify test ID
stamp notify remove ID
  • list with --repo or --org shows that repository's or org's channel notifications. Without either, it shows the server-wide list: all of them to an owner or admin, your own to anyone else. Each line shows the ID, the channel, the repository or org, the events, [external contributors only] if that option is on, [pull requests changing: GLOB, ...] for a path filter, [paused: REASON] if paused, and who set it up.
  • add posts to a channel you and Stamp's bot are in. --events takes names from the table above, separated by commas. Without --events, you get the defaults. --external-only turns on "Only from external contributors". Quote the channel name: in most shells, an unquoted # starts a comment.
  • --watch-workflow FILE@BRANCH[:@handle] (a repository only, repeatable) watches a workflow on a branch, mentioning @handle (see Watch a workflow on any branch). For example: stamp notify add --repo acme/web --channel '#triage' --events none --watch-workflow deploy-aws-staging.yml@staging:@alice. --events none posts no other event: only the watched workflows (it needs at least one --watch-workflow; on the Notifications page, untick every event of a subscription that watches a workflow).
  • --paths GLOB[,GLOB...] (a repository only, repeatable or comma-separated) sets a path filter (see Only pull requests that touch some paths). For example: stamp notify add --repo acme/web --channel '#docs' --events pull_request.opened,pull_request.merged --paths 'docs/**,*.md'. Refused, with nothing written: with --org (CHANNEL_NOTIFY_PATHS_REPOSITORY_ONLY), with --watch-workflow (CHANNEL_NOTIFY_PATHS_WITH_WATCH), without a pull request event (CHANNEL_NOTIFY_PATHS_NEED_PULL_EVENTS), a glob Stamp cannot read (CHANNEL_NOTIFY_PATHS_PATTERN_INVALID), more than 20 or one over 200 bytes (CHANNEL_NOTIFY_PATHS_INVALID).
  • edit ID replaces its watched workflows with the --watch-workflows given, or clears them with --clear-watch-workflows; and its path filter with the --paths given, or clears it with --clear-paths (at least one of these). Only whoever set it up can (otherwise CHANNEL_NOTIFY_CREATOR_REQUIRED). A mention that is not a member of the channel is CHANNEL_NOTIFY_WATCH_MENTION_NOT_MEMBER, nothing changed.
  • pause ID stops posting it for now, and resume ID starts again (Stamp's bot must be in the channel). Each prints the subscription as it now is.
  • test ID posts a test message to its channel, naming you, the repository or org and the events. A channel gets at most one test message every 30 seconds, and you can send at most three every 5 minutes (otherwise CHANNEL_NOTIFY_TEST_RATE_LIMITED with the seconds to wait).
  • remove ID deletes it.
  • pause, resume, test and remove: only whoever set it up, or a person who is a server owner or admin, can (otherwise CHANNEL_NOTIFY_MANAGE_REQUIRED).
  • ls and rm work too. --json prints the API's answer.

When a notification is paused ​

Stamp checks again before every post. If something has changed, it stops posting and pauses the subscription:

Why it was pausedWhat to do
The person who set it up can no longer read the repository on GitHub.Get read access back on GitHub, then resume it.
Whoever set it up (a person or an agent) is no longer a member of the server.They rejoin the server and resume it, or a server owner or admin deletes it.
The person who set it up disconnected GitHub from Stamp.Connect GitHub again in Settings › GitHub, then resume it.
The agent that set it up may no longer use the repository (agent_lost_access): the server's App no longer covers it, or the repository is now allowed for other agents only.The agent asks with stamp app request --repo OWNER/REPO; once it is allowed, it runs stamp notify resume ID.
Stamp's bot could not post: it was removed from the channel, or the channel was archived, renamed or deleted.Add Stamp's bot to the channel in Raft, then resume it.
Someone chose "Pause".Choose "Resume".

An org subscription does not pause when its creator cannot read (or, for an agent, use) one of the org's repositories. It just skips that repository's events.

When Stamp pauses a subscription (for any reason except someone choosing Pause), whoever set it up gets one item in their Stamp inbox (an agent: stamp inbox; stamp notify list shows [paused: REASON] too). It names the channel, why, and the next step, and links to Settings › Notifications. Owners and admins see the reason in the server-wide list.

To resume, choose "Resume" next to it. Stamp's bot must be in the channel. A subscription paused because the bot could not post resumes by itself: when the bot is in the channel again, the next time a Notifications page or stamp notify list that shows it is loaded. A renamed channel is picked up the same way.

Events that happen while a subscription is paused are not posted later. If the cause is still there when you resume, the next event pauses it again. Stamp always checks the access of whoever set it up, even when an owner or admin resumes it. To take over someone else's subscription, delete it and add your own.

Limits ​

  • 30 posts per channel per 5 minutes. This counts every subscription that posts to the channel. After 30, Stamp holds back the rest of that 5-minute window. At the end of the window it posts one message saying how many events it held back. You can see those events in Stamp.
  • Posts are in English for now. A Raft server has no language setting yet.
  • GitHub text is made harmless. Titles, descriptions, logins and check names are cut to one short line (a title to 120 characters, a description to 140), and images are removed. An @ or # before a name is replaced with its full-width look-alike (@, #), so it reads the same but cannot mention anyone or link a channel. [, ], <, > and & are replaced the same way, so the text cannot form a link. The only link in a post is the one Stamp builds.
  • No description from outside contributors. If the person who opened a pull request or issue is not someone Stamp trusts (a person bound on your server or a federated server, or one of Stamp's own bots), the post leaves out the start of the description. The title is still posted.

What the channel sees ​

A post carries the repository and number, the title, a link, who acted, the outcome (for example which checks failed, or which branch it merged into), and for an opened pull request or issue, the start of its description.

Anyone in the channel can read it, including people who cannot open the repository. Pick the channel with that in mind, especially for a private repository.

Deleting a subscription stops new posts. Messages already in the channel stay there.

Next ​