Example: commits on a branch
Example: commits on a branch
Ashgrove Studio builds ashgrove/storefront, an online shop that is deployed whenever something
lands on main. There are no versions and no releases: the branch is the product. The team wants a
summary of what went live in #storefront-changes, without a message for every single push.
When this fits
Watching a branch suits a repository that has no releases, or a team that wants to see the work between two releases. A repository with releases is usually better served by announcing those: they carry notes somebody wrote for readers, and a commit subject is written for the team.
What appears on GitHub
Pushes to main, each with one or more commits. GitHub reports a push to a repository the chronik
app is installed on. A repository that is only watched, without the app, reports none, and the rule
says so instead of offering the switch.
The rule
- Which repository?
ashgrove/storefront. - Where should it post? The Slack workspace and
#storefront-changes. Commits are announced in Slack only; for Discord, Telegram or a webhook the switch is not offered. - Which template? Use the default.
- What should it watch?
- Published releases and Pushed tags: off, since this repository has neither.
- Commits pushed to a branch: on. The rule then explains what will be posted, the subject line of every commit, including commits from a private repository, readable by everyone in the channel, and asks you to confirm it with I understand what will be posted.
- Which branch:
main.
A separate channel is the better place for commits. When the chosen channel already receives the release announcements of the same repository, the wizard points that out.
What arrives in the channel
Not one message per push. The first push opens a collection window, and every further push moves its end back; once the branch has been quiet for 30 minutes, one message goes out. A branch that never goes quiet gets its message after two hours at the latest, and a new window begins.
The message is marked as internal, names the branch and the number of commits, lists the subject lines of up to ten of them, says how many more there were, and links to the comparison on GitHub, where the rest can be read. It names no authors.
What can go wrong
- A force-push rewrites the history of the branch. The message then says that the history was rewritten instead of listing commits that may no longer exist.
- A secret in a commit subject reaches the channel like every other subject. The confirmation before the switch is there for that reason; a private repository makes no difference to it.
- Nothing arrives when the app is not installed on the repository, or when the branch name has a typo: a rule on a branch nobody pushes to looks exactly like a quiet branch.