Example: staging and production
Example: staging and production
Copperfield Logistics runs copperfield/dispatch, a web application with a staging server and a
production server. Staging gets a new build several times a day, production a version now and
then. The people testing staging want to hear about every build; everybody else only about what
reached production.
How the team works
- Every build for staging is published as a release from the
stagingbranch, named after the day it was built:2026.10.02.1,2026.10.02.2. On GitHub the box Set as a pre-release is ticked, because these builds are not finished versions. - A version for production is published from
mainas an ordinary release:v3.2.0.
What appears on GitHub
Two kinds of releases in the same repository: pre-releases with a date as their name, and finished
versions starting with v. chronik tells them apart by two things: the pre-release box, and the
name the patterns of a rule look at.
One rule for both
The simplest arrangement posts both into one channel, #dispatch-releases:
- Which repository?
copperfield/dispatch. - Where should it post? The Slack workspace and
#dispatch-releases. - Which template? Use the default.
- What should it watch?
- Published releases: on.
- Only tags matching:
v* 20*. Several patterns are separated by spaces, and a tag that matches one of them gets through, so this lets in the production versions and the dated builds. - Include pre-releases: on. Without it the staging builds stay out, because GitHub marks them as pre-releases.
Every staging message is marked as a pre-release, so nobody mistakes a build for the version that went live.
Two rules, two channels
When staging builds would drown the production versions, give each its own channel. Create two rules for the same repository:
| Rule for production | Rule for staging | |
|---|---|---|
| Which channel? | #dispatch-releases |
#dispatch-staging |
| Only tags matching | v* |
20* |
| Include pre-releases | off | on |
A version for production never reaches #dispatch-staging, because its name does not match
20*, and a staging build never reaches #dispatch-releases, for two reasons at once.
Check it before it posts
Under the patterns, Show the latest releases and tags lists what the repository published last and says for each one whether this rule would announce it, and if not, why: Not announced: a pre-release, and “Include pre-releases” is off, for example. The list follows the fields while you type, so a pattern can be tried before the rule exists.
What can go wrong
- A staging build published without the pre-release box is a finished version as far as chronik is concerned. With two rules it still lands in the right channel, because the patterns separate the two kinds by name.
- A dated name without a pattern that matches it stays out.
2026*matches only the builds of this year;20*keeps working next year. - The pre-release switch and a pattern can contradict each other. A pattern written for
pre-releases, such as
*-rc*, keeps out exactly what it was written for while Include pre-releases is off. The rule says so under the pattern while you type. - More on how pre-releases are recognized: Pre-releases.